Technology_Live
Technology_Live

Reputation: 111

integration paypal with ios

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.

Upvotes: 7

Views: 10620

Answers (4)

Brent
Brent

Reputation: 1149

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.

Upvotes: 6

Pramod Tapaniya
Pramod Tapaniya

Reputation: 1266

In PaymentMethodViewController

  1. Replace PayPalEnvironmentSandbox with PayPalEnviromentProduction of kPayPalEnvironment global variable.
  2. Set live credentials of paypal account.

Upvotes: 1

user2645897
user2645897

Reputation:

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

Upvotes: 1

Tim
Tim

Reputation: 6712

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

Upvotes: 9

Related Questions