#no_checkout-coupon
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/1270423534954483712
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'm gonna ad complete code like that you can understand a bit more my issue.
config.js page :
Pricing.js component :
Hello! Sorry that's a loooooot of code for me to grasp
Do you have a clearer summary that's maybe 2 sentences long?
Hello, yes
So basically I tried to add a coupon automatically when a user click on checkout button. But it doesn't apply at all.
I know the code is working because I tested it manually and I copy/pasted the promo_id directly
Let me know if you need any details
Okay let's take 20 steps back because there are dozens of ways to integrate Stripe and Checkout is a really specific product on our end.
How are you integrating Stripe in one sentence?
I have an /api/stripe/create-checkout/route.js with the code to create the checkout. 2. I have a libs/stripe.js where Stripe is imported and sessions/etc... is managed
with the code to create the checkout
What does that mean exactly? What is "the checkout"? You mean you are calling the Create Checkout Session API?
Yes
Okay can you share the exact Checkout Session id cs_test_123 for me to look at?
Sorry my fault maybe I was unclear. In the api, I call the "createCheckout" method. This method was created inside my /libs/stripe.js page (with the priceId, mode, couponId) coming from my config.js file.
Or if so where I can found that, in my Stripe dashboard?
๐ all good but that's why I am trying to ask you for real and clear information so that we understand each other.
Yes of course ๐
We're running a bit in circles because we both say the word Checkout with a capital C without being clear if we mean the same thing
Are you using our Checkout product where we have our own payment page: https://stripe.com/docs/payments/checkout
I use the Stripe-hosted page the url is (checkout.stripe.com...), I use the following method. To create my Stripe session i use the following : stripe.checkout.session.create -> Where I reference "allow_promotion_codes: true" and my couponId under discounts
Is it more clear?
Okay so you do use Stripe Checkout after all.
Yes
- It's impossible to combine
allow_promotion_codes: true"and passdiscounts - Since you are the developer writing that code you should be able to log a real Checkout Session id and share that with me
no_checkout-coupon
okay so https://dashboard.stripe.com/test/logs/req_pCUQJw67S5xlPS is the API Request that created that Checkout Session. You can see you did pass allow_promotion_codes: "true" as a parameter but you never passed discounts.
If you did it would have errored anyway
So I should allow_promotion_codes: "false" and then add discout?
yes
Gonna try to do that, thanks for your help !