简体   繁体   中英

Session is destroyed after return from paypal

我已经将Paypal定期订阅与我的网站集成在一起。成功交易后,我设置了返回URL。但是,一旦我从Paypal重定向,我的会话值就被销毁了,并且该页面上也没有返回任何内容。响应(交易ID,状态等)。任何人都可以指示我解决此问题。

Check that your response is coming back to the correct URL.
On some servers, www.site.com is considered different (session-wise) from site.com

With PayPal you have to set up something separate to listen out for an HTTP request from PayPal - the data you need doesn't get returned when PayPal send the customer back to the return URL. You have to set a notify URL, which is entirely separate from the return URL.

I recently used PayPal with the CodeIgniter framework and I set up a controller that is dedicated to listening out for PayPal. In the submission form, I defined a parameter for the form that contains the customer's ID as well as some other details needed, and PayPal include this when they make an HTTP request to the notify URL I specified. Then, when my controller that listens out for PayPal receives a request, it sends it back to PayPal via POST to acknowledge it to them.

The PayPal documentation isn't that great IMHO, especially when it comes to recurring subscriptions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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