#NeetCode
1 messages · Page 1 of 1 (latest)
Ah, I just checked the network tab and the error is:
{
"error": {
"code": "amount_too_small",
"doc_url": "https://stripe.com/docs/error-codes/amount-too-small",
"message": "Amount must be no less than $50.00 usd for Affirm payment method.",
"param": "amount",
"request_log_url": "https://dashboard.stripe.com/logs/req_cCU4eUPKU2zPyY?t=1665780367",
"type": "invalid_request_error"
}
}
Hi there!
Ah, I take it you don't see an error if you try to pay with a card instead of Affirm?
But it's strange that the error presented to the user is This code is invalid, even when I don't have the affirm payment option selected and I'm using Card.
Unfortunately I do
Hi, stepping in for roadrunner as they had to step away. The reason you're seeing come coupons apply to certain products and some not is due to maybe how you created the coupons. When creating the coupon, you can specify which product to apply it to, https://stripe.com/docs/api/coupons/create#create_coupon-applies_to. If you try to apply this coupon to a different product, then it would not work.
On the second issue, let me look at the request where you're seeing this "code": "amount_too_small" error.
Yeah, I think the issue is you cant use Affirm for payments less than $50 dollars. But for some reason it blocks the coupon from applying even if i have card selected.
Now that i know what the issue is i will try to work around it. But it seems like this is sort of an edge case bug.
With affirm, there minimum payment allowed is $50, https://stripe.com/docs/payments/affirm so I think that is expected. However, I find it odd that it block you from adding the coupon when you use a card. Can you share more on this?
Basically I get a This code is invalid. error, but when i look into the network tab I find the real issue is affirm doesnt allow payments less than $50 which is fine.
But this happens regardless of which payment method i have selected, even if it's not affirm.
Can you share exact steps that I can try to reproduce on my end?
It should not be the case and I was unable to reproduce it on my end. It sounds like somehow Affirm is always selected as a Payment Method. Can you share your URL where I can test and reproduce?
Here is the link to Stripe checkout (PROD): https://pro.neetcode.io/c/pay/cs_live_b1c0NETk1Z8pGaaMjynaFu659yEZnI7frOL2ja8bQFdhcs3Q2mR40L96rb#fidkdWxOYHwnPyd1blppbHNgWjA0TnM9aUhERk82Q2J8VVFiSWphf3FmYlxBRktfc0FnYnA9QndqVlxdXDNocGB0NHJKUnVkbG01cVxmVHNEXEZEf2s9MFV8PXBJc1ZzNkhnYHBKMlYzcTxBNTVCc1ZLM2JdbScpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPydocGlxbFpscWBoJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl
The coupon code is PPP
It does not work for the above product, but it works for this one which doesn't have Affirm available: https://pro.neetcode.io/c/pay/cs_live_b1XKfhodUipBvGOomucqiaYaNRAzaLXXiM7SQCrCmkFNx0E61yIuckaqkM#fidkdWxOYHwnPyd1blppbHNgWjA0TnM9aUhERk82Q2J8VVFiSWphf3FmYlxBRktfc0FnYnA9QndqVlxdXDNocGB0NHJKUnVkbG01cVxmVHNEXEZEf2s9MFV8PXBJc1ZzNkhnYHBKMlYzcTxBNTVCc1ZLM2JdbScpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPydocGlxbFpscWBoJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl
Can you share how the coupon was created? Was it created for a specific product?
I created it through the stripe dashboard, I didn't configure much, other than setting it to 67% off and setting the maximum redemptions and manually set the code to be PPP
No specific product tied to it
Strangely, the coupon was actually successfully redeemed by a user for the one-time purchase product. I think because that customer is from a country where Affirm is not available.
I guess i'll try disabling affirm just to confirm that it's causing the issue
I'm working on reproducing on my end, please give me a few minutes
No worries
I was able to reproduce it on my test environment as well, thank you for your patience. It looks like the product team is aware of this edge case and we're working on a fix here. There is not a timeline that I can share but you're right, it's not working. As a work around, I'd disable Affirm like you said above. Again, hank you for bringing this to our attention.
No worries, thanks for helping to investigate!