PayPal API - 验证帐户是否有效/存在/已验证

时间:2013-12-13 15:52:28

标签: paypal paypal-adaptive-payments

是否有人只能通过电子邮件地址验证PayPal帐户的有效性?

AdaptiveAccounts GetVerifiedStatus(以PayPal自己的话说)仅供其主要战略客户使用(见下文),我找不到任何其他方式来检查基于电子邮件地址帐户是否存在并经过验证。

即使使用提供的所有字段进行有效的NAME搜索也不起作用,请亲自尝试:

https://devtools-paypal.com/apiexplorer/AdaptiveAccounts

我一直在使用他们的自适应支付很长一段时间,并且我常常惊讶于有多少卖家设法错误地将他们的PayPal帐户输入我们的网站。

PayPal似乎很乐意提供服务来接受我们的付款和佣金,但不愿意提供核心和非常基本的功能,以便在处理之前验证接收器。

PayPal支持回复我的查询:

  

我们查看PayPal帐户是否已验证的唯一API是GetVerifiedStatus API。支持matchCriteria的NONE值,但仅适用于非常大的战略合作伙伴和/或实际金融机构。我们的App Review团队对提供对该值的访问有严格的要求。很遗憾,我们目前没有任何API只会告诉您电子邮件地址是否已在帐户中确认。

     

感谢您的耐心等待。

希望有其他人能够设法解决这个问题吗?

4 个答案:

答案 0 :(得分:1)

<?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 = "sunil@rudrainnovatives.com"; //The email address you wana verify

//parameters of requests
$nvpStr = 'emailAddress='.$emailAddress.'&matchCriteria=NONE';

// RequestEnvelope fields
$detailLevel    = urlencode("ReturnAll");
$errorLanguage  = urlencode("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);

echo $data = json_decode($paypalResponse);



?>

答案 1 :(得分:0)

作为一次性,您可以使用&#34;忘记密码?&#34;输入电子邮件的选项,如果没有该电子邮件的帐户,您将收到通知。

表单包含CAPTCHA,因此如果您正在寻找编码解决方案,可能没什么用。

答案 2 :(得分:0)

您可以向Pay API发出请求,尝试使用要作为辅助接收方进行测试的电子邮件设置链式付款。由于链式付款不接受付款给没有帐户的收款人,当输入的电子邮件与PayPal帐户不对应时,API会返回错误(否则它将返回一个付款密钥,您将会收到付款只是扔掉。)

答案 3 :(得分:-3)

Finde VerifiedStatus On Paypal:(Exists an account on payapal)
          GetVerifiedStatusRequest getVerifiedStatusRequest = new GetVerifiedStatusRequest
        {
            emailAddress = email,
            matchCriteria = "NONE"
        };
          AdaptiveAccountsService service = new              AdaptiveAccountsService(Configuration.GetAcctAndConfig());
        GetVerifiedStatusResponse response =  service.GetVerifiedStatus(getVerifiedStatusRequest);
        return response.accountStatus.ToString();