Created
March 29, 2019 20:32
-
-
Save iloveitaly/c5f20c32effb9c803c7ca28b62f9ba63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: Example of using custom line item taxes in Stripe & NetSuite | |
Stripe.api_key = ENV['STRIPE_KEY'] | |
customer = Stripe::Customer.create | |
Stripe::InvoiceItem.create( | |
customer: customer.id, | |
description: 'A great product', | |
amount: 10_00, | |
currency: 'usd', | |
metadata: { | |
"netsuite_tax_percent": "10.0" | |
"netsuite_tax_amount": "1" | |
} | |
) | |
Stripe::InvoiceItem.create( | |
customer: customer.id, | |
description: '$1.00 Tax', | |
amount: 1_00, | |
currency: 'usd', | |
metadata: { | |
"netsuite_tax": "true" | |
} | |
) | |
Invoice.create({ customer: customer.id }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment