0
后
目前我正在试图加入PayPal
到我的离子2的应用程序参照this link信用卡是不是在贝宝沙箱付款方式显示登录
在贝宝沙箱环境中提到,我不知道为什么信用卡是我使用沙盒买家帐户登录后,未在我的PayPal付款选项中显示。
这里是我的代码连接到贝宝:
payViaPaypal() {
let env = this;
this.payPal.init({
PayPalEnvironmentProduction: paypal.PayPalEnvironmentProduction,
PayPalEnvironmentSandbox: paypal.PayPalEnvironmentSandbox
}).then(() => {
env.payPal.prepareToRender(paypal.CurrentEnvironment, new PayPalConfiguration({})).then(() => {
let payment = new PayPalPayment('3.33', 'MYR', 'Description', 'sale');
env.payPal.renderSinglePaymentUI(payment).then((result) => {
if (result.response.state == "approved") {
console.log("Success!")
}
},() => {
console.error('Error or render dialog closed without being successful');
});
},() => {
console.error('Error in configuration');
});
},() => {
console.error('Error in initialization, maybe PayPal isn\'t supported or something else');
});
}