Php paypal ipn

Can I run a php ipn listener on xojo cloud? The idea is to capture information and automatically set up a new user. New users expect automatic setup.

I’ve had the php ipn listener work in the past on other servers . . .

Xojo Cloud does not have PHP on it, but there’s no reason that you couldn’t just implement the necessary commands using App.HandleURL.

2 Likes

Really struggling to find documentation . . .

Dumb questions:

I need something to be listening for a paypal ipn . . . In xojo cloud, what is it? How do I start it and stop it?

As I said I got this to work in php on another server.

I’ve got to get this working because clients are expecting to be able to login in right after paying for their subscription.

As I said, the thing that is listening is your app. You’ll use the App.HandleURL event for that and it’ll do all of the work of translating the http request into something that you can work on. For the callback that you need to do, you should use an async URLConnection.

1 Like

There is very little documentation for URLconnection. Trying to follow the Paul Lefebvre video (https://www.youtube.com/watch?v=adba6dvhdPY). I put handleURL in the “app” with the programming to return the message from paypal ipn to paypal but am getting errors:

Handling the paypal ipn seems simple, but I can’t find how to communicate with paypal. I had this working in php.

Any suggestions? Documentation?

Looks like you will need to create an instance of payPalConnection class:

Var pp as new payPalConnection

pp.setRequestContent(...)
pp.send("POST", paypalURL, 30)

thanks . . . Silly mistake.

Now I’ve got figure out how to get the verification response back from paypal.

There’s got to be better documentation on URLconnection somewhere . . .

I’d offer my professional services, but I’ve been sick for most of March. Integrating with APIs is one of my areas of focus for Xojo consulting.

Thanks. I get a feeling your fee would as much as my revenue for a year. Unfortunately my potential customer base is small. I don’t write my software for money, but for pride . . . It’s been used by Team USA at the Olympics.

I figured this out in php long ago. The problem I’m having the communication. I just need a bit of information:

I get the initial ipn message from paypal using HandleURL. How do I identify it as a paypal ipn? (not sure if you know this one)

Where is the message in the request . . . request.body?

I need to send the message back (plus a bit more) . . . Thru URLconnection.sed or is it somehow in the HandleURL.response?

Then I need to receive paypal’s one word verification message. Is this thru the same HandleURL or something else?

If I can send ipn message back to paypal and get the verification message back, i’ll be set.

Thanks again for your time,

You tell PayPal what the IPN address is. Your web app should check the request path to know how to handle the request.

You would employ a URLConnection.

It would be a response to the URLConnection you sent the verification with.

You need to use the URLConnection asynchronously. PayPal expects a 200 when they send you the initial notification, and since you’re just receiving this you can respond right away.

Thanks as always from an amateur.

When I send a test IPN thru ipn simulator it says ‘IPN was sent and the handshake was verified.’

I’m having trouble capturing the ‘verified’ message. Do I use the same handleURL and what am I looking for a responseHeader? a body? a path?

I understand the paypal side . . . It’s the Xojo side I’d like to find better documentation on.

If I can get the basics I’ll give it away . . .

Tim already gave you good pointers to get you going, I guess.

I confirm.

https://developer.paypal.com/api/nvp-soap/ipn/ht-ipn/

I thought I’d take a stab at this, but ended up down a rabbit hole discovering that the IPN Simulator is no longer supported and currently broken (it only offered me 3 eCheck states). I couldn’t determine if this means anything for the future of IPN, but I digress.

Verifying a Webhook message from PayPal seems a bit more complicated though still doable, but that seemed like a whole different rabbit hole. I don’t currently have a need for PayPal processing, so I can’t justify spending more time on this.

Thanks . . . I understand the PayPal side. It’s the Xojo side that I’m struggling with. I’ve got the handleURL working and I think I’m returning the information correctly through URLconnection.

What I’m not understanding is getting the verification back from PayPal. Is it some kind of response from the URLconnection.send, using the same handleURL? etc . . .

You should emulate the php code.

Another way would be to get an inexpensive web host to run the php code.

hostgator.com or namecheap.com offer shared hosting for less than $3.00 a month.