1
當我選擇沙箱環境時,我收到一條警告消息:「很抱歉,與PayPal服務器通信時出現問題。」我的代碼和屏幕截圖如下。新的PayPal iOS SDK(1.0.5) - 無法連接到沙箱
- (IBAction)pay {
// Remove our last completed payment, just for demo purposes.
self.completedPayment = nil;
PayPalPayment *payment = [[PayPalPayment alloc] init];
payment.amount = [[NSDecimalNumber alloc] initWithString:@"9.95"];
payment.currencyCode = @"USD";
payment.shortDescription = @"Hipster t-shirt";
if (!payment.processable) {
// This particular payment will always be processable. If, for
// example, the amount was negative or the shortDescription was
// empty, this payment wouldn't be processable, and you'd want
// to handle that here.
}
// Any customer identifier that you have will work here. Do NOT use a device- or
// hardware-based identifier.
NSString *customerId = @"user-11723";
// Set the environment:
// - For live charges, use PayPalEnvironmentProduction (default).
// - To use the PayPal sandbox, use PayPalEnvironmentSandbox.
// - For testing, use PayPalEnvironmentNoNetwork.
[PayPalPaymentViewController setEnvironment:self.environment];
PayPalPaymentViewController *paymentViewController = [[PayPalPaymentViewController alloc] initWithClientId:kPayPalClientId receiverEmail:kPayPalReceiverEmail
payerId:customerId
payment:payment
delegate:self];
paymentViewController.hideCreditCardButton = !self.acceptCreditCards;
[self presentViewController:paymentViewController animated:YES completion:nil];
}
@chetu,對不起,我在看到你的響應延遲。 (但是你不想通過編輯我的答案來回應,你想創建一個新的評論。)在過去的幾周內,Sandbox服務器顯然存在一些短暫的故障。你現在還在遇到這個問題嗎? –
只是想回復這個問題,因爲我遇到了同樣的問題,而且我正在運行最新版本的SDK。我以前能夠在沙箱模式下成功工作,但由於某種原因,它今天無法工作。此外,似乎生產模式正常工作。這是我嘗試在沙盒模式下運行時得到的錯誤消息。 請求失敗,出現錯誤:「ppapi_error_code_10870 - 請到App Store安裝最新版本的PayPal應用程序 PayPal debugId:eb36bfda1941c」 –