I am validating the email address using the following code :
$url = trim("https://svcs.sandbox.paypal.com/AdaptiveAccounts/GetVerifiedStatus");
$API_UserName = "";
$API_Password = "";
$API_Signature = "";
$API_AppID = "";
$API_RequestFormat = "NV";
$API_ResponseFormat = "NV";
//Create request payload
$bodyparams = array ( "requestEnvelope.errorLanguage" => "en_US",
"emailAddress" => $email, // email to be validate
"matchCriteria" => "NONE"
);
// convert payload array into url encoded query string
$body_data = http_build_query($bodyparams, "", chr(38));
//create request and add headers
$params = array("http" => array(
"method" => "POST",
"content" => $body_data,
"header" => "X-PAYPAL-SECURITY-USERID: " . $API_UserName . "\r\n" .
"X-PAYPAL-SECURITY-SIGNATURE: " . $API_Signature . "\r\n" .
"X-PAYPAL-SECURITY-PASSWORD: " . $API_Password . "\r\n" .
"X-PAYPAL-APPLICATION-ID: " . $API_AppID . "\r\n" .
"X-PAYPAL-REQUEST-DATA-FORMAT: " . $API_RequestFormat . "\r\n" .
"X-PAYPAL-RESPONSE-DATA-FORMAT:" . $API_ResponseFormat . "\r\n"
));
$ctx = stream_context_create($params); //create stream context
$fp = @fopen($url, "r", false, $ctx); //open the stream and send request
$response = stream_get_contents($fp); //get response
//check to see if stream is open
if ($response === false)
{
throw new Exception("php error message = " . "$php_errormsg");
}
fclose($fp); //close the stream
$keyArray = explode("&", $response);
foreach ($keyArray as $rVal)
{
list($qKey, $qVal) = explode ("=", $rVal);
$kArray[$qKey] = $qVal;
}
if( $kArray["responseEnvelope.ack"] == "Success")
{
// do nothing
}
else
{
// error
}
However this code works for sandbox account. What changes do i make to validate the paypal account. Any help will be appreciated.
Three Things
GetVerifiedStatus
API requires your adaptive payment application to be approved with "getverifiedstatus" feature enabled.GetVerifiedStatus
checkbox enabled, get the application approved at www.paypal-apps.com to get the APP-IDP.S
Your account should be Business/premier Verified account
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments