Skip to content

Instantly share code, notes, and snippets.

@iloveitaly
Created March 29, 2019 20:32
Show Gist options
  • Save iloveitaly/c5f20c32effb9c803c7ca28b62f9ba63 to your computer and use it in GitHub Desktop.
Save iloveitaly/c5f20c32effb9c803c7ca28b62f9ba63 to your computer and use it in GitHub Desktop.
# 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