#Nacho (Ignaxio)
1 messages · Page 1 of 1 (latest)
this has a message saying that refund state is successed and refunded flag is false.
Could you elaborate on this part? And give us the event id? evt_xxx
My understanding is charge.refunded returns a Charges object, and by looking at its refunded property (https://stripe.com/docs/api/charges/object#charge_object-refunded) you can determine if it has been fully refunded or not
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok.. is from development mode... give me a minute...
evt_3LiNRWC4xNOVLK7x1BQuNDH5
Ah okie so in this case it's failed because it's a partial refund
refunded boolean
Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.
In this case you can be confident that Charge has been partly refunded, and that part refund was succeeded, by looking at the Refund block inside the Charge object
"refunds": {
"object": "list",
"data": [
{
"id": "re_3LiNRWC4xNOVLK7x1DRBeT34",
"object": "refund",
"amount": 2399,
"balance_transaction": "txn_3LiNRWC4xNOVLK7x1sQp4qe6",
"charge": "ch_3LiNRWC4xNOVLK7x1JQ2Ecxl",
"created": 1663269792,
"currency": "eur",
"metadata": {
"env": "development",
"refund_id": "11"
},
"payment_intent": "pi_3LiNRWC4xNOVLK7x1HksNUST",
"reason": "requested_by_customer",
"receipt_number": null,
"source_transfer_reversal": null,
"status": "succeeded",
"transfer_reversal": null
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/charges/ch_3LiNRWC4xNOVLK7x1JQ2Ecxl/refunds"
},
Yes...! I had misunderstood the meaning of the refunded flag
thanks for that
but... How can I do to know that this refund (re_3LiNRWC4xNOVLK7x1DRBeT34) is really pending and it will be rejected later...?
Because a few minutes later I get another webhook (charge.refund.updated) that changes the status of the refund to failed.
How can I know that the webhook (charge.refund.updated) will arrive when I receive the first webhook (charge.refunded)?
Did you have another charge.refund.updated event after evt_3LiNRWC4xNOVLK7x1BQuNDH5 ?
yes...
Can you give the event id?
evt_3LiNRWC4xNOVLK7x1rC4MjE7
I need to do some things in my system only if the refund is successful, and do nothing if it fails. (thanks a lot for your time!!)
You used this card, right?
Yes! Exactly"
What I can say is that case can happen and unfortunately we don't have any property to forsee it. It seems depends on how the card network and the issuing bank deal with the Refund in their system.
But it's a reasonable question. You can try asking Support if they have further knowledge about refunding and funds flow
Despite I have a feeling it's just how it works
ok... I'll try
Thank you very much anyway. You have been very helpful to me. I thank you
np and good luck!