简体   繁体   English

与ios集成paypal

[英]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. 我正在开发一个应用程序,我需要将付款与PayPal集成,我已经下载了PayPal iOS SDK ,一切都与沙箱完美配合,但现在我不知道如何切换生产模式。 any help would be apprediated. 任何帮助都会得到认可。

The PayPal SDK is fine if you go for physical goods. 如果您购买实体商品,PayPal SDK就可以了。 Regarding your question: to switch to live you just need to remove this line 关于你的问题:切换到现场你只需要删除这一行

[PayPalPaymentViewController setEnvironment:PayPalEnvironmentNoNetwork];

The sample code you are probably following in the iOS integration docs sets the environment to PayPalEnvironmentNoNetwork : 您可能在iOS集成文档中遵循的示例代码将环境设置为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 . 您可以删除该行以PayPalEnvironmentProduction ,因为默认值为PayPalEnvironmentProduction

However, you probably want to test your integration before going live by changing the environment to PayPalEnvironmentSandbox : 但是,您可能希望在上线之前通过将环境更改为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 . 另请参阅有关环境的PayPalPaymentViewController.h文档

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

In PaymentMethodViewController PaymentMethodViewController

  1. Replace PayPalEnvironmentSandbox with PayPalEnviromentProduction of kPayPalEnvironment global variable. PayPalEnviromentProduction更换PayPalEnvironmentSandbox kPayPalEnvironment全局变量。
  2. Set live credentials of paypal account. 设置paypal帐户的实时凭证

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM