Note that there are some explanatory texts on larger screens.

plurals
  1. PONew PayPal iOS SDK(1.0.5) - Can't connect to sandbox
    text
    copied!<p>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. </p> <pre><code>- (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]; } </code></pre> <p><img src="https://i.stack.imgur.com/zUgFl.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload