Reputation: 461
I have a business located in Canada and there is a tax of 5% I want to charge with a price of 249 CAD. For the rest of the world, I want to set a price of 249 USD with no tax. I've created multiple prices with different currencies like said here but I just can't figure out how to pass multiple prices (stripe says you can pass them in the line options)! Also, I've created a tax for the Canada region, how can I activate it when the user selects "Canada" in the checkout session?
var options = new SessionCreateOptions
{
AutomaticTax = new SessionAutomaticTaxOptions { Enabled = true },
LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
Price = "price_idUS",
Quantity = 1,
},
},
Mode = "payment",
SuccessUrl = domain + "/payment/success",
CancelUrl = domain + "/payment/cancel",
ClientReferenceId = userId,
};
Upvotes: 3
Views: 308
Reputation: 931
You don't have to create multiple Price objects. You just need to create one Price object (a multi-currency Price), specifying 249 CAD and 249 USD within currency_options. Then, you can pass in that Price ID when you create the Checkout session (you only need 1 line item). If you've already configured a 5% tax with Stripe Tax for Canada, then that should just work assuming you pass tax_behavior on the Price object for the Canadian currency option. If you don't need to collect a tax outside of Canada, then your Stripe Tax registrations should reflect that. Also, if you want all non-Canadian customers to pay in USD, you can set the default currency on the Price object to USD.
Upvotes: 1