【发布时间】:2020-02-27 11:44:58
【问题描述】:
我花了超过 6 个小时将 paypal 集成到 React Native 中。我正在使用 react-native-paypal-lib 库。
代码:
RNPaypal.paymentRequest({
clientId: 'MY ID I KNOW',
environment: RNPaypal.ENVIRONMENT.SANDBOX,
intent: RNPaypal.INTENT.SALE,
price: 60,
currency: 'USD',
description: 'Android testing',
acceptCreditCards: true
}).then(response => {
console.log(response)
}).catch(err => {
console.log(err.message)
})
回复:
{response_type: "payment", response: {…}, client: {…}}
client:
environment: "mock"
paypal_sdk_version: "2.15.3"
platform: "Android"
product_name: "PayPal-Android-SDK"
response:
create_time: "2014-07-18T18:46:55Z"
id: "PAY-18X32451H0459092JKO7KFUI"
intent: "sale"
state: "approved"
response_type: "payment"
我也收到了回复。但是,我看不到沙盒帐户中的交易。此外,我每次都得到相同的响应 ID。
【问题讨论】:
标签: react-native-android payment-gateway paypal-sandbox