donglan9517 2012-09-03 11:35
浏览 36

错误#520009 - 帐户受到限制

I get a 520009 error (Account xx@xx.com is restricted) when trying to make a parallel payment. My code worked fine using the sandbox but I switched to the live endpoint and it began failing. The account in question is a valid paypal account and I am using "feespayer=SENDER". Am I missing something? Shouldn't the pay call go through even if the payee is a basic account? Why would this occur?

Here is my code for reference

function deposit($config) {
    try {
        if (isset($config['return_url']))
            $this->return_url = $config['return_url'];
        else
            return 'Return URL should be set';

        if (isset($config['return_url']))
            $this->cancel_url = $config['cancel_url'];
        else
            return 'Cancel URL should be set';

        if (isset($config['email']))
            $this->sender_email = $config['email'];
        else
            return 'Email should be defined';

        if (isset($config['amount']))
            $this->amount = $config['amount'];
        else
            return 'Amount should be defined';

        $returnURL = $this->return_url;
        $cancelURL = $this->cancel_url;
        $currencyCode = 'USD';
        $memo = 'Deposit to ' . $this->ci->config->item('site_name');
        $feesPayer = 'SENDER';


        $payRequest = new PayRequest();
        $payRequest->actionType = "PAY";
        $payRequest->cancelUrl = $cancelURL;
        $payRequest->returnUrl = $returnURL;
        $payRequest->clientDetails = new ClientDetailsType();
        $payRequest->clientDetails->applicationId = $this->ci->config->item('application_id');
        $payRequest->clientDetails->deviceId = $this->ci->config->item('device_id');
        $payRequest->clientDetails->ipAddress = $this->ci->input->ip_address();
        $payRequest->currencyCode = $currencyCode;
        //$payRequest->senderEmail = $this->sender_email;
        $payRequest->requestEnvelope = new RequestEnvelope();
        $payRequest->requestEnvelope->errorLanguage = "en_US";

        $receivers = array();

        $receiver = new receiver();
        $receiver->email = $this->ci->config->item('moneyfan_account');
        $receiver->amount = $this->amount;
        $receiver->primary = 'false';

        $receivers[] = $receiver;

        $payRequest->receiverList = $receivers;
        $payRequest->feesPayer = $feesPayer;
        $payRequest->memo = $memo;

        $ap = new AdaptivePayments();
        $response = $ap->Pay($payRequest);            
        if (strtoupper($ap->isSuccess) == 'FAILURE') {


            $this->ci->session->set_userdata('FAULTMSG', $ap->getLastError());
            return json_encode(array('status' => 'false', 'msg' => $ap->getLastError()->error->errorId .' : '. $ap->getLastError()->error->message));
            //redirect(site_url('home/api_error'));
        } else {
            $this->ci->session->set_userdata('payKey', $response->payKey);
            if ($response->paymentExecStatus == "COMPLETED") {
                redirect($returnURL);
            } else {
                $token = $response->payKey;
                $payPalURL = PAYPAL_REDIRECT_URL . '_ap-payment&paykey=' . $token;
                return json_encode(array('status' => 'true', 'msg' => $payPalURL));
                //header("Location: " . $payPalURL);
            }
        }
    } catch (Exception $ex) {

        $fault = new FaultMessage();
        $errorData = new ErrorData();
        $errorData->errorId = $ex->getFile();
        $errorData->message = $ex->getMessage();
        $fault->error = $errorData;
        $this->ci->session->set_userdata('FAULTMSG', $fault);
        redirect(site_url('home/api_error'));
    }
}
  • 写回答

2条回答 默认 最新

  • douyuan3842 2012-09-07 14:59
    关注

    No! You cannot do that with a basic account.

    For API to work you need to have a VERIFIED Business Account.

    In their API it says:

    NOTE:
    The application owner must have a PayPal Business account.

    评论

报告相同问题?

悬赏问题

  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图