2017-08-10 57 views
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'); 
    }); 
} 

下面是截图:
enter image description here

回答

0

该账户的信用卡没有显示的原因是,我am 使用MYR作为我的PayPal沙箱环境中的货币在PayPal沙盒环境中,只有美元可用于任何信用卡交易,否则,当您使用其他货币进行信用卡交易时,您将收到错误。因此,在我将货币更改为美元后,一切正常。