不允许付款给该商家(无效的clientId)-Ionic iOS [英] Payments to this merchant are not allowed (invalid clientId) - Ionic iOS

查看:136
本文介绍了不允许付款给该商家(无效的clientId)-Ionic iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Paypal插件进行离子操作,无法在iOS上运行

Im using the paypal plugin for ionic and is not working on iOS

我已经在android上运行了该插件,并且工作正常,并且在 https://developer.paypal.com/developer/applications/

I already have running this plugin on android and it is working perfect, and also have the clientid generated on https://developer.paypal.com/developer/applications/

doPayment() {
  const total: any = 10;
  const currency: any = 'USD';
  const envProduct: any = '';
  const envSandbox: any = '{Client ID from                                                                  developer.paypal.com/developer/applications/}';

  this.payPal.init({
    PayPalEnvironmentProduction: envProduct,
    PayPalEnvironmentSandbox: envSandbox
  })
  .then(() => {
    // Environments: PayPalEnvironmentNoNetwork,         PayPalEnvironmentSandbox, PayPalEnvironmentProduction
    this.payPal.prepareToRender('PayPalEnvironmentSandbox', new         PayPalConfiguration({
      // Only needed if you get an "Internal Service Error" after         PayPal login!
      // payPalShippingAddressOption: 2 //         PayPalShippingAddressOptionPayPal
        })).then(() => {
          const payment = new PayPalPayment(total, currency,         'Description', 'sale');
          this.payPal.renderSinglePaymentUI(payment).then(async ( res ) =>         {
          // rest of the code after payment
          }, ( errclose ) => {
          console.log( errclose ); // Error or render dialog closed         without being successful
          });
          }, ( errconf ) => {
          console.log( errconf ); // Error in configuration
          });
        }, ( errinit ) => {
          console.log( errinit ); // Error in initialization, maybe PayPal         isn't supported or something else
      });
}

这是错误:

Payments to this merchant are not allowed (invalid clientId)

感谢您的帮助.非常感谢.

Any help is appreciated. Thank you very much.

推荐答案

当使用Ionic Capacitor而不是Cordova进行运行时,我也遇到了同样的错误,同样仅在iOS上.当我使用Cordova运行时构建应用程序时,它可以在两个平台上正常工作.另外,在指定"PayPalEnvironmentSandbox"环境名称时使用相同的错误,但使用生产clientId则相反.

I get the same error, also on iOS only, when used Ionic Capacitor for runtime instead of Cordova. When I built the app using Cordova runtime it worked correctly on both platforms. Also, you could get the same error when specifying the 'PayPalEnvironmentSandbox' environment name but use production clientId and vice versa.

这篇关于不允许付款给该商家(无效的clientId)-Ionic iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆