Reputation: 21
Scenario: I want to create a subscription and also one time payment with the same card. I am using 3D secure card number 4000002500003155 so I got a popup to convert 3D autentication. Once I confirm, I submit payment method to server using Ajax, and I update the default payment method and subscription is creating successfully but one time charge with the same default payment method is throwing this exception: "The payment attempt failed because additional action is required before it can be completed."
How can I use the same card to create subscription and one off payment with 3D secure card: 4000002500003155
Here is my frontend code:
stripe.confirmCardSetup(clientSecret, {
payment_method: {
card: cardElement,
billing_details:{ name: "{{$data->first_name}} {{$data->last_name}}"}
},}).then(function(result) {
if(result.error){
}else{
}}
Hoping for some help in this.
Upvotes: 0
Views: 1531
Reputation: 1306
If you review the description for that test card, you'll see that it requires 3DS for one time payments unless set up and used as off-session.
If you make your one-time payment intent as off-session, after doing the card setup and attaching to a customer as you've done, then it should succeed.
\Stripe\PaymentIntent::create([
'amount' => 2000,
'currency' => 'usd',
'payment_method_types' => ['card'],
'customer' => 'cus_123',
'payment_method' => 'pm_456',
'off_session' => true,
'confirm' => true,
]);
Upvotes: 1