【问题标题】:Error #520009 - Account is restricted错误 #520009 - 帐户受到限制
【发布时间】:2012-08-28 03:26:03
【问题描述】:

我在尝试进行并行付款时收到 520009 错误(帐户 xx@xx.com 受到限制)。我的代码使用沙箱运行良好,但我切换到实时端点,它开始失败。有问题的帐户是有效的贝宝帐户,我正在使用“feespayer=SENDER”。我错过了什么吗?即使收款人是基本帐户,付费电话也不应该通过吗?为什么会出现这种情况?

这是我的参考代码

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

【问题讨论】:

  • 应用程序所有者是否有 paypal 企业帐户?
  • 没有$payRequest->feesPayer = ... 部分是否可以工作?

标签: php paypal paypal-adaptive-payments


【解决方案1】:

PayPal API 有两个参考来源: cms.paypal.com 页面,例如 Mihai Iorga 引用的页面,以及 像这样的 www.x.com 页面: https://www.x.com/developers/paypal/documentation-tools/going-live-with-your-application

在 x.com 上,它说您必须有一个经过验证的企业帐户,尽管 cms.paypal.com 并不清楚这种情况。

【讨论】:

    【解决方案2】:

    不!基本帐户无法做到这一点。

    要使 API 正常工作,您需要拥有经过验证的企业帐户。

    在他们的API 中写道:

    注意:
    应用程序所有者必须拥有 PayPal 企业帐户。

    【讨论】:

    • 我的帐户是经过验证的企业帐户
    • 所有收款人都有 PayPal 账户吗,$config['email'] 是有效的 PayPal 账户吗?
    • 您在$config['email'] 中使用的电子邮件与在 PayPal 沙箱中使用的电子邮件相同吗?
    猜你喜欢
    • 2012-05-02
    • 2014-06-27
    • 1970-01-01
    • 2018-02-22
    • 1970-01-01
    • 1970-01-01
    • 2012-06-22
    • 2011-08-31
    • 2019-09-14
    相关资源
    最近更新 更多