#no_checkout-coupon

1 messages ยท Page 1 of 1 (latest)

twin pikeBOT
#

๐Ÿ‘‹ 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.

tawny terrace
#

I'm gonna ad complete code like that you can understand a bit more my issue.

neat fossil
#

Hello! Sorry that's a loooooot of code for me to grasp

#

Do you have a clearer summary that's maybe 2 sentences long?

tawny terrace
#

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

neat fossil
#

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?

tawny terrace
#

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

neat fossil
#

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?

tawny terrace
#

Yes

neat fossil
#

Okay can you share the exact Checkout Session id cs_test_123 for me to look at?

tawny terrace
#

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.

tawny terrace
neat fossil
#

๐Ÿ˜… all good but that's why I am trying to ask you for real and clear information so that we understand each other.

tawny terrace
#

Yes of course ๐Ÿ˜†

neat fossil
#

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

tawny terrace
#

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?

neat fossil
#

Okay so you do use Stripe Checkout after all.

tawny terrace
#

Yes

neat fossil
#
  1. It's impossible to combine allow_promotion_codes: true" and pass discounts
  2. 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

neat fossil
tawny terrace
#

So I should allow_promotion_codes: "false" and then add discout?

neat fossil
#

yes

tawny terrace
#

Gonna try to do that, thanks for your help !

twin pikeBOT