【发布时间】:2020-04-22 20:35:54
【问题描述】:
我来自 React Web 背景,我熟悉在线支付 API。目前,我正在使用方形阅读器 SDK 的 react native 快速入门。 SDK 使用:
await startCheckoutAsync(checkoutParams)
这是一个无需连接到后端即可通过移动应用程序处理付款的功能(这是我在 Web 应用程序开发中所习惯的)。结帐参数如下所示:
// A checkout parameter is required for this checkout method
const checkoutParams = {
amountMoney: {
amount: 100,
currencyCode: 'USD', // optional, use authorized location's currency code by default
},
// Optional for all following configuration
skipReceipt: false,
collectSignature: true,
allowSplitTender: false,
delayCapture: false,
note: 'Hello ???? ???? World!',
tipSettings: {
showCustomTipField: true,
showSeparateTipScreen: false,
tipPercentages: [15, 20, 30],
},
additionalPaymentTypes: ['cash', 'manual_card_entry', 'other'],
};
但是我的问题是无法将订单与此结帐流程相关联。 根据 Square Reader 文档: https://github.com/square/react-native-square-reader-sdk/blob/master/docs/reference.md#checkoutparameter
checkout 参数不接受订单 ID,或者以某种方式映射正在出售的商品,这与在线创建支付 API 不同: https://developer.squareup.com/reference/square/payments-api/create-payment
在 API 调用中指定一个订单 ID。
如何正确处理将订单 ID 关联到 react-native 读卡器 sdk 结帐流程
【问题讨论】:
标签: react-native square-connect square