react-native - EXPO REACT-NATIVE STRIPE PAYMENT 'expo-payments-stripe': How to use a token created?
问题描述
I can generate a token with the createTokenWithCardAsync function, but then I don't know how to use the token to go through with the payment process.
Would anyone know which functions are in the 'expo-payments-stripe'? The actual stripe functions like stripe.customers.create() or stripe.charges.create() do not work. So far I just know of 2 functions compatible with that package, the one I mentioned above and createTokenWithCardFormAsync...
Ultimately I would like to attach the token to a customer so that they don't need to put their card details everytime they want to purchase something.
Also at the moment of token creation I do not charge any money, just want to 'keep' their info just like uber does.
thanks!
解决方案
在 Stripe 上创建客户和创建费用是一个仅限密钥的功能,因此无法在您的客户端(您的移动应用程序只能使用您的可发布密钥)上完成。
因此,这里的流程是:
在您的应用程序上创建一个令牌(如您所愿)
将令牌发布到您的后端端点
您的后端端点(用 Token ID 编写的节点
stripe-node
)调用stripe.customers.create()
,将 Token 附加到 Customer稍后的费用创建也必须发生在服务器端,而不是客户端。
推荐阅读
- c# - 如何使用 LINQ 忽略我的逻辑删除实体?
- bash - 使用 bash 脚本读取 oracle 查询的输出
- substrate - 无法使用 polkadotjs 密钥环验证子密钥签名,反之亦然
- python - VS Code Python 调试。如何从错误中继续。更改后重复从行
- java - 使用目录Spring boot java创建excel文件
- react-native - TypeError:undefine is not an object(evalating--)
- python - 如何在绘图的 x 轴上添加年份?
- node.js - Nuxt.js - Axios 因“超出最大调用堆栈大小”而崩溃
- angularjs - AngularJS:如何在路由器解析中定义常量
- scala - 对列类型 double 的 desc 排序在 scala 数据框架中不起作用