-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to process 3D Secure Payments? #161
Comments
The basic idea is that you will get a URL that you have to follow to an external site. When it's completed you will be redirected back to your app, so you have to leave your app even if it's a SPA. So when you get the response from I wrote a quick blog-post about this. |
To do it without leaving the SPA you can do as is described in this issue: #152 (comment) |
@jannejava Thanks for the blog post, but I'm hoping to use a more Webhook based approach than manual confirmation. @domis86 Thanks! |
@marbuser Someone has to correct me if I am wrong but this tripped me up: the Omnipay/Stripe is built around the manual flow. If you want the async/webhooks, you have to use Stripe's own PHP SDK. In my project, the manual flow did work much better. |
@marbuser How did you ended up implementing this? |
I'v just spent the last couple of days to implement this without the Stripe SDK and just with Omnipay and Stripe.js. That's how it worked for me to finally get the balance transaction. So you got two times a callback and depending on the url parameters you have to figure out what to do. Not sure if this is the best way, but at least it works now. |
Ok so i think you my want to do like this:
^ it always sets this paramater value to 'manual' - see full description in Stripe docs: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirmation_method . For what you want to do you should use 'automatic' instead
before the line with thats sends custom $data - so before:
This will cause that PaymentIntent will be automatically confirmed after customer finishes "3D Secure 2" authentication on client side (or if such authentication is not needed) - similar as is described in "Step 4" here: https://stripe.com/docs/payments/accept-a-payment#web-submit-payment . Then of course you need to implement your "Webhook endpoint" on your server etc. For that you need to use Stripe PHP SDK (as @jannejava mentioned above #161 (comment) ) or you can build some simpler custom solution basing on "webhook related code" from that Stripe PHP SDK repository. https://stripe.com/docs/webhooks |
So I'm initialising my payment like so;
This works perfectly fine for cards that don't have 3D Secure, and triggers my Webhook perfectly. However, as soon as I use a Stripe test card with 3D secure, after clicking 'Complete' on Stripe's test page, it sends a URL back like so;
http://mysite.test/me/transactions?payment_intent=pi_0000000000000000&payment_intent_client_secret=pi_000000000000000_secret_0000000000000000&source_type=card
I'm not entirely sure what to do with this. Since I'm developing my application as a REST API with an SPA frontend, I'm not really sure what to do with this URL and the payment remains as
The customer has not completed the payment.
in the Stripe dashboard, and my Webhook is never triggered.Hopefully someone here can help as I can't really find any sort of information about how to deal with this.
The text was updated successfully, but these errors were encountered: