#manuel_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/1417144784417718436
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, we document all of our test cards here: https://docs.stripe.com/testing?testing-method=card-numbers&payment-method=others#declined-payments
You can use these to test when using your Sandbox account's API keys
yes i know that, this is my customer:https://dashboard.stripe.com/acct_170pjcESRxUGxqvh/test/customers/cus_SzLPVcJ26kZost
and this is the number card for testing that im using for this: 4000000000000341
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
But then when I make a payment I don't see anything wrong.
That card is used to decline after you attach the payment method to the customer. If you try to charge again, 4000000000000341 it should error out.
Can you try that?
let me try again because i did that and nothing happened and the payment was succesful
Did it work?
Hello, that invoice succeeded because it has a balance due of 0 so the card didn't factor in
Looking, but you can check this yoruself by retrieving the invoice in the API or looking at it in the dashboard
For that second event, the invoice is more than 0, but you used Link as a payment method. I don't think the test card is expected to work that way when you use it through Link
so... how can i test the cards for failed payments?
In the first case it was because the customer had enough balance to cover the amount of the invoice
When the payment element gives you the option to pay with different payment methods, you choose "Card" not "Link"
Here, I would recccommend creating a new customer to test with
When a card is used with insufficient funds, is there a way to know if the payment has failed? How can I do this?
There are also use cases where a customer has a card already added and has made payments previously, and suddenly one day there's no more money on the card. What happens when this happens? Is there an event? How can I find out?
An error will be thrown, and event will be created, or you can check the last_payment_error on the payment intent
https://docs.stripe.com/error-handling#use-stored-information
Apologies for missing that quesiton. Can you tell me more about what you are trying to do overall here? Like are you trying to handle declines during your payment process, or do something else?
There are also use cases where a customer has a card already added and has made payments previously, and suddenly one day there's no more money on the card. What happens when this happens? Is there an event? How can I find out?
Unfortunately Stripe isn't notified of this so there isn't a way to get notified of this automatically. Either the user would have to try to initiate the payment again or you would
im trying to test the payment failed cards
but i cant test it with the test card
when a payment method has been created
i created this new customer: https://dashboard.stripe.com/acct_170pjcESRxUGxqvh/test/customers/cus_T3l4poVx1DDcq1
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
When I use card 4000000000000341 it works as it's supposed to
but when i create the subscription and wants to upgrade the subscription how can i get a payment intent failed?
Once the card with that number has been saved to the customer, you should be able to just upgrade the subscription with prorations and that will try to charge them
It would have worked before, but the specific customer you tested with already had a credit balance for some reason, so the balance paid for the invoice without a payment being attempted. That is why I suggested creating a new customer, they won't have a balance
i created a new customer and the payment wasnt succesful because the test card that i was using (4000000000000341)
then i used the test card that allows me to do succesful payments (424242424242)
._.
Nice, so you are able to test this properly now?
no
im getting this error
stripe._error.InvalidRequestError: Request req_bqBBAoLrDihoKQ: This customer has no attached payment source or default payment method. Please consider adding a default payment method. For more information, visit https://stripe.com/docs/billing/subscriptions/payment-methods-setting#payment-method-priority.
but the customer has a payment method attached https://dashboard.stripe.com/acct_170pjcESRxUGxqvh/test/customers/cus_T3l4poVx1DDcq1
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Hi there - I'll be taking over for Pompey here, who needed to step away
the request that set pm_1S7f8WESRxUGxqvhAKKaPml5 as the invoice_settings.default_payment_Method on the Customer, which is what we're talking about in a Subscriptions context here, happened about 5 minutes after req_bqBBAoLrDihoKQ
req_bqBBAoLrDihoKQ = 2025-09-15 16:15:53
req_eyU3g3Sho0frM6 = 2025-09-15 16:20:17 (adding payment method)
what means 'past_due'?
I assume you're referring to Subscriptions: How Subscriptions Work