#josh_unexpected
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/1316734255832764426
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Of course, is the payment id the same as the request id? Thats the payment intent id: pi_3QVAP613opMQasvV0WEWHHdb
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.
hi! I'm taking over this thread.
here's the failed request ID: https://dashboard.stripe.com/logs/req_NKm6CU9IMF9Mpy
Create a subscription in live mode with 100% off coupon
I don't see a 100% off coupon in the request above
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.
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!
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.
can you log this value? process.env.COUPON_CODE
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.