Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PayPal API - Verify that an account is valid / exists / verified

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

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.

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

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

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.

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 Support response to my query to them:

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.

Thank you for your patience.

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

like image 791
Jordan Avatar asked Dec 13 '13 15:12

Jordan


People also ask

Why does it say my PayPal account isn't verified?

To verify your PayPal account you must log in, and confirm that your account status is 'Verified'. PayPal follows a specific process to verify accounts by asking for documentation such as bank accounts, or credit card statements. If your account is not verified, you will see it as an "Unverified" status.

How can I check if a PayPal email is valid?

A genuine email from PayPal would also address you by name and not start with 'Dear Customer'. Logging into your account direct and not clicking on any link in the email is the safest way to check what is going on (if anything). Don't reply or open any attachments, and if in doubt contact PayPal to be 100% sure.

How do I make my PayPal account fully verified?

You can verify your PayPal account by linking a bank account, credit card, or debit card. Once your verify your PayPal, there will no longer be a withdrawal limit for your account; unverified accounts having a monthly withdrawal limit of $500.


3 Answers

<?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]"; //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);



?>
like image 103
Sunil Sharma Avatar answered Sep 28 '22 06:09

Sunil Sharma


As a one off, you can use the "forgot password?" option to enter an email and you will be informed if an account with that email does not exist.

The form includes a CAPTCHA so is probably not much use if you are looking for a coding solution.

like image 29
Neil Robertson Avatar answered Sep 28 '22 07:09

Neil Robertson


You can issue a request to the Pay API trying to set up a chained payment with the email to be tested as a secondary receiver. Since chained payments don't accept payments to receivers that do not have an account, the API will return an error when the input email does not correspond to a PayPal account (otherwise it will return a paykey, that you'll just throw away).

like image 40
splinter123 Avatar answered Sep 28 '22 08:09

splinter123