简体   繁体   English

Paypal集成到Android应用程序

[英]Paypal integration to android application

I added a sample code to my application and run it. 我在我的应用程序中添加了一个示例代码并运行它。 It showed me an alert as shown below. 它向我显示了如下所示的警报。

贝宝警报消息

I searched for it fount this paypal link which says that not all android devices are supported by paypal. 我搜索了它的这个paypal链接说,并不是所有的Android设备都支持paypal。 To check if mine is supported I should download and run paypal app on my device. 要检查我是否支持我,我应该在我的设备上下载并运行paypal应用程序。

Next issue occurs when I search for paypal in play store. 当我在Play商店中搜索paypal时,会出现下一个问题。 I don't see paypal app in play store. 我没有在Play商店看到paypal应用程序。

Has anyone faced this problem? 有人遇到过这个问题吗? Any hint or suggestion? 任何提示或建议?

Note : I want to transfer money using Paypal account, not credit card. 注意:我想使用Paypal账户转账,而不是信用卡。

I had not set ClientID when starting PaymentActivity. 我在启动PaymentActivity时没有设置ClientID

intent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT,
                PaymentActivity.ENVIRONMENT_SANDBOX);

intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, PAYPAL_CLIENT_ID); // Set Client Id

startService(intent);

PayPal Here probably doesn't support the country you live in. PayPal这里可能不支持您居住的国家/地区。

My country is unsupported aswell. 我的国家也没有得到支持。

(Log In - With PayPal account) First enter here: https://developer.paypal.com/webapps/developer/applications/myapps (登录 - 使用PayPal帐户)首先进入此处: https//developer.paypal.com/webapps/developer/applications/myapps

Then: Choose "Create Application" In this step, you need to choose Mobile SDK insted of Web. 然后:选择“创建应用程序”在此步骤中,您需要选择Web的移动SDK。 Write a name of your app and the press the button 'create'. 写下您的应用程序的名称,然后按“创建”按钮。

Finish this, press in the name of your app and choose REST API CREDENTIALS 完成此操作后,按应用程序名称并选择REST API CREDENTIALS

inside ther you will see something like: "Test Credentials" and "Live Credentials" in test credentials are client_id tag, well copy that tag, something like: 在内部你会看到类似的东西: 测试凭证中的“Test Credentials”和“Live Credentials”是client_id标签,很好地复制该标签,例如:

aafsdsdssdsf3434famAp_o0Rdafadsafa334__O

then in your app have something like and paste the cliend_id here: 然后在你的应用程序中有类似的东西,并在这里粘贴cliend_id:

// set to PaymentActivity.ENVIRONMENT_LIVE to move real money.
// set to PaymentActivity.ENVIRONMENT_SANDBOX to use your test credentials from https://developer.paypal.com
// set to PaymentActivity.ENVIRONMENT_NO_NETWORK to kick the tires without communicating to PayPal's servers.
private static final String CONFIG_ENVIRONMENT = PaymentActivity.ENVIRONMENT_SANDBOX;

// note that these credentials will differ between live & sandbox environments.
***private static final String CONFIG_CLIENT_ID = "PASTE HERE";***
// when testing in sandbox, this is likely the -facilitator email address. 
private static final String CONFIG_RECEIVER_EMAIL = "matching paypal email address";

finish run your app again. 完成再次运行您的应用程序

Remember this code are inside "MainActivity.java" inside PayPalSDK 请记住,此代码位于PayPalSDK内的“MainActivity.java”中

For real live and pay: use client of Live Credentials tag 对于真实的实时和付费:使用Live Credentials标签的客户端

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

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