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');
});
}