#Omri - checkout Pi metadata

1 messages · Page 1 of 1 (latest)

past tree
#

Hi, what do you mean by a code example?

dusk peak
#

what is the syntax?

past tree
#

you can find some example here

dusk peak
#

I getting the error: Stripe::InvalidRequestError - Received unknown parameter: payment_intent_data[0]:

past tree
#

could you share your code snippet please?

dusk peak
#
past tree
#

this would fix the issue

        metadata: metadata,
      },
#

basically payment_intent_data is hash and not an array

dusk peak
#

yes, I tried it also

#

I'll send you the error

#

```Stripe::InvalidRequestError - You can not pass payment_intent_data in subscription mode.:

past tree
#

oh sorry didn't notice you were in mode: 'subscription'

#

yes basically payment_intent_data is only available for mode payment

#

A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in payment mode.

dusk peak
#

how I add metadata to the PI?

#

with subscription mode

past tree
#

could you please tell me your use case so I could help you find a suited solution?

dusk peak
#

yes, but I need the data in the webhook of payment_intent.succeeded event

past tree
#

when you're doing subscriptions you should listen to invoice.paid instead of payment_intent.succeeded

dusk peak
#

ok, and how I will get the metadata form the invoice object?

past tree
dusk peak
#

but I'm create subscription schedule not subscription

past tree
#

could you please provide an example with a request id so I could take a better look?

#

what is the price id that you are using? price_xxx

dusk peak
#

1 min

#

price_1Kt7UKKqSkWKDAjfAezhYLTo

past tree
#

ok when you say you are using subscription schedule you're doing that when you are creating a recurring price as the one you sent above?

dusk peak
#

no, I doing that after the user complete the SEPA direct debit form

past tree
#

but you are already creating a subscription when you create the checkout session

dusk peak
#

I create the checkout session with subscription mode it is mean that I'm create subscription ?

past tree
#

yes

dusk peak
#

ok so how I add the metadata to the invoice object?

past tree
#

once the user completes the checkout session the invoice will be paid and you will get an invoice.paid event on your webhook endpoint, which then you could use to get the subscription and get the metadata on the subscription

dusk peak
#

ok, thank you

#

right?

past tree
#

yes exactly