title: Invalid user credentials Paypal Sandbox test account
body: <p>I am using latest <code>Paypal SDK</code> for iOS, trying to test login and payment transaction in sandbox environment. I have already created a business account in <strong>Sandbox test accounts page</strong>. So I have a user email, password and a signature. But I am unable to login using those credentials. I get following error in response:</p>
  
  <pre><code>PayPal SDK: Request has failed with error: invalid_user - Incorrect username/password. Please try again. (401) | PayPal Debug-ID: c3dd83c83d43e | Details: (
          {
          "error_description" = "Invalid user credentials";
      }
  ).
  </code></pre>
  
  <p>I am unable to understand the reason for invalid credentials.  What credentials I must use in order to login sandbox account from iOS SDK? Or am I missing something in my code?</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>- (void)viewDidLoad
  {
      //paypal setup
      // Set up payPalConfig
      _payPalConfig = [[PayPalConfiguration alloc] init];
      _payPalConfig.acceptCreditCards = YES;
      _payPalConfig.languageOrLocale = @"en";
      _payPalConfig.merchantName = @"Merchant nmae";
      _payPalConfig.merchantPrivacyPolicyURL = [NSURL URLWithString:@"https://www.paypal.com/webapps/mpp/ua/privacy-full"];
      _payPalConfig.merchantUserAgreementURL = [NSURL URLWithString:@"https://www.paypal.com/webapps/mpp/ua/useragreement-full"];
      _payPalConfig.languageOrLocale = [NSLocale preferredLanguages][0];
      self.environment = PayPalEnvironmentSandbox;
      self.payPalConfig.acceptCreditCards = NO;
  
  }
  
  - (void)viewWillAppear:(BOOL)animated {
      [super viewWillAppear:YES];
  
      // Preconnect to PayPal early
      [PayPalMobile preconnectWithEnvironment:self.environment];
  }
  
  - (IBAction)makePayment:(UIButton *)sender {
  if([self.amount.text isEqualToString:@""])
  {
      [[[UIAlertView alloc] initWithTitle:@"Message" message:@"Please enter amount to proceed" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show];
      return;
  }
  
      self.resultText = nil;
  
      PayPalPayment *payment = [[PayPalPayment alloc] init];
      payment.amount = [[NSDecimalNumber alloc] initWithString:self.amount.text];
      payment.currencyCode = @"GBP";
      payment.shortDescription = @"Payment for Web77";
  
      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.
  
          [[[UIAlertView alloc] initWithTitle:@"Message" message:@"Payment is unprocessable" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show];
          return;
      }
  
      PayPalPaymentViewController *paymentViewController = [[PayPalPaymentViewController alloc] initWithPayment:payment configuration:self.payPalConfig delegate:self];
  
      [self presentViewController:paymentViewController animated:YES completion:nil];
  
  }
  
  #pragma mark PayPalPaymentDelegate methods
  
  - (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController didCompletePayment:(PayPalPayment *)completedPayment {
      NSLog(@"PayPal Payment Success!");
      self.resultText = [completedPayment description];
  
      [[[UIAlertView alloc] initWithTitle:@"Message" message:@"Please enter amount to proceed" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show];
  
  
      [self sendCompletedPaymentToServer:completedPayment]; // Payment was processed successfully; send to server for verification and fulfillment
      [self dismissViewControllerAnimated:YES completion:nil];
  }
  
  - (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController {
      NSLog(@"PayPal Payment Canceled");
      self.resultText = nil;
      [self dismissViewControllerAnimated:YES completion:nil];
  }
  
  #pragma mark Proof of payment validation
  
  - (void)sendCompletedPaymentToServer:(PayPalPayment *)completedPayment {
      // TODO: Send completedPayment.confirmation to server
      NSLog(@"Here is your proof of payment:\n\n%@\n\nSend this to your server for confirmation and fulfillment.", completedPayment.confirmation);
  }
  </code></pre>
  
  <p><strong>Note:</strong> I have already initialized <code>PayPalMobile</code> with paypal client ID for sandbox environment.</p>
  
  <p><strong>Side Question:</strong>
  What should <code>merchantName</code> contain? Should it be same as mentioned on paypal site?</p>