#Nadiya-Subscription

1 messages · Page 1 of 1 (latest)

uncut prism
#

Hi there, the easiest way is using Checkout Session. You just need to pass in the price ID and the Checkout Session will create necessary PaymentIntent under the hood.

cobalt rock
#

we can't use checkout

uncut prism
#

What's your current integration?

cobalt rock
#

its a selling page building site

#

paymentElement

#

i'm saving charge_id for one time payments, i was wondering if i can do the same for subscriptions too

uncut prism
#

I see, then you can create the subscription at your server, and pass the client_secret of the latest_invoice.payment_intent to the payment elements to collect the payment.

cobalt rock
#

sorry, i already created subscription and its working. i would like to know if i can get the charge_id from the subscription object

#

i need to save charge_id if it have one

uncut prism
#

I see, you can get the charge ID from the latest_invoice.payment_intent.charges[0]

cobalt rock
#

thanks, let me check!