I had a little bit of difficulty getting started using stripe 3D secure since I could not find an example online. I thought I would describe how I implemented for others to quickly integrate it with their system. Also, feel free to suggest modifications and improvements to my implementation.
First, my initial setup consists of 2 buttons: connect credit card and pay 100$, and a repeating group with data type Retrieve payment methods data to display the credit card linked to a user.
The workflow of the connect credit card button goes like this:
- I initially create a customer ID if the current user has none.
- Assign the customer ID to the user if need be
- I then create a session and give the success URL a parameter setup being true that I will use later. I’m not sure the payment intent data is necessary.
- I then assign the session and setup id to the customer:
- I then go to checkout to create a credit card:
- When the page is loaded, I check if the setup parameter is true.
- If it is, I attach the payment method to the customer
- Finally, I attached the payment method to the current user. (I might be able to directly take it from the previous step)
Now, the repeating group to see what payment method is linked to the customer:
Finally, the pay 100$ button:
- I create a payment intent:
- I confirm the payment intent:
I have processed a few payments over the last few days and it looks like it is working well, but as I said earlier let me know if you have comments. I would like to thank Alexandru Rusnac from Zeroqode for answering my numerous emails. Hopefully, it can help other beginners getting started with their plugin!