#eoghanobrien_checkout-coupons-multicurrency
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1305649725327933531
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐
Hi, taking a look here
Thanks!
You can listen to checkout.session.completed event and look at amount_discount for the discounted amount.
However, I think you're asking how to attain the discount id from the events
yes, I'm specifically looking for a coupon code
It seems I can listen for customer.discount.created but that seemed strange
testing this on my end reql quick, hang tight
Ok, I think you'd want to leverage the metadata: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-metadata when you create the CheckoutSession to pass the details on the dicsount so you can see the discount information on the checkout.session.completed event .
Got it, okay, thank you!
Hi ๐
Are you applying discounts to specific line items in your Checkout Sessions?
not to the line item per se, I'm applying it using the discounts.*.coupon option
Ack. Then my colleague's approach is correct. I was just hopeful. you could get it from the line_items.data.discouts property
got it, can I do that and still get No cost orders?
How do you mean?
nevermind, I checked the API docs, I can't pass a discount.coupon to a line item so it's moot, thanks for checking in though
actually, while I have you - if I pass a amount_off coupon with an amount and currency will that amount only be applied if the customer's currency matches the currency of the coupon? Or will it dynamically adapt the amount off in say usd to whatever the presentment currency is?
I would think it would only apply if the currencies matched but have you tested this?
I haven't been able to get the alternate currency to show
You can use a dummy value for the customer_email parameter like test+location_FR@example.com to spoof a customer from France so it'll trigger a EUR presentement currency
Ah - that's cool, thanks for that little nugget! Looks like it will try to base the discount on settlement and adapt for presentment - awesome
is there a cheat sheet with more hot tips like that!
Unfortunately not that I know of. It's in our public docs somewhere, that's how I found out. But I've since implemented a dropdown with some useful emails to test multi-currency prices so I haven't had to look in a while
well thank you for your help! have a good one ๐
Sure thing! It's why we're here ๐