#avinash_payment-refund-metadata

1 messages ยท Page 1 of 1 (latest)

shell iglooBOT
#

๐Ÿ‘‹ 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/1346859129351962686

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

wild krakenBOT
foggy eagle
#

Hi there ๐Ÿ‘‹

#

Can you elaborate? What object did you put the metadata on originally? It's important to note that typically metadata isn't copied from one object to another unless you do so yourself:
https://docs.stripe.com/metadata#copy-metadata

keen bison
#

i guess, its being stored in payment intent for initial payment

#

and when we initiate refund against that payment we store another payment ref

#

Basically we are trying to get payout data send to ERP system for account reconciliation ...so for all refunds we need to identify original payment reference number

foggy eagle
#

Can you elaborate on what "payment reference number" means to you? I need to be sure I understand what data you're looking for, and if it's something you provided I also need to know where you put it, in order to give advice on where to look for that data later.

keen bison
#

So we are using Zuora to get payment and zuora payment reference number gets stored in stripe during payment intent process

foggy eagle
#

I'm not familiar with how Zuora built their Stripe integration, so I'm not sure what that means.

shell iglooBOT
foggy eagle
#

I'm removing that screenshot as it wasn't clear whether it was showing real customer data (this is a public forum so that shouldn't be done here) or test customer data.

#

What object were you looking at in the dashboard; what is the object ID that is in the URL of that dashboard page?

keen bison
#

that's from test mode

#

so no risk

valid rose
#

Hi taking over for toby

#

Can you share the object id

keen bison
#

payment intent

valid rose
#

Yes but the id

#

Please share it so I can look and help you

keen bison
#

pi_3QoTx6JLAdhVHE0c1nOpER40

valid rose
#

Ok I see metadata on both the Payment Intent and Refund object

#

So what's the issue exactly?

#

The payment intent and refund have different metadata

#

If you want to see payment intent metadata on the refund object, you'll need to either set it there as well

#

Or expand the payment intent on the refund to see its metadata

keen bison
#

how do I expand the payment intent on the refund to see its metadata ?

valid rose
keen bison
#

when I download itemised payout report then i can see

#

but from balance transaction api ..i need these two details

valid rose
#

What balance transaction object are you looking at

#

Again, you're going to need to either retrieve the payment intent and refund or use expansion

keen bison
#

We are using this...but this does not give the meta data ref for refund

valid rose
#

Yeah that makes sense

#

You're listing balance transactions not refunds

#

The metadata is on the refund

#

And balance transaction objects aren't expandable actually

#

So you'd have to retrieve the actual refund object

#

Never mind

#

data.source should be expandable

#

Can you paste the response body you're seeing where metadata isn't being piped through?

keen bison
#

"id": "txn_3QhUa1JLAdhVHE0c08v71M7a",
"object": "balance_transaction",
"amount": -17000,
"available_on": 1738061461,
"created": 1738061461,
"currency": "eur",
"description": "REFUND FOR CHARGE",
"exchange_rate": null,
"fee": 0,
"fee_details": [],
"net": -17000,
"reporting_category": "refund",
"source": {
"id": "re_3QhUa1JLAdhVHE0c02DbcyCb",
"object": "refund",
"amount": 17000,
"balance_transaction": "txn_3QhUa1JLAdhVHE0c08v71M7a",
"charge": "ch_3QhUa1JLAdhVHE0c0W7jtqX6",
"created": 1738061461,
"currency": "eur",
"destination_details": {
"card": {
"reference": "2388971017207950",
"reference_status": "available",
"reference_type": "acquirer_reference_number",
"type": "refund"
},
"type": "card"
},
"metadata": {
"zrefund_number": "R-00000189"
},
"payment_intent": "pi_3QhUa1JLAdhVHE0c0rJiaRvy",
"reason": null,
"receipt_number": null,
"source_transfer_reversal": null,
"status": "succeeded",
"transfer_reversal": null
},
"status": "available",
"type": "refund"

#

This has refund metadata but orginal payment ref data is missing

valid rose
#

I see the payment intent id attached

#

Like I said earlier, you'd have to retrieve or expand that to see the payment intent metadata

#

As you only included the payment ref data on the payment intent and not the refund

keen bison
#

how do i established link between Orginalt payment and refund ?

valid rose
#

That's up to you

#

Seems like you already do this via metadata

keen bison
#

right but in balance transaction payload...i dont get that data

valid rose
#

You didn't expand it

#

Like I said earlier, you'd have to retrieve or expand that to see the payment intent metadata

keen bison
#

that's where my question is .... so i want two meta data reference in charge = refund

keen bison
valid rose
#

You expanded the refund

#

And the refund's metadata is shown in the above response

shell iglooBOT
valid rose
#

If you want the payment intent's metadata, you need to expand the payment intent as well

#

data.source.payment_intent

#

To see the metadata on the paymentintent

#

Otherwise, I recommend just setting the payment intent's ref metadata on the refund as well when you create the refund

#

If you don't want to deal with expansion

#

The issue here is the payment intent and refund are 2 fundamentally different objects

#

They can each have their own independent metadata