webizone
webizone

Reputation: 61

Why is PayPal GetVerifiedStatus API not working for certain account

I am using this library to verify PayPal users through email ID. The API I am using is GetVerifiedStatus. The developer of the library provides an email address in the code and it works fine. The code returns the status as "VERIFIED" for his email ID.

However, whenever I try to use my email ID, it shows "Cannot determine PayPal Account status" with ErrorID --580023. I tried another person's email ID and still it does not work. I am sure there is no typo in the email, firstname, lastname fields.

Seems, these links addresses the same issue. PayPal GetVerifiedStatus not working with other accounts and Does PayPal's GetVerifiedStatus `belong' to the api caller's country?

This is the code that comes with the library. (added my paypal email ID and name)

require_once('../includes/config.php');
require_once('../autoload.php');
    // Create PayPal object.
$PayPalConfig = array(
                      'Sandbox' => $sandbox,
                      'DeveloperAccountEmail' => $developer_account_email,
                      'ApplicationID' => $application_id,
                      'DeviceID' => $device_id,
                      'IPAddress' => $_SERVER['REMOTE_ADDR'],
                      'APIUsername' => $api_username,
                      'APIPassword' => $api_password,
                      'APISignature' => $api_signature,
                      'APISubject' => $api_subject, 
                      'PrintHeaders' => $print_headers,
                      'LogResults' => $log_results, 
                      'LogPath' => $log_path,
                    );

$PayPal = new angelleye\PayPal\Adaptive($PayPalConfig);

// Prepare request arrays
$GetVerifiedStatusFields = array(
                                'EmailAddress' => 'xxxxxx',                     // Required.  The email address of the PayPal account holder.
                                'FirstName' => 'xxxxxx',                        // The first name of the PayPal account holder.  Required if MatchCriteria is NAME
                                'LastName' => 'xxxxxx',                         // The last name of the PayPal account holder.  Required if MatchCriteria is NAME
                                'MatchCriteria' => 'NAME'                   // Required.  The criteria must be matched in addition to EmailAddress.  Currently, only NAME is supported.  Values:  NAME, NONE   To use NONE you have to be granted advanced permissions
                                );

$PayPalRequestData = array('GetVerifiedStatusFields' => $GetVerifiedStatusFields);

// Pass data into class for processing with PayPal and load the response array into $PayPalResult
$PayPalResult = $PayPal->GetVerifiedStatus($PayPalRequestData);

// Write the contents of the response array to the screen for demo purposes.
echo '<pre />';
print_r($PayPalResult);

I am not getting any idea why it is happening. Can anyone help please?

Upvotes: 1

Views: 990

Answers (1)

Brian
Brian

Reputation: 25834

You are testing in sandbox mode. You must create sandbox accounts, either via https://developer.paypal.com/docs/classic/lifecycle/sb_about-accounts/#create-and-manage-sandbox-accounts or using the standard user flow on https://www.sandbox.paypal.com/us/home .

Upvotes: 1

Related Questions