#Sourav

1 messages · Page 1 of 1 (latest)

restive caveBOT
clever rapids
#

I can't create a separate payment intent for subscription and use its client secret as the payment should come after the trial period ends.

orchid hinge
clever rapids
#

I've got the saved payment method with which im charging. Do I need to add this once I add the card?

#

$stripe->setupIntents->create(
[
'customer' => '{{CUSTOMER_ID}}',
'payment_method_types' => ['bancontact', 'card', 'ideal'],
]
);

orchid hinge
clever rapids
#

I also have the added payment method as default only when i add it at first. So while subscribing it attaches to my added default payment method only.

orchid hinge
#

Not sure I understand the issue in your last reply, could you please rephrase/give more details/Example ?

clever rapids
#

While attaching a card I set it as default. So for any further payments (may it be subscriptions) it attaches that payment method only.

#

My problem is for the $0 invoice which I get after the trial subscription create, I don't get any payment_intent so no client secret as well so that I can confirm it for 3d auth cards. I need the payment for the subscription to be taken off session when the trail ends.

orchid hinge
#

OK, so when creating a trial Subscription, you are using SetupIntent in order to collect the PaymentMethod and set it as default payment method for the customer. Now, once the trial period ends, in case that PaymentMethod requires additional action (e.g. 3DS auth), what you need to do, right ? well you'll have a new Invoice/webhook that'll notifies you you need to handle additional actions on the PaymentMethod:
https://stripe.com/docs/billing/subscriptions/webhooks#additional-action

#

You get the client_secret of the new PaymentIntent of the new Invoice (that has amount >0$ ) and use it for confirming the 3ds

clever rapids
#

Im not using the setupintent, rather just setting the card to be default in invoice settings.

#

$this->stripe->customers->update(
$customerID,
['invoice_settings' => ['default_payment_method' => $defaultPaymentMethod]]
);

orchid hinge
orchid hinge
#

You'll have a PaymentIntent in the new invoice, use its client_secret.

clever rapids
orchid hinge
#

You can't do 3ds authentication off_session in all cases, 3ds requires the customer to be on_session. But when using SetupIntent in order to collect Payments you have less chance to have a payment that request a 3DS.

clever rapids
#

Do we need to do the setupintent every time we try to take payment? Or do we just do it once after the customer is created?

orchid hinge
#

You need to use SetupIntent every time a new PaymentMethod need to be collected.

clever rapids
#

Ok thanks.