We're adding Stripe as one of the several providers for our payment gateway.
The workflow we currently use for processing Apple / Google / Samsung Pay payments is the following:
- Mobile Client generates an encrypted payment token via API provided by the OS
- Mobile Client sends a payment request to the Backend (user ID, amount, token).
- Backend sends a request to Bank API
- Bank API responds to Backend with either success or failure
- Backend responds to Mobile Client
However, after reading Stripe's documentation, I haven't found a way to implement the same workflow. Apparently, the interaction is inverted:
- Mobile Client requests a "client secret" from Backend
- Backend sends a PaymentIntent request to Stripe's API
- Backend returns the created PaymentIntent's "client secret" to Mobile Client
- Mobile Client executes the payment by directly communicating with Stripe's API using the client SDK
This seems problematic, because it requires a major redesign for both our Mobile Client and Backend applications. Moreover, it makes the abstraction leak, because now the Mobile Client is bound to a particular payment provider.
Is it possible to implement our existing workflow with Stripe's API?