0

When I select a sandbox environment, I get an alert message saying "We're Sorry, there was a problem communicating with PayPal's servers." My code and a screenshot are given below.

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

   }

enter image description here

Cole Tobin
  • 9,206
  • 15
  • 49
  • 74
Chetu
  • 428
  • 1
  • 7
  • 19

1 Answers1

2

@chetu, please visit https://github.com/paypal/PayPal-iOS-SDK and download version 1.1.0 of the PayPal iOS SDK. (Be sure to read the release_notes.md file regarding a project change you might need to make to your Linker Flags.)

With the newer version of the SDK installed, please run the above code again. Now check the console log -- there should be some additional details there regarding the specific error returned from the server.

If you could copy and paste those details here, we should be able to pin down the source of your difficulty.

Dave Goldman
card.io / PayPal / eBay

Dave Goldman
  • 2,229
  • 1
  • 11
  • 13
  • 1
    @chetu, sorry for my delay in seeing your response. (But you don't want to respond by editing my answer. You want to create a new comment.) There have apparently been some transient failures of the Sandbox server over the past few weeks. Are you still running into this problem now? – Dave Goldman Aug 26 '13 at 17:17
  • Just wanted to reply to this because I'm having the same issue and I'm running the latest version of the SDK. I've been able to get it to successfully work in sandbox mode before, but for some reason it won't work today. Also it seems as though production mode works fine. This is the error message I get when I try to run in sandbox mode. Request failed with error:"ppapi_error_code_10870 - Please go to the App Store to install the latest version of the PayPal app. PayPal debugId: eb36bfda1941c" – James Parker Aug 26 '13 at 18:42