#Bill Reynen
1 messages · Page 1 of 1 (latest)
So you need custom metadata on each individual transaction (Payment Intent object)?
I need the same metadata on all the transactions for this one payment link. I do not need it to be custom per transaction.
Yeah unfortunately that's only doable through code at the moment
so do I need code on my website to make use of the payment link or do I just need code to download the transaction details WITH the metdata after the transaction is completed?
You can use a payment link without code. The issue is the metadata piece. That's behavior that's generally used by folks who are coding/automating things, so that part will need to be done with code
Thanks for the speedy reply. So the metadata I defined in the payment link is really stored somewhere in Stripe with each transaction and I need to use api calls to download the transactions WITH the metadata? Can you point me towards what API call that would be or what parameters I need to send to that call? Thanks
So when you set metadata on the payment link itself, that metadata is only stored on the payment link object. The individual transactions are separate API objects in Stripe, and we don't copy metadata across objects in Stripe
However, if all metadata will just be the same, you can fetch the metadata stored on the payment link with this api call: https://stripe.com/docs/api/payment_links/payment_links/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What's your use-case for having that metadata propagated to each individual transaction?
thank you. My use case is that I intend to set up a handful of payment links. Each with different values for the same metadata fields. We are a non-profit and intend to use these links for donations. I would define two metadata fields. EFFORT_CODE and DESIGNATION (cause). Each payment link would have a value for EFFORT_CODE value and DESIGNATION value.
So at the very least I would need to know that the payment link identifier is stored with each credit card transaction.
Ah ok that makes sense. So the workaround here would be to listen for checkout.session.completed webhook events and then in your webhook handler code for those events, update the payment intent object with the metadata fields on the checkout session object (since metadata is carried over from the payment link object to the checkout session object: https://stripe.com/docs/api/payment_links/payment_links/create#create_payment_link-metadata). When a customer visits the payment link, that creates a checkout session, which inherits the payment link's metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
We have a feature-request that many folks have requested internally to automatically copy metadata from the payment link to the individual payments. Can I have your account ID so that I can add it to that feedback?
Sure. Give me a minute to locate it
So is there a link in the transaction connecting it to the payment link?
No unfortunately not. You'll need to use that webhook approach I outlined above
Our "Account Name" is uif.uillinois.edu. Is that what you need?
got it. here it is: acct_1HpcXMB8pLhgPCcL
Thanks
Thanks so much for your help today. This was very helpful
I'll add that to the feedback form for that request
have anice day. bye
No problem! Same to you!