简体   繁体   English

贝宝交易已过期

[英]PayPal transaction has expired

I am using paypal rest API to process payments using paypal express checkout method in a java web application and currently application is point to paypal sandbox. 我正在使用Paypal Rest API在Java Web应用程序中使用Paypal Express Checkout方法处理付款,并且当前应用程序指向Paypal沙箱。 We were testing transactions without problem until recently but suddenly it is not working now, did not do any coding changes also, 直到最近我们一直在测试事务,但是现在突然不起作用了,也没有做任何编码更改,

now when redirect to paypal site for user approval, always getting a page saying, 现在,当重定向到贝宝网站进行用户批准时,总会显示一个页面,

This transaction has expired. Please return to the recipient's website  to complete your transaction using their regular checkout flow

We're sorry, but your session has ended. Your account hasn't been charged. Please go back to the merchant's site and check out again with PayPal.

I am getting redirect URL(approval URL) in java as bellow 我在波纹管中获取重定向URL(批准URL)

private String getApprovalURL(Payment payment)
        throws UnsupportedEncodingException {
    String redirectUrl = null;
    List<Links> links = payment.getLinks();     
    for (Links l : links) {
        if (l.getRel().equalsIgnoreCase("approval_url")) {
            redirectUrl = URLDecoder.decode(l.getHref(), "UTF-8");
            break;
        }
    }
    return redirectUrl;
}

and I am getting redirect URL similar to following, 并且我得到类似于以下内容的重定向URL,

https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-6U3345417C9052027

what could be the reason for this behavior? 这种行为的原因可能是什么? any suggestions? 有什么建议么?

Thanks. 谢谢。

We have encountered this issue as well. 我们也遇到了这个问题。 We resolved it by modifying the return url we received from paypal callback and explicitly add the sandbox to the url before redirecting it. 我们通过修改从Paypal回调中收到的返回网址来解决该问题,并在重定向之前将sandbox明确添加到了该网址。

Actual Url received: https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-6U3345417C9052027 收到的实际网址: https : //www.paypal.com/cgi-bin/webscr?cmd= _express-checkout &token=EC-6U3345417C9052027

Modified Url: https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-6U3345417C9052027 修改后的网址: https : //www.sandbox.paypal.com/cgi-bin/webscr? cmd = _express-checkout & token = EC- 6U3345417C9052027

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM