有人能够仅通过电子邮件地址验证 PayPal 帐户的有效性吗?
AdaptiveAccounts GetVerifiedStatus(用 PayPal 自己的话说)仅供其关键战略客户使用(见下文),我找不到任何其他方法来根据电子邮件地址检查帐户是否存在并已验证。
即使使用提供的所有字段进行有效的 NAME 搜索也不起作用,请自行尝试:
https://devtools-paypal.com/apiexplorer/AdaptiveAccounts https://devtools-paypal.com/apiexplorer/AdaptiveAccounts
我已经使用他们的自适应支付相当长一段时间了,并且经常对我们的许多卖家设法错误地将他们的 PayPal 帐户输入我们的网站感到惊讶。
PayPal 似乎很乐意提供服务来接受我们的付款和佣金,但不愿意提供核心且非常基本的功能来在处理之前验证接收者。
PayPal 支持对我向他们提出的询问的答复:
我们用于查看 PayPal 帐户是否已验证的唯一 API 是 GetVerifiedStatus API。支持 matchCriteria 的 NONE 值,但仅适用于非常大的战略合作伙伴和/或实际金融机构。我们的应用程序审核团队对于提供对该值的访问有严格的要求。遗憾的是,我们目前没有任何 API 可以简单地告诉您帐户中的电子邮件地址是否已得到确认。
感谢您的耐心等待。
希望其他人已经设法通过某种方式来执行此功能?
<?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 = "[email protected] /cdn-cgi/l/email-protection"; //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);
?>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)