#DaanVDH

1 messages ยท Page 1 of 1 (latest)

amber gateBOT
dark compass
#

Hi ๐Ÿ‘‹ I don't readily recognize those names, so I'm suspecting you may be referring to storing non-Stripe data that is relevant to your flows, in which case metadata is what you're looking for:
https://stripe.com/docs/api/payment_intents/create#create_payment_intent-metadata
https://stripe.com/docs/api/metadata

But please let me know if it seems I've misunderstood your ask.

long widget
#

Yeah I'm referring to my own application data

#

so MetaData is the way to go?

#
type Params struct {
    Metadata       map[string]string `form:"metadata"`
``` I'm guessing this is what you are referring to right?
dark compass
#

Yup, metadata is perfect for that. It allows you to store up to 50 key/value pairs on Stripe objects. The key thing to note about it, is that metadata values typically don't transfer from one object to another, so you need to be consistent with the type of object that you use when adding/referencing it.

long widget
#

Alright, I'm just setting it as a map of strings in the go driver like this:

Params:               stripe.Params{Metadata: map[string]string{"orderId": o.OrderId.String()}},
dark compass
#

Did you reference the code snippet shown in the metadata section that I linked to earlier? It shows how to leverage AddMetadata() for this.

long widget
#

Ahhh, yeah i see now. Thanks

dark compass
#

Any time!

long widget
#

Follow up question, what parameters can I use to set the transaction name/message/reference?

dark compass
#

I'm not sure what you're referring to by name/message/reference, could you elaborate?

long widget
#

I mean the recipient that is shown on the charge in your banking app and the message for like in an iDeal transaction.

dark compass
long widget
#

Ahh i see, thanks!

dark compass
#

Happy to help!