与iOS中的PayPal服务器通信时出现问题

时间:2017-01-12 09:07:08

标签: ios objective-c paypal paypal-sandbox

我正在使用Paypal SandBox Environment。当我从设备打开Paypal时,我收到此错误:

  

请求失败并出现错误:pp_service_error_json_parse_error - 系统错误。请稍后再试。 (403)|细节: (           {           " ns_error" ="错误域= NSCocoaErrorDomain代码= 3840 \" JSON文本不以数组或对象和选项开头,以允许未设置片段。\" UserInfo = {NSDebugDescription = JSON文本不以数组或对象开头,并且选项允许未设置片段。}&#34 ;;       }   )。

检查截图

enter image description here

这是我的代码

        _payPalConfig = [[PayPalConfiguration alloc] init];

    _payPalConfig.acceptCreditCards = YES;
#else
    _payPalConfig.acceptCreditCards = NO;
#endif
    _payPalConfig.merchantName = @"";
    _payPalConfig.merchantPrivacyPolicyURL = [NSURL URLWithString:@""];
    _payPalConfig.merchantUserAgreementURL = [NSURL URLWithString:@""];
    _payPalConfig.languageOrLocale = [NSLocale preferredLanguages][0];
    _payPalConfig.payPalShippingAddressOption = PayPalShippingAddressOptionPayPal;
    self.environment = PayPalEnvironmentSandbox;
    nslog(@"PayPal iOS SDK version: %@", [PayPalMobile libraryVersion]);





    - (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:YES];
    // Preconnect to PayPal early

    [self setPayPalEnvironment:self.environment];
}



    - (void)setPayPalEnvironment:(NSString *)environment
    {
    self.environment = environment;

    [PayPalMobile initializeWithClientIdsForEnvironments:@{PayPalEnvironmentSandbox:PAYPAL_CLIENT_KEY}];
    [PayPalMobile preconnectWithEnvironment:environment];
}

我不知道为什么我会收到错误。 有人有解决方案吗?

0 个答案:

没有答案