#divya.shalini.ics
1 messages Β· Page 1 of 1 (latest)
If you use declined test card in a payment, it should trigger charge.failed event
Can you share the Payment Intent (pi_xxx) that you attempt to use declined test card, but doesn't have charge.failed event?
Actually I am trying to add decline test cards but not able to add any of those
Showing like this
Oh! I see that you're trying to setup a payment directly via Dashboard
You can use "Decline after attaching" test card - 4000000000000341 for this use case: https://stripe.com/docs/testing#declined-payments
I tried it through api also
Have you tried the test card I mentioned?
Let me try this
Please don't close the thread
Ok, These card is triggered both charge.failed and payment_intent.payment_failed. But is there any way that we can check it while payment intent is getting success?
For an example
While placing any order/payment_intent person do have balance is his card, but while closing the order/capturing the payment intent to success he doesn't have sufficient fund in his card or maybe card would get expired in that month.
I want to check this scenario
Is there any way to check this?
Once the authorisation of a payment is successful, it's not possible to have insufficient fund error as the bank has reserved the funds for payment
Oh ok
For any order we have these may webhook events right?
While creating any order from our application we are trigger below 3 webhooks
It depends on your use case. What are you trying to achieve?
And while closing any order we are tiggering below three webhooks
I am trying to check if in real time scenario there be any order which has been placed for future date
And at the time of order closing, if there be any case of charge getting failed or payment_intent getting failed then to handle those cases, how to achieve it?
To find out whether the payment has been succeeded payment_intent.succeeded event can be listened. If payment_intent.succeeded event has been sent, there shouldn't be any further payment failures since the payment has been made successfully
And in code I am calling below to capture the intent
Is there any card or any specific set of steps to check that?
Ah I see that you use separate auth and capture flow. When the payment is authorised successfully, payment_intent.amount_capturable_updated will be sent. Only when the payment is captured successfully, then payment_intent.succeeded will be sent.
You can use any successful test card to test above flow: https://stripe.com/docs/testing#cards
I tried all the declined card, but it's not getting attached showing error of respective cards.
https://stripe.com/docs/testing#declined-payments
Also tried using below card then, while placing order only it's throwing error of charge.failed and payment_intent.payment_failed
Decline after attaching 4000000000000341 Attaching this card to a Customer object succeeds, but attempts to charge the customer fail.
That's why I am not able to achieve the scenario while closing the order
Is there any other way or any other cards?
I see! If you're attempting to test capture failure, I'm afraid we don't have such test card for that
Oh ok. So in that case, only live card is only option to check right?
Yup, it may happen in live mode
No problem! Happy to help π
From https://stripe.com/docs/expand/use-cases#charges-in-payout:
You can only retrieve balance transaction history on automatic payouts. If you have manual payouts enabled, you must track transaction history on your own.
Is there a way to know through payout id if it is manual of automatic?
Because sometime it is coming from connected account some time it is coming without connected account also
So is there a way where I can get it in a go?
Without account ID, it's likely the payout is for the platform. If it's a connected account, you can check settings.payouts.schedule.interval field with Accounts API: https://stripe.com/docs/api/accounts/object#account_object-settings-payouts-schedule-interval
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Oh ok
What about this?
You can check automatic field under the Payout object: https://stripe.com/docs/api/payouts/object#payout_object-automatic
automatic: true means the payout is automatic; automatic: false for manual payout