【问题标题】:Cordova PayPal Plugin integration iOS issueCordova PayPal 插件集成 iOS 问题
【发布时间】:2019-02-07 22:39:07
【问题描述】:

我有一个带有 com.paypal.cordova.mobilesdk v3.5.0 的移动应用

在 iOS 中创建付款时出现以下错误。

另请注意,应用程序在不处于调试模式时会崩溃并立即关闭。

2018-09-02 20:48:29.853486+0200 MyHurryApp[631:122102] -[NSNull length]: unrecognized selector sent to instance 0x1b69ef878 2018-09-02 20:48:29.856680+0200 MyHurryApp[631:122102] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x1b69ef878' *** First throw call stack: (0x1843bad8c 0x1835745ec 0x1843c8098 0x1843c05c8 0x1842a641c 0x102ad75e8 0x1028c1c20 0x1033211dc 0x10332119c 0x103325d2c 0x184363070 0x184360bc8 0x184280da8 0x186266020 0x18e2a0758 0x1028beb90 0x183d11fc0) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

导致此崩溃的行似乎是: [PayPalMobile preconnectWithEnvironment:environmentToUse];

``` - (void)prepareToRender:(CDVInvokedUrlCommand *)command { [self.commandDelegate runInBackground:^{ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; NSString *environment = [command.arguments objectAtIndex:0];

NSString *environmentToUse = [self parseEnvironment:environment];
if (environmentToUse) {
  // save configuration
  PayPalConfiguration *configuration = [self getPayPalConfigurationFromDictionary:[command.arguments objectAtIndex:1]];
  self.configuration = configuration;
  // do preconnect
  dispatch_async(dispatch_get_main_queue(), ^{
    [PayPalMobile preconnectWithEnvironment:environmentToUse];
  });
} else {
  pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"The provided environment is not supported"];
}

[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];

}]; } ```

在其他论坛中,我看到建议您应该将付款金额转换为字符串,但我这样做了,但问题仍然存在。 Click here for example

还有其他建议吗?

【问题讨论】:

    标签: javascript cordova paypal


    【解决方案1】:

    引用自plugins readme

    重要提示:PayPal 移动 SDK 现已弃用,仅支持现有集成。对于所有新集成,请在受支持的国家/地区使用 Braintree Direct。在其他国家/地区,请使用 Express Checkout 并选择 Braintree SDK 集成选项。

    paypal developer page 也会显示相同的警告。

    所以我猜你的应用程序崩溃了:

    [PayPalMobile preconnectWithEnvironment:environmentToUse];
    

    位置,因为您正在尝试连接一个不再受支持的新环境。

    现在大多数应用都使用应用内浏览器来实现 PayPal 结账。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-27
      • 2014-09-22
      • 2016-04-17
      • 2012-04-08
      • 2015-07-17
      • 1970-01-01
      • 2013-02-06
      相关资源
      最近更新 更多