为什么PayPal GetVerifiedStatus API不适用于某个帐户

时间:2016-08-04 05:42:47

标签: php paypal

我正在使用this库通过电子邮件ID验证PayPal用户。我使用的API是GetVerifiedStatus。该库的开发人员在代码中提供了一个电子邮件地址,它工作正常。代码返回状态为" VERIFIED"他的电子邮件ID。

但是,每当我尝试使用我的电子邮件ID时,它都会显示"无法确定PayPal帐户状态"使用ErrorID --580023。我尝试了另一个人的电子邮件ID,但仍无效。我确信电子邮件,名字,姓氏字段中没有拼写错误。

似乎这些链接解决了同样的问题。 PayPal GetVerifiedStatus not working with other accountsDoes PayPal's GetVerifiedStatus `belong' to the api caller's country?

这是库附带的代码。 (添加了我的paypal电子邮件ID和名称)

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

我不知道为什么会这样。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

您正在以沙盒模式进行测试。您必须通过https://developer.paypal.com/docs/classic/lifecycle/sb_about-accounts/#create-and-manage-sandbox-accounts或使用https://www.sandbox.paypal.com/us/home上的标准用户流创建沙盒帐户。