Paypal - 快速结账 - 购物车项目金额的总数与订单金额不匹配(10413)

时间:2012-05-13 09:06:29

标签: php error-handling paypal express-checkout

我正在使用以下内容并一遍又一遍地收到同样的错误;并注意:AMT和ITEMAMT = $ paymentAmount。

我不能,因为对神灵的爱,明白为什么不是匹配的金额。

$grandtotal = 0;
for ($i = 0;$i < $numItems;$i++) {
    $subtotal = $theBasket[$i]['item_preco'] * $theBasket[$i]['item_qty'];
    $grandtotal += $subtotal;
    echo $subtotal.'<br>';
    $mCq .= '&L_PAYMENTREQUEST_0_NAME'.$i.'='.htmlentities($theBasket[$i]['item_nome']).
        '&L_PAYMENTREQUEST_0_AMT'.$i.'='.$theBasket[$i]['item_preco'].
        '&L_PAYMENTREQUEST_0_QTY'.$i.'='.$theBasket[$i]['item_qty'];
}

for循环返回:

&amp; L_PAYMENTREQUEST_0_NAME0 =HAMSÁBRACELET RING

&安培; L_PAYMENTREQUEST_0_AMT0 = 9

&安培; L_PAYMENTREQUEST_0_QTY0 = 1

$paymentAmount = number_format($grandtotal,2);

        $nvpstr = $mCq;
        $nvpstr .= '&PAYMENTREQUEST_0_AMT='.$paymentAmount;
        $nvpstr .= '&PAYMENTREQUEST_0_ITEMAMT='.$paymentAmount;
        $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_PAYMENTACTION=" . $paymentType;
        $nvpstr = $nvpstr . "&RETURNURL=" . $returnURL;
        $nvpstr = $nvpstr . "&CANCELURL=" . $cancelURL;
        $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_CURRENCYCODE=" . $currencyCodeType;

1 个答案:

答案 0 :(得分:0)

好。我修好了。问题是:它说的错误不是“打破链接”的错误。

而不是这是一个10413(总量不是什么)这是一个“字段缺失”的简单案例;在这种情况下,'&L_PAYMENTREQUEST_0_NUMBER'.$i.'='.$theBasket[$i]['ct_item_id']. '&L_PAYMENTREQUEST_0_DESC'.$i.'=descricao'.那些缺少的人