Paypal:仅在DoExpressCheckoutPayment方法中使用无效令牌

时间:2013-03-07 15:24:26

标签: paypal express token checkout

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

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

这是调用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
)

我不明白为什么在执行doExpressCheckoutPayment时会抛出故障,而在执行setExpressCheckout时,没有检测到错误,并且无论如何都会接受销售....

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

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

非常感谢你的帮助!

的Seb

1 个答案:

答案 0 :(得分:3)

首先应该发生SetExpressCheckout - 您获得的令牌是您重定向客户浏览器的内容,当他们返回时,他们将在URL中拥有令牌,那时您可以{{1如果您需要查看他们的送货地址和相关信息,最后运行getExpressCheckoutDetails来提交交易。

重申:您从doExpressCheckoutPayment获得了有效令牌,您在重定向中使用此令牌,您将此令牌附加到客户返回的setEC,并引用此令牌在随后的RETURNURLgetEC来电中。