【问题标题】:Save payment for later option, Stripe, React Native, Expo为以后的选项、Stripe、React Native、Expo 节省付款
【发布时间】:2021-10-21 09:12:48
【问题描述】:

我正在尝试设置一种方法,以便在 React Native Expo 项目中使用预构建的 Stripe 组件为以后设置付款。

我正在关注这个项目:https://snack.expo.dev/@charliecruzan/stripe-react-native-example?platform=mydevice

如果您转到PaymentsUICustomScreen.tsx,您会看到有一个选项可以保存付款以供稍后在屏幕上呈现该选项时使用。

当我实现相同的代码时,我没有得到相同的选项。

我正在使用useStripe 函数。

这是流程:

import { useStripe } from '@stripe/stripe-react-native'
...
    const { initPaymentSheet, presentPaymentSheet } = useStripe();
...
await initPaymentSheet({
    customerId: 'customerID',
    // customerEphemeralKeySecret: ephemeralKey,
    paymentIntentClientSecret: clientSecret,
    customFlow: false,
    merchantDisplayName: 'Example Inc.',
    applePay: true,
    merchantCountryCode: 'US',
    style: 'alwaysDark',
    googlePay: true,
    testEnv: true,
});

我的问题是,为什么我没有保存付款方式以备后用?

【问题讨论】:

标签: react-native expo stripe-payments


【解决方案1】:

您应该在前端和后端使用 ephemeralKeys,以便在成功付款后您的付款详细信息将保存在条带中。

【讨论】:

    猜你喜欢
    • 2020-05-19
    • 2022-01-19
    • 2021-09-09
    • 2022-01-19
    • 1970-01-01
    • 2019-03-10
    • 2020-01-25
    • 2019-03-30
    • 2020-10-13
    相关资源
    最近更新 更多