#rahulbhai7_api
1 messages · Page 1 of 1 (latest)
đź‘‹ Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1253419710922489868
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
Hello! To clarify, are you trying to add a discount on your end so the customer sees it when they get to Checkout, or are you trying to give the customer the option to provide a promotion code during Checkout?
Not just a customer, all customers
Not a discount. When you’re in the checkout session, there is currently not a way to add a coupon. The field isn’t even there.
When you create the Checkout Session you need to set allow_promotion_codes to true: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-allow_promotion_codes
Would I have to do this in my website code or the stripe API?
You need to change your Checkout Session creation code.
Where would that be?
Are you a developer? Did you build the integration you're using?
Your developer should know where the code is.
it’s integrated into the website
Did you integrate it?
How did you do that? Did you follow a guide? Can you link me to the guide?
I don’t have it on me right now as I thought this would be a simple fix.
But it seems more complicated than I thought
I can't say how complex it is without knowing more. Where is your website hosted, for example?
Are you using a CMS? If so, which one?
Basically, in my admin panel of the website, there is a general setting area.
Allow me to explain.
Admin panel? Are you using something like WordPress?
This is a public server, anyone can see this conversation, so don't share anything sensitive please.
Also note that we can't log in to your system.
This is what we have and then it redirected me to stripe to create an account.
You should never share your secret API keys, as they can be used to do just about anything on your account. Since you shared your key here I strongly recommend you immediately roll your API key (which will create a new key and block the old one) as explained here: https://stripe.com/docs/keys#rolling-keys
It sounds like you're using a third-party system or plugin. You would need to contact that third-party for help with what they built.
Also, I noticed when you first submitted your question it didn't create a thread. Can you tell me what happened on your end the first time? Did you see an error?
Well, the system is pretty complex and we’re trying to do a simple thing
I mean here, on Discord.
It didn’t post the first time
When you first tried to send in your question it didn't work, and I was wondering what happened on your end. Did you see an error?
No it just didn’t post I’m not sure why
Hm, okay, will look into that, thank you!
I’ll roll back my api but it shouldn’t be a problem since you deleted within seconds
I think you may have missed the point.
My developer said to speak to you.
They said all you do on our end is to enter the secret and publishable key, the rest we do on stripe.
Me
So your goal is to get Stripe Checkout to allow your customers to enter a promotion code on the Stripe Checkout page, right?
Yes
Okay, are you using Payment Links, creating Checkout Sessions, or doing something else?
Checkout session
Okay, so the code you're using to create Checkout Sessions needs to set allow_promotion_codes to true: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-allow_promotion_codes
On our platform, if you scheduled a lesson with a Tutor for 20, it directs you to make a payment via Stripe on the checkout session.
After logging in where do I go to do this?
I don't know what you mean. Logging in to what?
To the stripe dashboard
Because there’s no code in our platform to put that in there so we are confused is this a stripe thing? Or on our end, I don’t have access to the code
Hi there đź‘‹ jumping in as my teammate needs to step away soon. This isn't something you change in your Stripe dashboard, as far as I'm aware, it needs to be changed in your code that creates the Checkout Sessions, which should reside on your server rather than in your website.
But the issue is when you select to pay for the session to directs you to the checkout session powered by stripe
Your code should be creating those Checkout Sessions before directing your customers to them.
Im going to need to reach out again.
Unless you're leveraging something besides Checkout Sessions, like Payment Links.
So, what piece of code do I put in?
The second code sample in this section has highlighted the line that needs to be added to your Checkout Session creation request in order to cause the customer-facing field for Promotion Codes to be displayed.
https://docs.stripe.com/payments/checkout/discounts#promotion-codes
Alright well let me get in contact with my developer and have him do this because this is vital step.
Thanks for your help I appreciate it
This chat doesn’t delete right?
That's correct, it should be here, and accessible via the following link:
https://discord.com/channels/841573134531821608/1253419710922489868
The thread may get closed if it's idle for a while, but the thread is still accessible and we'll still be around to help with any followup questions if that happens.
I will be resorting to it tomorrow morning
One final thought on this.
The way this message is phrased, makes it sound like you may be using a prebuilt third-party Stripe integration, which only requires your keys to begin functioning, rather than maintaining your own integration. If that's the case, we likely won't be able to provide guidance on how to enable Promotion Codes for your Checkout Sessions, as the integration you're using may handle that in a different way than you would need to if you were managing the integration yourself. I'd recommend reaching out to the third-party providing the prebuilt integration if so, they'll be best suited to provide guidance on how to make adjustments in the integration they provide.