繁体   English   中英

贝宝交易已过期

[英]PayPal transaction has expired

我正在使用Paypal Rest API在Java Web应用程序中使用Paypal Express Checkout方法处理付款,并且当前应用程序指向Paypal沙箱。 直到最近我们一直在测试事务,但是现在突然不起作用了,也没有做任何编码更改,

现在,当重定向到贝宝网站进行用户批准时,总会显示一个页面,

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.

我在波纹管中获取重定向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;
}

并且我得到类似于以下内容的重定向URL,

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

这种行为的原因可能是什么? 有什么建议么?

谢谢。

我们也遇到了这个问题。 我们通过修改从Paypal回调中收到的返回网址来解决该问题,并在重定向之前将sandbox明确添加到了该网址。

收到的实际网址: https : //www.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