Paypal按钮问题
我在沙箱环境中测试了 PayPal 按钮并且它有效。现在我试图让它在实时环境中工作,但按钮仍然处于禁用状态。
我的代码是,
[PayPal initializeWithAppID:@"APP-80W284485P519543T" forEnvironment:ENV_LIVE];
UIButton *button = [[PayPal getInstance] getPayButton:self buttonType:BUTTON_278x43 startCheckOut:@selector(payWithPayPal) PaymentType:DONATION withLeft:20 withTop:240];
[self.view addSubview:button];
如果我将环境 ENV_LIVE 更改为 ENV_SANDBOX,则按钮将启用
I have a PayPal Button tested in sandbox environment and it worked. Now i am trying to get it working in the live environment the button remains disable.
My code is
[PayPal initializeWithAppID:@"APP-80W284485P519543T" forEnvironment:ENV_LIVE];
UIButton *button = [[PayPal getInstance] getPayButton:self buttonType:BUTTON_278x43 startCheckOut:@selector(payWithPayPal) PaymentType:DONATION withLeft:20 withTop:240];
[self.view addSubview:button];
if I change Environment ENV_LIVE to ENV_SANDBOX the button is enable
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只有您的应用程序获得 PayPal 批准后才能使用实时环境。您用于初始化 PayPal 的 AppID 已进行硬编码,以便在 SANDBOX 环境中使用。对于实时应用程序,您需要使用 PayPal 分配给您的应用程序的应用程序 ID。按照本页中的步骤获取您的应用的应用 ID。
请记住,您需要经过自己的验证 PayPal Premier 或 Business 帐户,然后应用程序才能运行(即使已获得批准)。
如果您要提交移动应用程序,请执行以下额外步骤
一旦您的应用程序获得批准,您将收到一个实时应用程序 ID。只需将测试应用程序 ID 替换为实时应用程序 ID,并将您的 Sandbox API 凭据更改为实时 API 凭据即可。
The live environment can be used only after your app has been approved by PayPal. The AppID you are using to initialize PayPal is hardcoded for use in the SANDBOX env. For a live application you need to use the App ID that is assigned to your app by PayPal. Follow the steps in this page to get an App ID for your app.
Remember, you need to have your own verified PayPal Premier or Business Account before the app will work (even if it is approved).
If you are submitting a mobile app take these extra steps
Once your app is approved, you'll receive a Live App ID. Just replace the Test App ID with the Live App ID, and change your Sandbox API credentials to Live API Credentials.
您必须先将应用程序提交到 PayPal,然后才能将其转换为实时应用程序。在沙盒模式下测试您的应用程序后,他们会为您提供一个 ID。
检查此链接
https://www.x.com/community/ppx/xspaces/移动/机电
You have to submit the app to paypal before converting it to live. They will provide you one id after testing your app in sandbox mode.
Check this link
https://www.x.com/community/ppx/xspaces/mobile/mep
有时,当 PayPal 服务器关闭或服务器出现任何问题时,PayPal 对象的初始化会失败,并且在这些情况下该按钮将被禁用。
您可以使用以下代码检查初始化的状态:
来自文档:
At times, when PayPal server is down or for any problems with server, the initialization of the PayPal object fails, and the button would be disabled in these cases.
You can check for the status of the initialization using the following code:
From the documentation: