Looking for some guidance web sessions and how to access a specific session in a HandleSpecialURL event.
Currently trying to Implement PayPal and as a test, I would like to view the “Data” PayPal sends in my current session.
Do all sessions have ID’s by default or should I assign them manually?
In Other words:
How to tell that specific session that the payment was successful?
Let me know if my question makes no sense
You could try passing the session.identifier in the paypal api call so that it returns in the response picked up by the api handler, then just loop through app.sessions to find the correct session and send them to the appropriate page.
You could also record session.identifiers in an app-level dictionary to help identify which database they connected to or other info not exposed by the session (but could be a property of a session - maybe the user’s email address, all kinds of stuff., or the payment_id)
Hope that helps
@Matthew Gardner, @Michel Bujardet Thanks But I’m starting to think that I might be over complicating things and that my idea might not be the best way to go about doing this.
I’m extremely new to xojo and have only worked with TCP Sockets and coded a basic Profit Calculator -_- , to be honest, I have no idea what I’m doing atm.
What if managed to do so far:
When I use the IPN Simulator Paypal provides, the handshake is successful and the Handle special URL gets triggered.
I believe the request PayPal send contains a bunch of headers that provides all the info inc. if the payment was successful r not.
and just as a test I what to output all the info in the client’s session within a TextArea, but if I attempt this I get “Warning: No Session object in context” and that led me to the understanding that I must specify a session to send this to.
At the end of the day, I only want to be able to know if the payment was successful so that my TCPSocket can send a request to my server.
and please let me know if I’m understanding the process incorrectly
May have to change the subject of this thread.
@Michel Bujardet Thanks, took me a few days but I’m slowly starting to get it, hope you don’t mind me asking but, the post back code you shared … is it really necessary to convert it that many times? PayPal posts URL-encoded values, can’t one just set the mySocket.SetRequestContent to Request.Entity and send it off for verification?
Andre, that was a while ago. I don’t really remember why I proceeded that way. What I know is that you have to send back with http1.1. I have been using that listener unchanged since then.