#akii-subscriotion

1 messages ยท Page 1 of 1 (latest)

raven imp
#

๐Ÿ‘‹ happy to help

#

is the payment method attached to the customer?

fast glade
#

yes

#

Also i am using Payment intent that i am getting after creating subscription using API

raven imp
#

so the Payment Method hasn't been created or saved at this point right?

#

and use confirmCardPayment (if you're using the CardElement) or confirmPayment(if you're using PaymentElement) and once the PM is validate it will be saved on the subscription object for future usage

fast glade
#

Payment method is created and its saved as default for user alreday.

#

I only need the user to pay the subscription amount.

raven imp
#

then you could set the payment method to be the customer's invoice_settings.default_payment_method

#

and it will do the trick for you

#

without having to confirm the payment on the front end

fast glade
#

But what if the card type requires bank authentication?

raven imp
#

in that case it's better if you send the user to the Hosted Invoice Page

#

on each invoice there's a url under hosted_invoice_url

#

this will give the user the possibility to pay the invoice

fast glade
#

ummm can i just send the client secret to frontend? and pass it in confirmCardPayment ?

#

will that work?

raven imp
#

yeah that will work too if you're using CardElement

fast glade
#

Do u mean it only works with Card Element?? Im using PaymentElement and it also works fine...

raven imp
#

you'd have to use confirmPayment

#

as mentioned earlier

fast glade
#

But confirmPayment requires a element object meaning i have to enter a new credit card, but confirmCardPayment only requires clientSecret.

raven imp
#

you'd also need to pass in the payment method and it should be a Card

fast glade
#

I have already attached the PM with the Paymnet intent..

raven imp
strange whale
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!