gpt4 book ai didi

ios - 无法与 PayPal 服务器通信

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:36:41 24 4
gpt4 key购买 nike

更新 hideCreditCardButton 在这个问题上没有任何作用,这只是一个巧合,当我在没有信用卡的情况下尝试它时它对我有用,但那不是情况不再如此。我确实在工作,但只有 20-30% 的时间。

我使用的是 PayPal iOS SDK 1.4.6。如果我使用 paymentViewController.hideCreditCardButton = YES; 它工作正常,但如果我将其设置为 paymentViewController.hideCreditCardButton = NO; 我会收到服务器错误(引用图片)。

enter image description here

这是我的代码:

- (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 = @"abc@msronline.in";

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];
}

最佳答案

来自 PayPal 的 Dave。

这确实很奇怪。你一展示 View Controller 就得到这个?今天还在发生吗?

从您的屏幕截图来看,SDK 似乎仍在尝试与 PayPal 服务器建立初始连接。在这个早期阶段,hideCreditCardButton 的设置应该不会影响任何东西。

您使用的是指定用于生产的客户端 ID(与指定用于沙盒的客户端 ID 相对),对吗?

您在控制台日志中看到任何有用的信息吗?

关于ios - 无法与 PayPal 服务器通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21674663/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com