Hey,
I have an issue with a refund object passed in an event's
data.object.
99% of the refunds I get are returned as lists, which I understand are arrays. They look like this:
"refunds": {
"object": "list",
"data": [
{
"id": "re_1B5KWIE7R8BZB6Yn6GwbyrFR",
"object": "refund",
"amount": 8000,
"balance_transaction": "txn_1B5KWIE7R8BZB6Ynh5ajRnMw",
"charge": "ch_1B3O76E7R8BZB6Yn2QYduSdu",
"created": 1506199598,
"currency": "usd",
"metadata": {
},
"reason": "requested_by_customer",
"receipt_number": null,
"status": "succeeded"
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/charges/ch_1B3O76E7R8BZB6Yn2QYduSdu/refunds"
},
However, I have an issue with 1 event in particular, which returns the refund's details like this, which is not passed in
refunds.data, but directly in
refunds.
This is also the 1st refund I see with a
reason: duplicate. Not sure what that means.
"refunds": [
{
"id": "re_BbVaXPz4KV3DLV",
"object": "refund",
"amount": 63900,
"balance_transaction": "txn_BbVa5kVmzkDOpd",
"charge": "ch_BIsd9VvNQv9iv9",
"created": 1508337029,
"currency": "usd",
"metadata": {},
"reason": "duplicate",
"receipt_number": null,
"status": "succeeded"
}
],
Questions:
- Is it normal that refunds sometimes returns a data object, sometimes not? According to the API doc, it's supposed to be a hash with a data property that contains an array. I might have misunderstood what a list is.
- What does "reason: duplicate" means for a refund? If my objective is to list refunds made on purpose, does this count as a refund my user would care about, or is it some kind of internal operation I can just ignore?
Thanks,
Julien