#josh_unexpected

1 messages ยท Page 1 of 1 (latest)

valid notchBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

rocky plaza
#

๐Ÿ‘‹ happy to help

#

would you mind sharing the request ID that failed?

formal star
#

Of course, is the payment id the same as the request id? Thats the payment intent id: pi_3QVAP613opMQasvV0WEWHHdb

valid notchBOT
formal star
#

I can't tell from the log if it's actually the coupon that is somehow missing, but I figured the amount capturable being 0 means it probably worked.

true elm
#

hi! I'm taking over this thread.

#

Create a subscription in live mode with 100% off coupon
I don't see a 100% off coupon in the request above

formal star
#

That's fair, neither do I. I couldn't tell if it just doesn't show it or if I wasn't sending it. I'm printing it out in my logs so I was fairly confident it must be going out. I didn't want to spend time investigating if really it just didn't work like that on live.

#

I will now of course try to find out what's happening, thank you for looking into this for me.

true elm
#

you can see exactly the request that Stripe received. so you either didn't set it, or you didn't set it properly.

#

let me know if you need more help with this!

formal star
#

That's very odd my code looks like this stripeClient.subscriptions.create({
customer: customer.id,
items: [
{
price: priceInfo.priceId
}
],
discounts: [
{
coupon: process.env.COUPON_CODE
}
]
}) so even if the environment variable wasn't set you'd think the request would have an emty object in the discounts field.

#

Anyway thank you ill do some digging and let you know if I still can't get anywhere.

true elm
#

can you log this value? process.env.COUPON_CODE

formal star
#

I have just found the source of the problem. I was able to log it in test, and I was avoiding adding logs to live as deployment can take a while. I had a spelling mistake in the environment variables for the server. Thank you for your time.