如何解决如何将支付网关部署到真实环境中?
我通过使用“ react-native-paypal-wrapper”在我的react-native应用程序中集成了支付网关。 如何在实际环境中测试和部署它?现在,当我输入任何错误的电子邮件和密码时,它就会通过。我认为我的代码正在测试中。
那是我的代码。如何使其在实际环境中工作?
_onPay = () => {
const options = {
merchantName: "sss",merchantPrivacyPolicyUri: "https://example.com/privacy",merchantUserAgreementUri: "https://example.com/useragreement",}
PayPal.initialize(PayPal.NO_NETWORK,PAY_PAL_CLIENT_ID);
// PayPal.obtainConsent().then(authorization => console.log('authorization',authorization))
// .catch(error => console.log('error',error));
// const metadataID = await PayPal.getClientMetadataId();
PayPal.pay({
price: '19.99',currency: "USD",description: "19.99 USD will be paid",})
.then((confirm) => {
console.log('confirm',confirm);
this.setState({ isPaid: true })
Alert.alert("Congratulation!"," 19.99 USD was paid.");
// this.paymentHandler(confirm.response,subscription_id,days,userID);
})
.catch((error) => {
if (error.message !== "User cancelled") {
Alert.alert(error.message);
}
console.log(JSON.stringify(error));
});
}
解决方法
您是否已阅读所使用的2年包的the documentation?
Timedelta
除了在此处指定PRODUCTION之外,获取生产客户ID的位置还来自https://www.paypal.com/signin?intent=developer&returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Fapplications中应用程序的“实时”标签
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。