duananyu9231 2012-04-17 12:24
浏览 33
已采纳

Paypal API:购物车项目金额的总数与订单金额不匹配

I am working with the paypal express checkout API and am having issues with setting the quantity. Below are my URI parameters:

$params = array(
   'METHOD' => 'SetExpressCheckout',
   'PAYMENTREQUEST_0_SHIPPINGAMT' => '0',
   'PAYMENTREQUEST_0_TAXAMT' => '0',
   'PAYMENTREQUEST_0_HANDLINGAMT' => '0',
   'PAYMENTREQUEST_0_AMT' => "50.00",
   'RETURNURL' => $this->_returnUri,
   'CANCELURL' => $this->_cancelUri,
   'HDRIMG' => $this->_logoUri,
   'PAYMENTREQUEST_0_CURRENCYCODE' => 'GBP',
   'L_PAYMENTREQUEST_0_DESC0' => 'Product description',
   'L_PAYMENTREQUEST_0_NAME0' => 'Product name',
   'L_PAYMENTREQUEST_0_AMT0' => "50.00",
   'L_PAYMENTREQUEST_0_QTY0' => "2"
);

If L_PAYMENTREQUEST_0_QTY0 is set to 1 the process is fine. However, changing it to 2 and adding 'PAYMENTREQUEST_0_ITEMAMT' => "100.00" to the array gives me the following error:

TIMESTAMP: 2012-04-17T12:11:16Z
CORRELATIONID: da43f6c91254
ACK: Failure
VERSION: 88.0
BUILD: 2808426
L_ERRORCODE0: 10413
L_SHORTMESSAGE0: Transaction refused because of an invalid argument. See additional error messages for details.
L_LONGMESSAGE0: The totals of the cart item amounts do not match order amounts.
L_SEVERITYCODE0: Error

I have tried for hours on end to fix it and have given up. Can someone highlight want I need to do to get it to work ?

  • 写回答

3条回答 默认 最新

  • dongzhan7909 2012-04-18 20:51
    关注

    You're missing an ITEMAMT. See also my answer in Paypal Express checkout with shipping cost and error which contains a working example with multiple quantities.

    &L_PAYMENTREQUEST_0_NAME0=10% Decaf Kona Blend Coffee  
    &L_PAYMENTREQUEST_0_NUMBER0=623083  
    &L_PAYMENTREQUEST_0_DESC0=Size: 8.8-oz 
    &L_PAYMENTREQUEST_0_AMT0=9.95  
    &L_PAYMENTREQUEST_0_QTY0=2  
    &L_PAYMENTREQUEST_0_NAME1=Coffee Filter bags  
    &L_PAYMENTREQUEST_0_NUMBER1=623084  
    &L_PAYMENTREQUEST_0_DESC1=Size: Two 24-piece boxes  
    &L_PAYMENTREQUEST_0_AMT1=39.70  
    &L_PAYMENTREQUEST_0_QTY1=2  
    &PAYMENTREQUEST_0_ITEMAMT=99.30  
    &PAYMENTREQUEST_0_TAXAMT=2.58  
    &PAYMENTREQUEST_0_SHIPPINGAMT=3.00  
    &PAYMENTREQUEST_0_HANDLINGAMT=2.99  
    &PAYMENTREQUEST_0_SHIPDISCAMT=-3.00  
    &PAYMENTREQUEST_0_INSURANCEAMT=1.00  
    &PAYMENTREQUEST_0_AMT=105.87  
    &PAYMENTREQUEST_0_CURRENCYCODE=USD  
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥15 统计大规模图中的完全子图问题
  • ¥15 使用LM2596制作降压电路,一个能运行,一个不能
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路
  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错
  • ¥20 @microsoft/fetch-event-source 流式响应问题
  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式