3

我开始使用 PayPal,我的第一项工作是在我们的网站上对其进行调试。

实际上,当我们到达订单末尾时,它工作正常,但我们在日志中得到一个堆栈:"Invalid token (#10410: Invalid Token)"。当doExpressCheckoutPayment调用 并且似乎没有令牌和payerid 时会发生这种情况,因此会引发错误。所有其他信息似乎都已正确填写。

这是调试结果调用doExpressCheckoutPayment

[DoExpressCheckoutPayment] => Array
(
    [TOKEN] => 
    [PAYERID] => 
    [PAYMENTACTION] => Sale
    [AMT] => 4.16
    [CURRENCYCODE] => EUR
    [BUTTONSOURCE] => Varien_Cart_EC_FR
    [NOTIFYURL] => *
    [RETURNFMFDETAILS] => 1
    [ITEMAMT] => 3.36
    [TAXAMT] => 0.80
    [SHIPPINGAMT] => 0.00
    [L_NUMBER0] => *
    [L_NAME0] => *
    [L_QTY0] => 1
    [L_AMT0] => 4.10
    [L_NUMBER1] => 
    [L_NAME1] => Discount
    [L_QTY1] => 1
    [L_AMT1] => -0.74
    [BUSINESS] => 
    [EMAIL] => *
    [FIRSTNAME] => *
    [LASTNAME] => *
    [MIDDLENAME] => 
    [SALUTATION] => 
    [SUFFIX] => 
    [COUNTRYCODE] => *
    [STATE] => *
    [CITY] => *
    [STREET] => *
    [ZIP] => *
    [PHONENUM] => *
    [SHIPTOCOUNTRYCODE] => *
    [SHIPTOSTATE] => *
    [SHIPTOCITY] => *
    [SHIPTOSTREET] => *
    [SHIPTOZIP] => *
    [SHIPTOPHONENUM] => *
    [SHIPTOSTREET2] => 
    [STREET2] => 
    [SHIPTONAME] => *
    [ADDROVERRIDE] => 1
    [METHOD] => DoExpressCheckoutPayment
    [VERSION] => 72.0
    [USER] => ****
    [PWD] => ****
    [SIGNATURE] => ****
)

[response] => Array
(
    [TIMESTAMP] => 2013-03-07T15:01:45Z
    [CORRELATIONID] => 64adbc2375f59
    [ACK] => Failure
    [VERSION] => 72.0
    [BUILD] => 5331358
    [L_ERRORCODE0] => 10410
    [L_SHORTMESSAGE0] => Invalid token
    [L_LONGMESSAGE0] => Invalid token.
    [L_SEVERITYCODE0] => Error
)

问题是,在调用此方法之后,setExpressCheckout它被调用并且成功,因此正确放置了订单。

这是调用时的成功响应setExpressCheckout

[response] => Array
(
    [TOKEN] => EC-5UG654898R029060W
    [TIMESTAMP] => 2013-03-07T15:01:48Z
    [CORRELATIONID] => 348b58c6200c1
    [ACK] => Success
    [VERSION] => 72.0
    [BUILD] => 5331358
)

我不明白为什么在做 a 时doExpressCheckoutPayment会抛出失败,而在做时setExpressCheckout,没有检测到错误并且无论如何都接受了销售....

方法调用的顺序有问题吗?我的意思是,setExpressCheckout之前不应该被调用doExpressCheckoutPayment

我们正面临 PayPal 的另一个问题,我希望解决这个问题能够解决另一个问题....

非常感谢你们的帮助!

塞布

4

1 回答 1

3

SetExpressCheckout应该首先发生 - 您返回的令牌是您重定向客户浏览器的内容,当他们返回时,他们将在 URL 中拥有令牌,getExpressCheckoutDetails如果您需要查看他们的送货地址和关联的信息,最后你运行doExpressCheckoutPayment提交事务。

重申一下:您从 获得有效令牌,setEC在重定向中使用此令牌,将此令牌返回附加到RETURNURL客户返回的位置,并在任何后续getECdoEC调用中引用此令牌。

于 2013-03-07T16:22:07.937 回答