#akii-subscriotion
1 messages ยท Page 1 of 1 (latest)
yes
Also i am using Payment intent that i am getting after creating subscription using API
so the Payment Method hasn't been created or saved at this point right?
you can use this param https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
Payment method is created and its saved as default for user alreday.
I only need the user to pay the subscription amount.
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
But what if the card type requires bank authentication?
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
ummm can i just send the client secret to frontend? and pass it in confirmCardPayment ?
will that work?
yeah that will work too if you're using CardElement
Do u mean it only works with Card Element?? Im using PaymentElement and it also works fine...
But confirmPayment requires a element object meaning i have to enter a new credit card, but confirmCardPayment only requires clientSecret.
you'd also need to pass in the payment method and it should be a Card
I have already attached the PM with the Paymnet intent..
if the payment_intent status is requires_action than you don't even need to use the confirm methods you would only need to use https://stripe.com/docs/js/payment_intents/handle_card_action
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!