Disculpa de antemano si esta es una pregunta tonta. Intenté cavar, pero no pude encontrar una respuesta.Paypal Adaptive Payments - Error 520009 - La cuenta está restringida
Estoy tratando de configurar un pago encadenado (en el entorno de sandbox), pero obtengo el error 520009 (La cuenta está restringida). Intenté varias direcciones de correo electrónico, y todas me dieron este error. Las direcciones de correo electrónico no están registradas en Paypal, pero hasta donde sé, esto no debería ser un problema ya que el módulo de pagos adaptables no requiere que los receptores tengan cuentas de Paypal por adelantado (aunque necesitarán cuentas para obtener realmente el dinero , por supuesto).
¿Qué estoy haciendo mal? Establecí el pagador de tarifas en EACHRECEIVER (como se sugiere en algunos hilos), pero el error permanece.
Esto es lo que yo vuelva: Código ERROR: 520009 mensaje de error: [email protected] cuenta está restringida
Aquí está mi código:
// Config
$endpoint = trim("https://svcs.sandbox.paypal.com/AdaptivePayments/Pay");
$API_UserName = "MY_USERNAME_FROM_SANDBOX";
$API_Password = "MY_PASSWORD_FROM_SANDBOX";
$API_Signature = "MY_SIGNATURE_FROM_SANDBOX";
$API_AppID = "APP-80W284485P519543T";
$API_RequestFormat = "NV";
$API_ResponseFormat = "NV";
// Create request payload with minimum required parameters
$bodyparams = array (
"requestEnvelope.errorLanguage" => "en_US",
"actionType" => "PAY_PRIMARY",
"cancelUrl" => 'http://www.beta.com/cancel',
"returnUrl" => 'http://www.beta.com/return',
"currencyCode" => 'USD',
"feesPayer" => "EACHRECEIVER",
"actionType" => "PAY_PRIMARY",
"receiverList.receiver[0].email" => '[email protected]',
"receiverList.receiver[0].amount" => '10',
"receiverList.receiver[0].primary" => 'true',
"receiverList.receiver[1].email" => '[email protected]',
"receiverList.receiver[1].amount" => '5',
"receiverList.receiver[1].primary" => 'false',
);
// Convert payload array into url encoded query string
$body_data = http_build_query($bodyparams, "", chr(38));
try
{
//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"
));
//create stream context
$ctx = stream_context_create($params);
//open the stream and send request
$fp = @fopen($endpoint, "r", false, $ctx);
//get response
$response = stream_get_contents($fp);
//check to see if stream is open
if ($response === false) {
throw new Exception("php error message = " . "$php_errormsg");
}
//close the stream
fclose($fp);
//parse the ap key from the response
$keyArray = explode("&", $response);
foreach ($keyArray as $rVal){
list($qKey, $qVal) = explode ("=", $rVal);
$kArray[$qKey] = $qVal;
}
//print the response to screen for testing purposes
If ($kArray["responseEnvelope.ack"] == "Success") {
foreach ($kArray as $key =>$value){
echo $key . ": " .$value . "<br/>";
}
}
else {
echo 'ERROR Code: ' . $kArray["error(0).errorId"] . " <br/>";
echo 'ERROR Message: ' . urldecode($kArray["error(0).message"]) . " <br/>";
}
}
catch(Exception $e) {
echo "Message: ||" .$e->getMessage()."||";
}
Gracias!
posible duplicado de [Error # 520009 - La cuenta está restringida] (http://stackoverflow.com/questions/12247050/error-520009-account-is-restricted) – billinkc