#karls_api
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/1332435911006490645
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- karls_api, 16 minutes ago, 167 messages
This works in DEV and does not work in PROD
Hi, can you share the request id from when it works in Test mode?
I'm asking as you're using a deprectated parameter: https://docs.stripe.com/api/subscriptions/create#create_subscription-promotion_code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It's included in the ticket
You'd want to use discounts instead.
OK, works in DEV not in PROD?
Both of the requests above are from your Live mode request
Yes, I'm in LIVE mode and what was working in PROD isn't working.
Can you share the request id that worked?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Yes.. in DEV you mean? 1 sec.
sub_1QkqaCDOnh5qjbu1tnBofrNG
Like you passed discounts here: https://dashboard.stripe.com/test/logs/req_wfaVl0FhRRdG3W
Taking a look
Yeah, you passed discounts: https://dashboard.stripe.com/test/logs/req_QqkISf4ZiTI8kY
That is a different code no?
Yes, passing promotion_code. Is this not right for production?
That is under discounts
Yeah, your live request is passing promotion_codewhile your test request is using discounts.promotion_code
You would want to use: https://docs.stripe.com/api/subscriptions/create#create_subscription-discounts-promotion_code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can you change your code and try that please?
In code, I'm looking up the promotion code, grabbing the ID and addition to Options.Discounts
Let me see. Ohh..
So discounts.promotion_code is correct. Somehow promtion_code is call in production. I'll search my code for promotion_code now and proof everything. give me 5.
Sure!
In the API, there isn't a property named promotion_code (with the underscore) is there? I'm assuming not.
Hmm, I do not fully understand what you're asking. We document all params in the API and this is what you need in your code: https://docs.stripe.com/api/subscriptions/create#create_subscription-discounts-promotion_code
I think I may know the issue.
My website auto-scaling has scaled instances that do not support the changes I've recently made. I need to generate a new image to deploy these changes across my load balancer and test again.
Glad we were able to unblock you here from our end
Lolz. After walking my code, I only found updated code for adding promo code to discounts, and then it hit me...