2

我是PayPal express的新手,函数返回错误10413。客户看到这个账单:

1.Item   Price: 77€
2.Item 2 Price:79€

Subtotal: 128.93€ (without tax)
Shipping: 3.95€ (without tax)
TAX:      27.83€(Item's tax + shipping's tax)
Discount: -31.2€

Total to pay:   129.58€

在 CallShortcutExpressCheckout 我做这个字符串:

&PAYMENTREQUEST_0_AMT=129.58
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&RETURNURL=http://example.com/FinalizarPedido
&CANCELURL=http://example.com/DetalleCarrito
&PAYMENTREQUEST_0_CURRENCYCODE=EUR
&INVOICEID=63f958d2dc0c08ae6d71059ff90eae22
&L_PAYMENTREQUEST_0_NAME0=Item
&L_PAYMENTREQUEST_0_AMT0=77.00
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_NAME1=Item 2
&L_PAYMENTREQUEST_0_AMT1=79.00
&L_PAYMENTREQUEST_0_QTY1=1
&PAYMENTREQUEST_0_AMT=129.58
&PAYMENTREQUEST_0_TAXAMT=27.83
&PAYMENTREQUEST_0_ITEMAMT=156
&PAYMENTREQUEST_0_SHIPPINGAMT=3.95
&PAYMENTREQUEST_0_SHIPDISCAMT=31.20
SetExpressCheckout

错误在哪里?也许我必须输入不含税的商品价格&L_PAYMENTREQUEST_0_AMT0

4

2 回答 2

4

我发现了问题,只需要先减号折扣金额

&PAYMENTREQUEST_0_SHIPDISCAMT=-31.20

谢谢大家。

于 2013-05-08T08:56:45.170 回答
0

10413 API 响应意味着 ItemTotal、ShippingTotal、HandlingTotal 和 TaxTotal 加起来不等于提交的 OrderTotal 的值。有关此计算的规则,请参阅 PayPal 集成指南。

只是从快速查看您提供的内容来看,您似乎没有正确添加总计。看起来 PAYMENTREQUEST_0_ITEMAMT=156 应该是 PAYMENTREQUEST_0_ITEMAMT=156.58。下面是我刚刚提交的请求,它通过了。

API 请求:

USER=xxxxxxxxx   
PWD=xxxxxxxxx   
SIGNATURE=xxxxxxxxx   
METHOD=SetExpressCheckout   
VERSION=98.0   
RETURNURL=https://www.ccaples.com/index.php/api-s/paypal-nvp/nvp-quick-test   
CANCELURL=https://www.ccaples.com/index.php/api-s/paypal-nvp/nvp-quick-test   
PAYMENTREQUEST_0_CURRENCYCODE=EUR   
INVOICEID=63f958d2dc0c08ae6d71059ff90eae22   
L_PAYMENTREQUEST_0_NAME0=Item   
L_PAYMENTREQUEST_0_AMT0=77.00   
L_PAYMENTREQUEST_0_QTY0=1   
L_PAYMENTREQUEST_0_NAME1=Item 2   
L_PAYMENTREQUEST_0_AMT1=79.00   
L_PAYMENTREQUEST_0_QTY1=1   
PAYMENTREQUEST_0_ITEMAMT=156.00   
PAYMENTREQUEST_0_AMT=156.58   
PAYMENTREQUEST_0_TAXAMT=27.83   
PAYMENTREQUEST_0_SHIPPINGAMT=3.95   
PAYMENTREQUEST_0_SHIPDISCAMT=-31.20 

API 响应:

TOKEN=EC-6FP13377V8467513R  
TIMESTAMP=2013-05-06T14:05:04Z  
CORRELATIONID=8f418e8a77fec  
ACK=Success  
VERSION=98.0  
BUILD=5817241  
于 2013-05-06T14:08:15.557 回答