如何验证PayPal账户?

发布于 2024-09-09 02:15:23 字数 133 浏览 0 评论 0原文

我想将 paypal 集成到我的网站并要求用户输入 paypal 帐户以支付佣金。 我如何检查他们的帐户是否存在于 paypal 上? 我不想向他们发送 0.01 美元,还是这是查看帐户的唯一方式?

当用户注册网站时,它应该自动验证它。

I want to integrate paypal to my website and ask users to enter paypal account for commission pay out.
How can I check if their account exists on paypal?
I prefer NOT to send them $0.01 or it's the only way to check account?

It should validate it automatically while user sign ups to the website.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

风为裳 2024-09-16 02:15:23

GetVerifiedStatus 应该可以解决问题。您必须传递电子邮件地址和该人的姓名,然后它将返回其帐户是否已通过验证。

如果他们没有 PayPal 帐户,您将收到一条错误消息,显示“无法确定 PayPal 帐户状态”。

这是我刚刚在经过验证的 PayPal 帐户的沙箱上运行的请求和响应的示例...

<?xml version="1.0" encoding="utf-8"?>
<GetVerifiedStatusRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <emailAddress xmlns="">[email protected]</emailAddress>
  <matchCriteria xmlns="">NAME</matchCriteria>
  <firstName xmlns="">Drew</firstName>
  <lastName xmlns="">Angell</lastName>
</GetVerifiedStatusRequest>

<?xml version='1.0' encoding='UTF-8'?>
<ns2:GetVerifiedStatusResponse xmlns:ns2="http://svcs.paypal.com/types/aa">
  <responseEnvelope>
    <timestamp>2013-01-05T00:07:01.729-08:00</timestamp>
    <ack>Success</ack>
    <correlationId>3fecb3e1f2011</correlationId>
    <build>4055066</build>
  </responseEnvelope>
  <accountStatus>VERIFIED</accountStatus>
  <userInfo>
    <emailAddress>[email protected]</emailAddress>
    <accountType>BUSINESS</accountType>
    <accountId>E7BTGVXBFSUAU</accountId>
    <name>
      <salutation></salutation>
      <firstName>Drew</firstName>
      <middleName></middleName>
      <lastName>Angell</lastName>
      <suffix></suffix>
    </name>
    <businessName>Drew Angell's Test Store</businessName>
  </userInfo>
</ns2:GetVerifiedStatusResponse>

这是 PayPal 帐户不存在的请求和响应的示例...

<?xml version="1.0" encoding="utf-8"?>
<GetVerifiedStatusRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <emailAddress xmlns="">[email protected]</emailAddress>
  <matchCriteria xmlns="">NAME</matchCriteria>
  <firstName xmlns="">Drew</firstName>
  <lastName xmlns="">Angell</lastName>
</GetVerifiedStatusRequest>

<?xml version='1.0' encoding='UTF-8'?>
<ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/aa">
  <responseEnvelope>
    <timestamp>2013-01-05T00:08:28.581-08:00</timestamp>
    <ack>Failure</ack>
    <correlationId>43364ce704211</correlationId>
    <build>4055066</build>
  </responseEnvelope>
  <error>
    <errorId>580023</errorId>
    <domain>PLATFORM</domain>
    <subdomain>Application</subdomain>
    <severity>Error</severity>
    <category>Application</category>
    <message>Cannot determine PayPal Account status</message>
  </error>
</ns3:FaultMessage>

GetVerifiedStatus should do the trick. You'll have to pass the email address and the name of the person and it will then return whether or not their account has been verified.

If they don't have a PayPal account you'll get an error back that says "Cannot determine PayPal Account status."

Here's a sample of the request and response I just ran on the sandbox for a verified PayPal account...

<?xml version="1.0" encoding="utf-8"?>
<GetVerifiedStatusRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <emailAddress xmlns="">[email protected]</emailAddress>
  <matchCriteria xmlns="">NAME</matchCriteria>
  <firstName xmlns="">Drew</firstName>
  <lastName xmlns="">Angell</lastName>
</GetVerifiedStatusRequest>

<?xml version='1.0' encoding='UTF-8'?>
<ns2:GetVerifiedStatusResponse xmlns:ns2="http://svcs.paypal.com/types/aa">
  <responseEnvelope>
    <timestamp>2013-01-05T00:07:01.729-08:00</timestamp>
    <ack>Success</ack>
    <correlationId>3fecb3e1f2011</correlationId>
    <build>4055066</build>
  </responseEnvelope>
  <accountStatus>VERIFIED</accountStatus>
  <userInfo>
    <emailAddress>[email protected]</emailAddress>
    <accountType>BUSINESS</accountType>
    <accountId>E7BTGVXBFSUAU</accountId>
    <name>
      <salutation></salutation>
      <firstName>Drew</firstName>
      <middleName></middleName>
      <lastName>Angell</lastName>
      <suffix></suffix>
    </name>
    <businessName>Drew Angell's Test Store</businessName>
  </userInfo>
</ns2:GetVerifiedStatusResponse>

And here's a sample of a request and response where the PayPal account doesn't exist...

<?xml version="1.0" encoding="utf-8"?>
<GetVerifiedStatusRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <emailAddress xmlns="">[email protected]</emailAddress>
  <matchCriteria xmlns="">NAME</matchCriteria>
  <firstName xmlns="">Drew</firstName>
  <lastName xmlns="">Angell</lastName>
</GetVerifiedStatusRequest>

<?xml version='1.0' encoding='UTF-8'?>
<ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/aa">
  <responseEnvelope>
    <timestamp>2013-01-05T00:08:28.581-08:00</timestamp>
    <ack>Failure</ack>
    <correlationId>43364ce704211</correlationId>
    <build>4055066</build>
  </responseEnvelope>
  <error>
    <errorId>580023</errorId>
    <domain>PLATFORM</domain>
    <subdomain>Application</subdomain>
    <severity>Error</severity>
    <category>Application</category>
    <message>Cannot determine PayPal Account status</message>
  </error>
</ns3:FaultMessage>
另类 2024-09-16 02:15:23

您可以要求他们输入他们在 PayPal 中使用的电子邮件地址。如果他们没有 PayPal 帐户,您仍然可以将资金发送到他们输入的任何电子邮件中。 Paypal 将负责让他们使用该电子邮件 ID 创建一个 Paypal 帐户并向他们展示资金。

您可能需要确保他们输入正确的电子邮件 ID。也许电子邮件地址验证步骤可以解决问题。

you can ask them to enter the email address they use in paypal. and if they dont have an account on paypal, you can still send them funds to any email they enter. Paypal will take care of getting them to create an paypal account with that email id and show them their funds.

all you may have to ensure is that they enter the correct email id.. maybe an email address verification step could do the trick.

烟雨扶苏 2024-09-16 02:15:23

使用Java(我们可以做一些类似使用adaptiveaccountssdk的事情

<dependency>
    <groupId>com.paypal.sdk</groupId>
    <artifactId>adaptiveaccountssdk</artifactId>
    <version>LATEST</version>
</dependency>

......

Map<String, String> sdkConfig = new HashMap<>();
sdkConfig.put("mode", "sandbox/live");
sdkConfig.put("acct1.UserName", "");
sdkConfig.put("acct1.Password", ""));
sdkConfig.put("acct1.Signature", ""));
sdkConfig.put("acct1.AppId", ""));

GetVerifiedStatusRequest request = new GetVerifiedStatusRequest();
AccountIdentifierType accountIdentifierType = new AccountIdentifierType();
accountIdentifierType.setEmailAddress(accountEmail);
request.setAccountIdentifier(accountIdentifierType);
request.setMatchCriteria("NONE");
AdaptiveAccountsService aas = new AdaptiveAccountsService(sdkConfig);
GetVerifiedStatusResponse response = aas.getVerifiedStatus(request);
String status = response.getAccountStatus();

With Java (we can do something like using adaptiveaccountssdk)

<dependency>
    <groupId>com.paypal.sdk</groupId>
    <artifactId>adaptiveaccountssdk</artifactId>
    <version>LATEST</version>
</dependency>

...

Map<String, String> sdkConfig = new HashMap<>();
sdkConfig.put("mode", "sandbox/live");
sdkConfig.put("acct1.UserName", "");
sdkConfig.put("acct1.Password", ""));
sdkConfig.put("acct1.Signature", ""));
sdkConfig.put("acct1.AppId", ""));

GetVerifiedStatusRequest request = new GetVerifiedStatusRequest();
AccountIdentifierType accountIdentifierType = new AccountIdentifierType();
accountIdentifierType.setEmailAddress(accountEmail);
request.setAccountIdentifier(accountIdentifierType);
request.setMatchCriteria("NONE");
AdaptiveAccountsService aas = new AdaptiveAccountsService(sdkConfig);
GetVerifiedStatusResponse response = aas.getVerifiedStatus(request);
String status = response.getAccountStatus();

.....

绾颜 2024-09-16 02:15:23

我在 PHP 中通过 API 调用为 GetVerifiedStatus 方法实现了以下脚本,它对我来说工作得很好。该脚本适用于沙箱,因此如果您想测试它,请使用沙箱 PayPal 帐户进行测试。如果您想将其用于生产模式,请删除沙箱行(我在注释提示中显示了它们)。我在 PHP 注释中解释了运行此代码需要从 PayPal 获取的信息。

<?php
// create a new cURL resource
$ch = curl_init();

$ppUserID = "******************"; //Take it from   sandbox dashboard for test mode or take it from paypal.com account in production mode, help: https://developer.paypal.com/docs/classic/api/apiCredentials/
$ppPass = "*************"; //Take it from sandbox dashboard for test mode or take it from paypal.com account in production mode, help: https://developer.paypal.com/docs/classic/api/apiCredentials/
$ppSign = "********************"; //Take it from sandbox dashboard for test mode or take it from paypal.com account in production mode, help: https://developer.paypal.com/docs/classic/api/apiCredentials/
$ppAppID = "***********"; //if it is sandbox then app id is always: APP-80W284485P519543T
$sandboxEmail = "********************"; //comment this line if you want to use it in production mode.It is just for sandbox mode

$emailAddress = "******************"; //The email address you wana verify
$firstName = "********"; //first name of the account holder you want to verify, sandbox personal account default first name is: test
$lastName = "*******"; //last name of the account holder you want to verify, sandbox personal account default last name is: buyer

//parameters of requests
$nvpStr = 'emailAddress='.$emailAddress.'&firstName='.$firstName.'&lastName='.$lastName.'&matchCriteria=NAME';

// RequestEnvelope fields
$detailLevel    = urlencode("ReturnAll");   // See DetailLevelCode in the WSDL for valid enumerations
$errorLanguage  = urlencode("en_US");       // This should be the standard RFC 3066 language identification tag, e.g., en_US
$nvpreq = "requestEnvelope.errorLanguage=$errorLanguage&requestEnvelope.detailLevel=$detailLevel";
$nvpreq .= "&$nvpStr";
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);

$headerArray = array(
"X-PAYPAL-SECURITY-USERID:$ppUserID",
"X-PAYPAL-SECURITY-PASSWORD:$ppPass",
"X-PAYPAL-SECURITY-SIGNATURE:$ppSign",
"X-PAYPAL-REQUEST-DATA-FORMAT:NV",
"X-PAYPAL-RESPONSE-DATA-FORMAT:JSON",
"X-PAYPAL-APPLICATION-ID:$ppAppID",
"X-PAYPAL-SANDBOX-EMAIL-ADDRESS:$sandboxEmail" //comment this line in production mode. IT IS JUST FOR SANDBOX TEST 
);

$url="https://svcs.sandbox.paypal.com/AdaptiveAccounts/GetVerifiedStatus";
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerArray);
$paypalResponse = curl_exec($ch);
//echo $paypalResponse;   //if you want to see whole PayPal response then uncomment it.
curl_close($ch);

$data = json_decode($paypalResponse);

if($data->responseEnvelope->ack == "Success"){
$output = array('status' => true); //means user is verified successfully
} else {
$output = array('status' => false); //means verification was unsuccessful
}

echo $output;

?>

I implemented following script in PHP for GetVerifiedStatus method with API call and it is working fine for me. This script is for sandbox so if you want to test it, please test it with sandbox PayPal accounts. If you want to use it for production mode, then delete the lines for sandbox (I showed them in the comment hints) . I explained about the things you need to get from paypal to run this code inside the PHP comments.

<?php
// create a new cURL resource
$ch = curl_init();

$ppUserID = "******************"; //Take it from   sandbox dashboard for test mode or take it from paypal.com account in production mode, help: https://developer.paypal.com/docs/classic/api/apiCredentials/
$ppPass = "*************"; //Take it from sandbox dashboard for test mode or take it from paypal.com account in production mode, help: https://developer.paypal.com/docs/classic/api/apiCredentials/
$ppSign = "********************"; //Take it from sandbox dashboard for test mode or take it from paypal.com account in production mode, help: https://developer.paypal.com/docs/classic/api/apiCredentials/
$ppAppID = "***********"; //if it is sandbox then app id is always: APP-80W284485P519543T
$sandboxEmail = "********************"; //comment this line if you want to use it in production mode.It is just for sandbox mode

$emailAddress = "******************"; //The email address you wana verify
$firstName = "********"; //first name of the account holder you want to verify, sandbox personal account default first name is: test
$lastName = "*******"; //last name of the account holder you want to verify, sandbox personal account default last name is: buyer

//parameters of requests
$nvpStr = 'emailAddress='.$emailAddress.'&firstName='.$firstName.'&lastName='.$lastName.'&matchCriteria=NAME';

// RequestEnvelope fields
$detailLevel    = urlencode("ReturnAll");   // See DetailLevelCode in the WSDL for valid enumerations
$errorLanguage  = urlencode("en_US");       // This should be the standard RFC 3066 language identification tag, e.g., en_US
$nvpreq = "requestEnvelope.errorLanguage=$errorLanguage&requestEnvelope.detailLevel=$detailLevel";
$nvpreq .= "&$nvpStr";
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);

$headerArray = array(
"X-PAYPAL-SECURITY-USERID:$ppUserID",
"X-PAYPAL-SECURITY-PASSWORD:$ppPass",
"X-PAYPAL-SECURITY-SIGNATURE:$ppSign",
"X-PAYPAL-REQUEST-DATA-FORMAT:NV",
"X-PAYPAL-RESPONSE-DATA-FORMAT:JSON",
"X-PAYPAL-APPLICATION-ID:$ppAppID",
"X-PAYPAL-SANDBOX-EMAIL-ADDRESS:$sandboxEmail" //comment this line in production mode. IT IS JUST FOR SANDBOX TEST 
);

$url="https://svcs.sandbox.paypal.com/AdaptiveAccounts/GetVerifiedStatus";
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerArray);
$paypalResponse = curl_exec($ch);
//echo $paypalResponse;   //if you want to see whole PayPal response then uncomment it.
curl_close($ch);

$data = json_decode($paypalResponse);

if($data->responseEnvelope->ack == "Success"){
$output = array('status' => true); //means user is verified successfully
} else {
$output = array('status' => false); //means verification was unsuccessful
}

echo $output;

?>
霊感 2024-09-16 02:15:23

拥有经过验证的 PayPal 帐户意味着您已向 PayPal 提供了额外信息来证明您的身份。这使潜在客户对您的合法性更有信心,并使您有资格享受 PayPal 的卖家保护。验证您的帐户还可以消除帐户限制,并使您能够在 PayPal 帐户和其他链接的银行帐户之间转账。

Having a verified PayPal account means that you have provided PayPal additional information to prove your identify. This gives potential customers more confidence in your legitimacy, and qualifies you to be covered under PayPal's Seller Protection. Verifying your account also removes account limits and enables you to transfer money between your PayPal account and your other linked bank accounts.

用心笑 2024-09-16 02:15:23

这个 12 年前的问题的答案同样也很古老。

验证 PayPal 帐户的最佳方法是让用户使用 PayPal 登录

The answers to this 12-year-old question are likewise old.

The best way simply validate a PayPal account is to have the user Log in with PayPal

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文