paypal API doExpressCheckoutPayment状态待定

时间:2012-02-23 16:33:26

标签: php paypal paypal-sandbox

我正在测试经常性付款。在doExpressCheckoutPayment操作后,我收到状态待定在我的沙盒paypal帐户中。为什么状态未完成?需要多长时间才能设置状态完成?或者可能需要在沙箱中设置一些参数。我使用默认设置。付款审核 - 已停用。 谢谢!) enter image description here

UPD 1: 这是我的请求代码:

public function setPayment($plan){
        $params = array(
            'PAYMENTREQUEST_0_AMT' => '10.00',
            'RETURNURL' => $this->base_url.'/paypal/response',
            'CANCELURL' => $this->base_url.'/paypal/paypal',
            'PAYMENTREQUEST_0_PAYMENTACTION' => 'Authorization',
            'PAYMENTREQUEST_0_CURRENCYCODE' => 'GBP',
            'PAYMENTREQUEST_0_DESC' => 'Testing PayPal recurring',
            'PAYMENTREQUEST_0_NOTIFYURL' => 'http://barton.netai.net/ipn.php',
            'L_BILLINGTYPE0' => 'RecurringPayments',
            'L_BILLINGAGREEMENTDESCRIPTION0' => 'SamePayments'
        );
    $this->_paypal->addFields($params);
    $response = $this->_paypal->request('SetExpressCheckout');
    if (strtoupper($response['ACK'])=='SUCCESS'){
        $token=$response['TOKEN'];
        header('Location: '.$this->_paypal->getPaypalUrl().'?cmd=_express-checkout&token='.$token);
        return true;
    } else {
        return false;
    }
}

public function responseAction(){
    if (isset($_GET['token']) && isset($_GET['PayerID'])){
        $this->_paypal->addFields(array('TOKEN'=>$_GET['token']));
        $response=$this->_paypal->request('GetExpressCheckoutDetails');
        if ($response['ACK']=='Success'){
            $response=array();
            $this->_paypal->addFields(array(
                                          'TOKEN' => $_GET['token'],
                                          'PAYMENTREQUEST_0_PAYMENTACTION' => 'Authorization',
                                          'PAYERID' => $_GET['PayerID'],
                                          'L_BILLINGTYPE0' => 'RecurringPayments',
                                          'L_BILLINGAGREEMENTDESCRIPTION0' => 'SamePayments',
                                          'PAYMENTREQUEST_0_AMT' => '10.00',
                                          'PAYMENTREQUEST_0_CURRENCYCODE' => 'GBP'
                                      ));
            $response=$this->_paypal->request('DoExpressCheckoutPayment');
            show($response); exit;
        }
    }
}

SetExpressCheckout回复:

    Array
(
    [TOKEN] => EC-01C99915Y11155245
    [TIMESTAMP] => 2012-02-24T10:23:32Z
    [CORRELATIONID] => 69e91a5abc347
    [ACK] => Success
    [VERSION] => 84
    [BUILD] => 2571254
)

doExpressCheckoutPayment响应:

 Array
(
    [TOKEN] => EC-2FR88291S31672645
    [SUCCESSPAGEREDIRECTREQUESTED] => false
    [TIMESTAMP] => 2012-02-24T10:26:08Z
    [CORRELATIONID] => a95c7a9bb64b3
    [ACK] => Success
    [VERSION] => 84
    [BUILD] => 2571254
    [INSURANCEOPTIONSELECTED] => false
    [SHIPPINGOPTIONISDEFAULT] => false
    [PAYMENTINFO_0_TRANSACTIONID] => 2RN165632T770592L
    [PAYMENTINFO_0_TRANSACTIONTYPE] => expresscheckout
    [PAYMENTINFO_0_PAYMENTTYPE] => instant
    [PAYMENTINFO_0_ORDERTIME] => 2012-02-24T10:26:06Z
    [PAYMENTINFO_0_AMT] => 10.00
    [PAYMENTINFO_0_TAXAMT] => 0.00
    [PAYMENTINFO_0_CURRENCYCODE] => GBP
    [PAYMENTINFO_0_PAYMENTSTATUS] => Pending
    [PAYMENTINFO_0_PENDINGREASON] => authorization
    [PAYMENTINFO_0_REASONCODE] => None
    [PAYMENTINFO_0_PROTECTIONELIGIBILITY] => Eligible
    [PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE] => ItemNotReceivedEligible,UnauthorizedPaymentEligible
    [PAYMENTINFO_0_SECUREMERCHANTACCOUNTID] => WLC8CZSP2C5L8
    [PAYMENTINFO_0_ERRORCODE] => 0
    [PAYMENTINFO_0_ACK] => Success
)

在我以前的question中,您建议我将PAYMENTREQUEST_0_PAYMENTACTION安装到Sale, 也许这有助于我决定这个问题?

2 个答案:

答案 0 :(得分:2)

如其他问题所述,替换;

'PAYMENTREQUEST_0_PAYMENTACTION' => 'Authorization',

通过

'PAYMENTREQUEST_0_PAYMENTACTION' => 'Sale',

答案 1 :(得分:0)

当您将 PAYMENTREQUEST_0_PAYMENTACTION 设置为“授权”时,表示您要求PayPal检查资金是否可用以及是否可用在他们身上72小时。您有最多29天的时间来获取授权,当您这样做时,资金只能暂停三天。 29天期限的前72小时被称为“荣誉期”,这意味着PayPal保证资金可用。

  • 大多数情况下会发生三天的停留,具体取决于 发卡银行,或银行本身在ACH交易中,如a 借记卡。在某些情况下,三天的保留被免除,而在 其他情况可能会持卡30天或 直到下一个结算周期。
  • 如果您决定在过去三天内获取资金 29天期限内,这些资金将持续到第29天结束 而不是通常的三天。
  • 您可以捕获少于原始授权金额的全部 金额,或比原始授权高出115%或75美元, 以较少者为准。

当您将 PAYMENTREQUEST_0_PAYMENTACTION 设置为“促销”时,无需持有资金即可处理付款。资金将立即从买方的资金来源转移到您的PayPal账户余额。

  • 您可以将“促销”选项用于交付的内容 快速,例如数字商品或您尽快发货的产品 收到订单。
  • 资金立即从买方的资金来源中获取 发送到您的PayPal帐户余额。