#MandalorianIV

1 messages · Page 1 of 1 (latest)

neon spadeBOT
spice haven
#

Hi there!

#

Reposting your image in this thread:

lethal wyvern
#

I want to send like order id etc. as far as I can see it is possible that passing data with metadata

spice haven
#

It should be something like metadata: { foo: "bar" }.

lethal wyvern
#

hmm

#

well normally I tried this one too

#

I can not assign metadata's value as another object

spice haven
#

well normally I tried this one too
Did it work? What's the request ID?

lethal wyvern
#

this time I get syntax related errır

#

error

#

I can not make the request at all

#

In here I have two scenarios, first one, I can send as object with contenttype x-www-urlencoded,

#

or I can encode the data and send it as string

#

contenttype application/json

spice haven
#

or I can encode the data and send it as string
Yes maybe you can try this with JSON.stringify(body)

lethal wyvern
#

req_pkvCrpY8a1mBwb?t=1683116782

#

stringify returns this one

#

it says amount is missing which is not

spice haven
#

That's because you can't set content-Type: application/json. Stripe API only works with form-urlencoded

#

Maybe you can try with metadata[order_id]: "12345" in your previous example?

lethal wyvern
#

yes that worked

#

so in order to passing data with metadata, I need to send it like metadata[order_id]: "order"

#

thanks for your great and quick solution

spice haven
#

Happy to help 🙂

lethal wyvern
#

so you're always available?

#

what should I do if I need to ask a question to you?

spice haven
#

If you have a question now, just ask it here. If you have a question later, post it in #dev-help and someone from Stripe will try to help.