更新:hideCreditCardButton
在这个问题上没有作用,这只是一个巧合,当我尝试它没有信用卡它为我工作,但那不是这种情况了。工作但只有20-30%的时间。无法与贝宝服务器通信
我使用贝宝的iOS SDK 1.4.6。如果我使用paymentViewController.hideCreditCardButton = YES;
它工作正常,但如果我将此设置为paymentViewController.hideCreditCardButton = NO;
我得到服务器错误(参考图像)。
这里是我的代码:
- (void)paypalPayment {
// Create a PayPalPayment
float paypalPrice =[youPay floatValue];
NSString* currencyCode = appDelegate.countryCurrency;
if ([currencyCode isEqual: @"INR"]) {
float new = [[[ExchangeRate sharedManager]getExchangeRate:@"INR" toCurrency:@"USD"]
floatValue];
paypalPrice = paypalPrice*new;
}
PayPalPayment *payment = [[PayPalPayment alloc] init];
payment.amount = [[NSDecimalNumber alloc] initWithString:
[NSString stringWithFormat:@"%.2f",paypalPrice]];
payment.currencyCode = @"USD";
payment.shortDescription = @"Total Order";
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentProduction];
// Provide a payerId that uniquely identifies a user within the scope of your system,
// such as an email address or user ID.
NSString *aPayerId = @"[email protected]";
PayPalPaymentViewController *paymentViewController;
paymentViewController = [[PayPalPaymentViewController alloc]
initWithClientId:kPayPalClientId
receiverEmail:kPayPalReceiverEmail
payerId:aPayerId
payment:payment
delegate:self];
paymentViewController.languageOrLocale = @"en";
paymentViewController.hideCreditCardButton = NO;
[self presentViewController:paymentViewController animated:YES completion:nil];
}
喜戴夫,感谢回答。你是对的'hideCreditCardButton'没有影响它,也许还有别的东西,这只是一个巧合,当我尝试它没有信用卡它为我工作,但那不是这样的情况了。它在10次中运行3-4次。 –
我正在使用指定用于生产的客户端ID,并且在控制台中看不到任何内容。 P.S:我住在印度,这是否需要做任何事情? –
这可能是因为存在一些连接问题(可能是印度的PayPal服务器与另一个PayPal服务器之间的连接问题),或者是与您正在进行交互的服务器隔离的其他问题。您可能需要联系PayPal开发人员支持部门进行跟踪。 –