PayPal Adaptive Payments - Error 520009 - Account is limited

Sorry in advance if this is a stupid question. I tried to dig, but could not find the answer.

I am trying to set up a pegged payment (in a sandbox environment), but I get error 520009 (Account is limited). Tried several email addresses and they all give me this error. Email addresses are not registered with Paypal, but as far as I know, this should not be a problem, since the adaptive payments module does not require recipients to have Paypal accounts in advance (although they need accounts to actually receive money, of course).

What am I doing wrong? I installed the payer fees in EACHRECEIVER (as suggested in some threads), but the error remains.

This is what I will return: Code ERROR: 520009 Message ERROR: Account someone1@gmail.com limited

Here is my code:

// 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" => ' someone1@gmail.com ', "receiverList.receiver[0].amount" => '10', "receiverList.receiver[0].primary" => 'true', "receiverList.receiver[1].email" => ' someone2@gmail.com ', "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()."||"; } 

Thanks!

+6
source share
2 answers

EDIT: I could solve the problem by removing the "feePayer" parameter, which should be the default value (ie EACHRECEIVER) in case of one-way payment.

I am also stuck in this problem.

I wonder how I could achieve a “one-way payment”, which is described by PayPal as follows:

You can use the Pay API transaction for one-way payments within limited circumstances. A one-way payment is a payment that is made to a recipient who does not have a PayPal account. One-way payments can be used with simple or concurrent payments that are implicit or preapproved. One-way payments are not intended for use with related payments or payments that require a web stream. When you send a one-way payment, you send a payment request that includes the email address for the recipient, and this email address is not associated with a registered PayPal account. The recipient receives an email notifying the recipient of the creation of the account and request payment. PayPal has payment to the recipient whose email address has not yet been registered or verified until the receiver creates a PayPal account and confirms the email address. If the return is indicated by the recipient whose email address has not yet been registered or confirmed, payment to the recipient is canceled.

Anyone who has an idea of ​​what parameter settings using NVP is required to achieve this without receiving ERROR Code: 520009 ERROR Message: Account someone1@gmail.com is restricted

Any hints are welcome!

+4
source

"but as far as I know, this should not be a problem as the adaptive payment module does not require recipients to have Paypal accounts in advance"

This is not true. For Adaptive Chained Payments, all recipients must have an active and verified Personal, Premier, or Business PayPal account.

0
source

Source: https://habr.com/ru/post/913793/


All Articles