Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe PHP 3D secure payment without Stripe.JS?

I'm not using Stripe.JS because I need custom UI. I have collected card information from my customer. I'm using the PHP SDK. My workflow is:

  • create customer
  • add/attach payment method to customer
  • create payment intent

Every works fine. Now the issue that is if the end user uses a 3D secure card, I get a next_action in the response:

"next_action": {
    "type": "use_stripe_sdk",
    "use_stripe_sdk": {
      "type": "three_d_secure_redirect",
      "stripe_js": "https://hooks.stripe.com/redirect/authenticate/xxxxxx?client_secret=src_client_secret_xxxxxxx",
      "source": "src_xxxxxx"
    }
  },
  "next_source_action": {
    "type": "use_stripe_sdk",
    "use_stripe_sdk": {
      "type": "three_d_secure_redirect",
      "stripe_js": "https://hooks.stripe.com/redirect/authenticate/src_xxxxxx?client_secret=src_client_secret_xxxxxx",
      "source": "src_xxxxxx"
    }
  },

The documentation then relies on Stripe.JS for this step to open a verification popup. I'm not using Stripe.JS for the first part of the implementation due to custom UI. Can I use Stripe.JS for this part only? Or how do I do this part WITHOUT using Stripe.JS ? How do I know if this next step is successful so I can confirm the payment? I also see in my dev dashboard that the payment so successful (confusing). But the documentation says I still need to confirm that payment intent?

like image 215
Eric Avatar asked Sep 01 '25 03:09

Eric


1 Answers

Stripe has documentation about handling 3D Secure manually without Stripe.js which will guide you through what you need to do.

That said, you can create your own custom payment form with Stripe.js using Stripe Elements, which is strongly recommended to increase security and reduce your PCI compliance burden.

like image 57
Justin Michael Avatar answered Sep 02 '25 17:09

Justin Michael