#elpupper

1 messages · Page 1 of 1 (latest)

lavish eagleBOT
chrome mantle
#

Hi 👋 metadata is expecting a list of key/value pairs, but it looks like you may be passing a single value, which I beleive would be recognized as a key with a null value and wouldn't set any data. Can you try adding a key to map your value to?

buoyant carbon
#

i did that too

#

so im using trpc what im actually doing is this

            metadata: {
                userId: ctx.auth.userId,
            },
#

and the create checout is protected

#

meaning the user has to be logged in

chrome mantle
#

Wait, you said you wanted to add metadata to a Payment Intent, but you're adding it a Checkout Session in that code. What type of Event is your webhook endpoint listening for? Most of the time metadata isn't copied from one object to related objects.

buoyant carbon
#

i see

#

im listening for the payment_intent.succeeded

#

so how can i move over the metadata?

#

from checkout to the webhook

#

or should i have a event listener for the checkout and add that to my database

#

then when the intent is succeeded i update the status

#

but then the id for the intent and the checkout have to be the same

#

or some sort of id has to be the same