Paypal:仅在DoExpressCheckoutPayment方法中无效的令牌 [英] Paypal : invalid token only in DoExpressCheckoutPayment method

查看:314
本文介绍了Paypal:仅在DoExpressCheckoutPayment方法中无效的令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm starting to work with PayPal and my first work is to debug it on our website.

实际上,当我们执行订单结束时,它可以正常工作,但是我们在日志中得到了堆栈:"Invalid token (#10410: Invalid Token)". 调用doExpressCheckoutPayment时会发生这种情况,并且似乎没有令牌也没有付款人,因此会引发错误.所有其他信息似乎都已正确填写.

Actually when we go to the end of an order, it works fine but we get a stack in the logs : "Invalid token (#10410: Invalid Token)". This happens when the doExpressCheckoutPayment is called and it seems like there's no token and no payerid so an error is thrown. All other information seem to be correctly filled.

这是调用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,并且成功完成了,因此正确放置了订单.

Problem is that just after this method is called, setExpressCheckout is called and it's a success so the order is correctly placed.

这是调用setExpressCheckout时的成功响应:

Here's the success response when calling setExpressCheckout :

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

我不明白为什么在执行doExpressCheckoutPayment时会引发故障,而在执行setExpressCheckout时却未检测到错误并且反而接受了销售....

I don't understand why when doing a doExpressCheckoutPayment, a failure is thrown and when doing setExpressCheckout, no error is detected and the sale is accepted anyway....

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

Is there a problem in the order of the method call ? I mean, should setExpressCheckout not be called before doExpressCheckoutPayment ?

我们在使用贝宝(PayPal)时遇到了另一个问题,我希望解决该问题可以解决另一个问题....

We're facing an other problem with PayPal and I hope that solving this problem will solve the other one....

非常感谢您的帮助!

Seb

推荐答案

The SetExpressCheckout should happen first -- the token you get back is what you redirect the customer's browser with, and when they return they'll have the token in the URL and that is when you can getExpressCheckoutDetails if you need to see their shipping address and associated info, and finally you run doExpressCheckoutPayment to commit the transactions.

要重申:您从setEC获取了有效令牌,在重定向中使用了此令牌,将该令牌重新附加到了客户返回的RETURNURL上,并在随后的任何getECdoEC调用.

To reiterate: You get a valid token from the setEC, you use this token in the redirect, you get this token back appended to the RETURNURL the customer returns to, and you reference this token in any subsequent getEC and doEC calls.

这篇关于Paypal:仅在DoExpressCheckoutPayment方法中无效的令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆