#roy_code
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/1506126120007897221
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
could you help how i can handle/store the test failure card set_intent
hello! yes, you should be creating a PaymentIntent to collect payment in order to test the error, the test card for exceeding velocity limit decline is listed here : https://docs.stripe.com/testing#declined-payments
unable to setup the intent for the error card
Just to make sure I point you in the right direction, could you clarify what you mean by "unable to set up the intent for the error card"? What error are you running into, and are you following a specific guide or doc? That'll help me better understand where things are going wrong.
Iโm trying to create a Setup Intent using a Stripe failure test card, but Stripe throws an error saying the card is invalid. My goal is to set up the intent with the failure card, attempt the charge, and test the corresponding error code returned by Stripe and proceed with our retry logic
is there a reason why you don't just try with a PaymentIntent? and have to use a SetupIntent first?
i have to setup intent first
We have our logic that will pick the record and attempt the charge
hmmm, gimme a while to see what's possible
thanks
sorry, there's no way to use that card with a SetupIntent first.
Would attaching the card to a Customer (without a SetupIntent) work? Doing it this way would just be for testing purposes
is it possible to add the payment method for error card?
without setup intent we can't charge the amount in future right?
There's actually no need to use a SetupIntent before a PaymentIntent if your goal is to charge the customer immediately, and save the payment method for future use.
If you want to save the card and charge the customer right away, you can do both in a single step using a PaymentIntent with the setup_future_usage="off_session" parameter. This saves the payment method for future use while also completing the charge in one go. More details here: https://docs.stripe.com/payments/save-and-reuse
Can you share a bit more on how your payment process works - are you saving the card and charging it at a later point in time? Or are you charging the customer immediately after collecting their card details?
charging the customer immediately and saving the paymentmethod for future auto charge
yeah, so you would want to use this flow : https://docs.stripe.com/payments/save-and-reuse
still how come we will get the paymentmethod for the error card? that is confusing me
what do you mean by you will get the payment method for the error card?
paymentmethod id
could you share a bit more detail? Specifically, what behavior are you expecting to see, and what's actually happening instead? I'm having trouble understanding why getting the PaymentMethod ID is an issue
let me rephrase my statement
one quick question :For idempotency-key param, should we always pass a different key for each request?
are you using the Stripe SDK? If so, you may already be getting automatic idempotency on retries without doing anything extra e.g. https://github.com/stripe/stripe-node#network-retries
If you want to implement things yourself, use a different key per new logical operation, but reuse the same key when retrying the exact same request. You can read more about how Stripe handles idempotent requests here : https://docs.stripe.com/api/idempotent_requests
hello ๐ I'm taking over the thread, let me know if you have further questions ๐
pls wait for a while checking few items
while adding the error card in set_up intent getting the above error.
could you share with me the request ID please? It should be prefixed with req_
req_M7RTmXVaPJ6q1g
req_M7RTmXVaPJ6q1g returned the decline code card_velocity_exceeded . I see that you're using a test card ending with 6975, which is the test card to use to simulate payment scenarios where card Exceeding velocity limit decline. In this case, the 402 error is expected, this card cannot be set up for future charges using SetupIntents.
that is what my question was, we can't use the error card in the setup for future charging?
Yes, you can't. The purpose of SetupIntent is to let merchants set up cards for successful future charges. When the SetupIntent is being confirm, Stripe does validate the card to check if it can be used in the future. It wouldn't help merchants if we allow cards that cannot be charged to be saved, because there would result in a decline in the future.
Now, is there any other alternate way to test this scenario? We are trying to implement the auto-retry logic for future payment failures. mainly for the (processing_error and card_velocity_exceeded) erro code
Is my understanding correct that you'd like to retry charging the same card even if it return card_velocity_exceeded error?
It is possible, this is the guide to follow if you want to handle decline's programmatically: https://docs.stripe.com/declines/card#retrying-issuer-declines
The handling for SetupIntentSimilar is similar to PaymentIntent, you'd want to look up the last_setup_error.advice_code on the SetupIntent and retry the SetupIntent if the advice code is try_again_later.
However, since the customer will be on-session during the SetupIntent, I would recommend asking the customer to input a new payment method instead of charging the same card that was already declined
I would recommend asking the customer to input a new payment method instead of charging the same card that was already declined.
this is what we are trying. before informing to the customer we just want to do one retry and then sending email to customer. Lets think this card might added previously, now we are getting the error means