Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rankman's avatar

The payment attempt failed because additional action is required before it can be completed in laravel 10 cashier

namespace App\Http\Controllers;

use Illuminate\Http\Request; use App\Models\Plan; use Illuminate\Support\Facades\Auth; use App\Models\User; use Stripe\PaymentIntent;

use Laravel\Cashier\Exceptions\PaymentActionRequired; use Laravel\Cashier\Exceptions\PaymentFailure;

class PlanController extends Controller { /** * Write code on Method * * @return response() */ public function index() { $plans = Plan::get();

    return view("personalized-plan", compact("plans"));
}  

/**
 * Write code on Method
 *
 * @return response()
 */
public function show(Plan $plan, Request $request)
{
    $intent = auth()->user()->createSetupIntent();
    $plans = Plan::get();

    return view("subscription", compact("plan", "intent","plans"));
}
/**
 * Write code on Method
 *
 * @return response()
 */
public function subscription(Request $request)
{

    $plan = Plan::find($request->plan);
    
    try {
        $request->user()->newSubscription($plan->name, $plan->stripe_plan)->create($request->token);
    } catch (PaymentActionRequired $e) {
        return redirect()->route('payment.3d-secure', ['payment_intent' => $e->payment->id]);
    } catch (PaymentFailure $e) {
        return back()->withErrors(['message' => $e->getMessage()]);
    } catch (\Exception $e) {
        return back()->withErrors(['message' => $e->getMessage()]);
    }

    return view("subscription_success");
}

}

This is my controller code i am getting follwing error

The payment attempt failed because additional action is required before it can be completed.

In my stripe account dashboard payment section shown the incomplete status. I have used following card details for test.

Name: Test Number: 4242 4242 4242 4242 / 4000 0000 0000 3055 CSV: 123 Expiration Month: 12 Expiration Year: 2024

What is the wrong with my code. Please suggest.

0 likes
1 reply

Please or to participate in this conversation.