使用 Stripe 和 SCA 的 Ionic 4 Cordova 支付

Ionic 4 Cordova Payment with Stripe and SCA

使用 SCA (https://stripe.com/docs/strong-customer-authentication), 我必须更新使用 Charge API 的付款程序:https://stripe.com/docs/payments/charges-api

根据文档,我了解到我的选项是付款意向:https://stripe.com/docs/payments/payment-intents 和设置意图:https://stripe.com/docs/payments/save-and-reuse

为了在前端和后端之间进行通信,我使用了 stripe.js 元素。 问题是,为了达到 PaymentIntent API,我需要 https,而 Cordova 不是 https,而只是我在 Stripe 文档中所理解的 http:

A Stripe Element contains an iframe that securely sends the payment information to Stripe over an HTTPS connection. The checkout page address must also start with https:// rather than http:// for your integration to work.

您可以在不使用 HTTPS 的情况下测试您的集成。当您准备好接受实时付款时启用它。

我想知道如何在我的 Ionic Cordova 应用程序上使用 stripe.js 元素处理 Stripe PaymentIntent API。 如果有人有想法,那将是一个了不起的帮助!

你需要switch to using Payment Intents这里。这些 API 调用必须在服务器端进行,而您的客户端 Elements/Javascript 调用几乎可以保持不变。