Codeigniter Paypal Express Checkout未通过ShippingAMT和TAXAMT

时间:2013-07-03 01:45:15

标签: php codeigniter paypal e-commerce express-checkout

这是问题 - 我使用Codeigniter作为我的框架并集成了Paypal Express Checkout。我正在使用的库是CI_MERCHANT,它工作得很好但是当我print_r发送的参数然后询问GetTransactionDetails它们是不同的

以下是我发送的内容:

    Array
(
    [METHOD] => SetExpressCheckout
    [VERSION] => 94.0
    [USER] => ***
    [PWD] => ***
    [SIGNATURE] => ***
    [PAYMENTREQUEST_0_PAYMENTACTION] => Authorization
    [PAYMENTREQUEST_0_CURRENCYCODE] => USD
    [PAYMENTREQUEST_0_AMT] => 37.95
    [PAYMENTREQUEST_0_ITEMAMT] => 35.95
    [PAYMENTREQUEST_0_DESC] => invoice-#test
    [PAYMENTREQUEST_0_TAXAMT] => 1.00
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 1.00
    [L_PAYMENTREQUEST_0_NAME0] => Item_1
    [L_PAYMENTREQUEST_0_DESC0] => 
    [L_PAYMENTREQUEST_0_AMT0] => 35.95
    [L_PAYMENTREQUEST_0_QTY0] => 1
    [AMT] => 37.95
    [SOLUTIONTYPE] => Sole
    [LANDINGPAGE] => Billing
    [ALLOWNOTE] => 1
    [RETURNURL] => URL/ACCEPT
    [CANCELURL] => URL/DECLINE
    [PAYMENTREQUEST_0_SHIPTONAME] => first_name second_name
    [PAYMENTREQUEST_0_SHIPTOSTREET] => address1
    [PAYMENTREQUEST_0_SHIPTOSTREET2] => address2
    [PAYMENTREQUEST_0_SHIPTOCITY] => city
    [PAYMENTREQUEST_0_SHIPTOSTATE] => state
    [PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => US
    [PAYMENTREQUEST_0_SHIPTOZIP] => zip
    [PAYMENTREQUEST_0_SHIPTOPHONENUM] => 
    [PAYMENTREQUEST_0_EMAIL] => email@dot.com
    [PAYMENTREQUEST_0_INVNUM] => 1468808
    [upload] => 1
)

我得到的回应是:

Array
(
    [RECEIVEREMAIL] => ***
    [RECEIVERID] => ***
    [EMAIL] => email@dot.com
    [PAYERID] => ***
    [PAYERSTATUS] => verified
    [COUNTRYCODE] => US
    [SHIPTONAME] => first_name last_name
    [SHIPTOSTREET] => address1
    [SHIPTOCITY] => city
    [SHIPTOSTATE] => state
    [SHIPTOCOUNTRYCODE] => US
    [SHIPTOCOUNTRYNAME] => United States
    [SHIPTOZIP] => ZIP
    [ADDRESSOWNER] => PayPal
    [ADDRESSSTATUS] => Confirmed
    [INVNUM] => 1468808
    [SALESTAX] => 0.00
    [SUBJECT] => invoice-#test
    [TIMESTAMP] => 2013-07-03T01:29:04Z
    [CORRELATIONID] => b64ae0d8c4388
    [ACK] => Success
    [VERSION] => 94.0
    [BUILD] => 6561328
    [FIRSTNAME] => first_name
    [LASTNAME] => last_name
    [TRANSACTIONID] => ***
    [TRANSACTIONTYPE] => cart
    [PAYMENTTYPE] => instant
    [ORDERTIME] => 2013-07-03T01:29:02Z
    [AMT] => 35.95
    [TAXAMT] => 0.00
    [SHIPPINGAMT] => 0.00
    [HANDLINGAMT] => 0.00
    [CURRENCYCODE] => USD
    [PAYMENTSTATUS] => Pending
    [PENDINGREASON] => paymentreview
    [REASONCODE] => None
    [PROTECTIONELIGIBILITY] => Ineligible
    [PROTECTIONELIGIBILITYTYPE] => None
    [L_NAME0] => Item_1
    [L_QTY0] => 1
    [L_TAXAMT0] => 0.00
    [L_SHIPPINGAMT0] => 0.00
    [L_HANDLINGAMT0] => 0.00
    [L_CURRENCYCODE0] => USD
    [L_TAXABLE0] => false
    [L_AMT0] => 35.95
}

我尝试过以下方法: 使用不同的版本声明。 我知道SHIPPINGAMT和TAXAMT自版本63.0以来已被弃用,因此我尝试使用它并将其设置为版本61无效。

此外,在沙盒帐户中,“客户”仅向ITEMAMT收取费用,而不是运费的全额。但是在结账时它会传递金额,因为显示的总数是ITEMAMT + SHIPPING + TAX。

任何人都知道发生了什么事?

赞赏。

1 个答案:

答案 0 :(得分:0)

我假设您在调用DoExpressCheckoutPayment之前调用了GetExpressCheckoutDetails .. ??

我很确定您所看到的是预期结果。在调用DoExpressCheckoutPayment之前,运费和税额可能会发生变化,因此GECD不会反映任何内容。

当您重定向到PayPal时,您是否在订单审核中看到了运费和税金?如果是这样,那么你正确地做了一切。只是,GECD再次没有包含这些细节,因为它们可以改变。例如,您可以致电GECD获取付款人的送货地址,以便您可以相应地计算运费和税金,这可能与您向SEC发送的内容不同。

无论如何,检查您是否能够在PayPal的评论页面中查看您在SEC发送的内容,然后使用DECP完成所有内容,我猜您会看到它按预期包含(只要你在DECP请求中以相同的方式包含它。)