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

geerizzle's avatar

Handling Cashier SCA Payments, why still an IncompletePayment?

Hi, I have created a vue component that calls the stripe js library, mounts the card element, with a submit method that calls stripe.confirmCardSetup(props.setupIntent.client_secret) etc

Currently just setup for single payments with Cashier and works fine. Except for card payments requiring 3D/SCA auth. When SCA is needed the popup is already coming up in JS, and I can approve it and it gets submitted, but then fails because 'additional action is required' i.e it is an IncompletePayment.

OK, so I can catch that, and re-show the authentication bit using the cashier.payment page, but why? This has been done already. Why is this not complete, the status on the submitted intent is succeeded etc?

    "id" => "seti_1N5STRC8FR3qyXMI6MRIH0JN"
      "object" => "setup_intent"
      "automatic_payment_methods" => null
      "cancellation_reason" => null
      "client_secret" => "seti_1N5STRC8FR3qyXMI6MRIH0JN_secret_NrApNBWRPBZaeplerPCur9F1nkVutMf"
      "created" => 1683546205
      "description" => null
      "last_setup_error" => null
      "livemode" => false
      "next_action" => null
      "payment_method" => "pm_1N5STRC8FR3qyXMIlAyZPfyd"
      "payment_method_types" => array:1 [▶]
      "status" => "succeeded"
      "usage" => "off_session"
    

I thought this might be a case where I ignore the IncompletePayment exception, process the order, and then update it based on the webhook confirmation, but then I can't make the charge in the first pace?!

0 likes
1 reply
LaryAI's avatar
Level 58

It seems like the issue is related to the fact that the payment is marked as incomplete even though the payment intent has succeeded. This could be due to the fact that the payment requires additional authentication, which is not yet completed.

One solution could be to listen for the payment_intent.succeeded webhook event and update the payment status accordingly. This way, you can be sure that the payment is complete before processing the order.

Here's an example of how you can handle the webhook event in Laravel:

use Illuminate\Http\Request;
use Laravel\Cashier\Http\Controllers\WebhookController;

class StripeWebhookController extends WebhookController
{
    public function handlePaymentIntentSucceeded(Request $request)
    {
        $payload = $request->all();
        $paymentIntent = $payload['data']['object'];

        // Update the payment status in your database
        // ...

        return response('Webhook Handled', 200);
    }
}

Make sure to register the webhook route in your routes/web.php file:

Route::post('/stripe/webhook', 'StripeWebhookController@handleWebhook');

Also, make sure to configure the webhook in your Stripe dashboard to point to the correct URL.

Once you have set up the webhook, you can ignore the IncompletePayment exception and process the order. The webhook will update the payment status once the additional authentication is completed.

Note: This solution assumes that you have set up the webhook correctly and that it is working as expected.

Please or to participate in this conversation.