PayPal API - 验证帐户是否有效/存在/已验证 [英] PayPal API - Verify that an account is valid / exists / verified

查看:25
本文介绍了PayPal API - 验证帐户是否有效/存在/已验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人能够仅通过电子邮件地址验证 PayPal 帐户的有效性?

Has anyone been able to verify the validity of a PayPal account only by the email address?

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

AdaptiveAccounts GetVerifiedStatus (in PayPal's own words) is only for use by their key strategic customers (see below), and I cannot find any other way to check based on an email address whether an account exists and is verified.

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

Even doing a valid NAME search with all fields supplied doesn't work, try it for yourself:

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

我使用他们的自适应支付已经有一段时间了,我经常惊讶于我们有多少卖家设法将他们的 PayPal 帐户错误地输入到我们的网站中.

I've been using their Adaptive Payments for quite some time and am constantly surprised at how many of our sellers manage to wrongly enter their PayPal account into our site.

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

It seems PayPal is happy to provide services to take our payments and commissions but not willing to provide a core and very basic function to be able to verify receivers before processing.

PayPal 支持对我对他们的查询的回复:

PayPal Support response to my query to them:

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

The only API we have for seeing if a PayPal account is Verified is the GetVerifiedStatus API. The value of NONE for matchCriteria is supported but only for very large strategic partners and/or actual Financial Institutions. Our App Review team has strict requirements for providing access to that value. Unfortunately we don't have any API currently that will simply tell you if the email address is confirmed on an account.

感谢您的耐心等待.

希望其他人设法通过某种方式来执行此功能??

Hopefully there some sort of hack someone else has managed to work out to perform this function??

推荐答案

<?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);



?>

这篇关于PayPal API - 验证帐户是否有效/存在/已验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆