7

I am developing an application where I need to integrate payments with PayPal, I have downloaded the PayPal iOS SDK, everything works perfectly with the sandbox but now I do not know how to switch the mode for production. any help would be apprediated.

Adam Heath
  • 4,703
  • 2
  • 35
  • 50
Technology_Live
  • 121
  • 1
  • 2
  • 4
  • Apple refuses any in-app payment methods besides their own. Don't even try. – Linuxios Mar 09 '13 at 15:46
  • It depends what the payments are for: http://stackoverflow.com/a/6481793/620197 – Mike D Mar 09 '13 at 15:53
  • The list of live end points can be found here: https://www.x.com/developers/paypal/documentation-tools/api-endpoints, and the full guide to go live: https://www.x.com/developers/paypal/documentation-tools/going-live-with-your-application – Mike D Mar 09 '13 at 16:00
  • 2
    @Linuxios That's not the case, seeing at how Apple prohibits you from using IAP from *physical goods*. Lots of apps use alternative payment methods for things where IAP is not allowed. – lxt Mar 09 '13 at 21:37

4 Answers4

9

The PayPal SDK is fine if you go for physical goods. Regarding your question: to switch to live you just need to remove this line

[PayPalPaymentViewController setEnvironment:PayPalEnvironmentNoNetwork];
Tim
  • 6,692
  • 2
  • 25
  • 30
6

The sample code you are probably following in the iOS integration docs sets the environment to PayPalEnvironmentNoNetwork:

// Start out working with the test environment! 
// When you are ready, remove this line to switch to live.
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentNoNetwork];

You could just remove that line to go live, since the default is PayPalEnvironmentProduction.

However, you probably want to test your integration before going live by changing the environment to PayPalEnvironmentSandbox:

[PayPalPaymentViewController setEnvironment:PayPalEnvironmentSandbox];

You can create sandbox accounts over here.

When switching to production, rather than deleting the line, it is safer and clearer to be explicit:

[PayPalPaymentViewController setEnvironment:PayPalEnvironmentProduction];

See also PayPalPaymentViewController.h documentation on environments.

Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
Brent
  • 1,149
  • 8
  • 11
1
//for testing    
[PayPalPaymentViewController setEnvironment:self.environment]; 

//for Paypal live app than it set  in our app code  
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentProduction];   

//check in Paypal sandbox account
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentSandbox]; 
Gajendra K Chauhan
  • 3,387
  • 7
  • 40
  • 55
1

In PaymentMethodViewController

  1. Replace PayPalEnvironmentSandbox with PayPalEnviromentProduction of kPayPalEnvironment global variable.
  2. Set live credentials of paypal account.
Rahul Mane
  • 1,005
  • 18
  • 33
Pramod Tapaniya
  • 1,228
  • 11
  • 30