I seem to be having a problem that was also solved a long time ago where creating a newSubscription fails because Stripe is requesting 3D Secure again, even though this should be an off_session payment and the SetupIntent was created using off_session and 3D Secure was completed successfully.
Is there something I'm doing wrong here, or is this a bug in Cashier?
<?php
namespace App\Http\Controllers;
use App\Http\Requests\LandingSubmitRequest;
use App\Models\LandingSubmission;
use App\Models\User;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
use Inertia\Inertia;
use Inertia\Response;
class PaymentController extends Controller
{
/**
* Display the Payment page.
*/
public function show(Request $request): Response
{
/** @var User $user */
$user = auth('supervisor')->user();
$clientSecret = $user->createSetupIntent()->client_secret;
return Inertia::render(
'Payment/Index',
[
'client_secret' => $clientSecret,
'stripe_pk' => env('STRIPE_KEY')
]
);
}
public function submit(Request $request): RedirectResponse
{
/** @var User $user */
$user = auth('supervisor')->user();
$paymentMethod = data_get($request, 'setupIntent.payment_method');
if ($paymentMethod) {
$user->createOrGetStripeCustomer();
$user->updateDefaultPaymentMethod($paymentMethod);
$user->newSubscription('default', 'price_1Oi0rWLlrJQvxIhfqs8sW3Ga')->create($paymentMethod);
}
return redirect('supervisor/dashboard');
}
}
Cashier Stripe Version
15.2.1
Laravel Version
10.43.0
PHP Version
8.1.27
Database Driver & Version
Postrgres 14
Description
Hey,
I seem to be having a problem that was also solved a long time ago where creating a newSubscription fails because Stripe is requesting 3D Secure again, even though this should be an off_session payment and the SetupIntent was created using off_session and 3D Secure was completed successfully.
Is there something I'm doing wrong here, or is this a bug in Cashier?
Thanks Mike
Steps To Reproduce
make a payment using card 4000002500003155 or 4000003800000446 using the code example, the challenge will happen twice.