PayPal Generate Key

Hi, I use PayPal for a long time for my DonationWares (no change if the user pay or not). One month ago I made 2 of them Sharewares (remind annoying window which appears every x seconds).
I made my own Xojo App to list all the persons who pay and it generate and send email to say “Thank you …” and the serial key for the ShareWares. But I’m not always at home.
I searched on PayPal forum but I didn’t find my answer.
How to make PayPal send and email with the name of the person and the key generated from his name ?
My generator is simple. I take the ASCII code of the first letter of the name, add or subtract an ASCII code from the first letter of another string Key, and I generate 2 letters from this number, and so on for the 2th letter.

If you can make a web-based app to generate the keys, you might want to consider E-Junkie … they integrate with Paypal easily, allow up to 10 products for $5 per month, and can call your app to get the serials

https://www.e-junkie.com/wiki/help-keygen

I have used them in another way, supplying a unique serial number from a list, rather than generated from the user name.

But they are ‘awake’ when you are asleep. And they email you with what they told the customer,.

I have two solutions for this:

  1. On one of my Macs, which is always on (a cheap Mac Mini), I run Mail.app and have an AppleScript that checks for Msgs from Paypal, and then sends out a reply.

I made a Xojo app that has to run on a server that always is reachable (you could even just keep it running on your home computer if you open a port for that app).

It uses Paypal’s “IPN” system, which sends a URL request to an address that you set up at Paypal for that. It contains all the purchase info, including customer email. The Xojo app will then receive these calls and can act on it. You still need a way to send the email out, e.g. by scripting Mail.app or use the low level “sendmail” command.

If you want to go either route, send me an email to my last name at gmail.com

I would recommend to setup the Paypal PHP SDK on your website
https://github.com/paypal/PayPal-PHP-SDK

There you can have a script, which is triggered for a sale and you can add your lines there to do whatever you need.
e.g. to send yourself an email, put entry in a database or trigger a Xojo web app.

newer link here:
https://github.com/paypal/Checkout-PHP-SDK

I use a Xojo Web app as listener for Instant Payment Notification.

That way I can provide buyers with instructions for download sent by email immediately.

You could do the same.

https://developer.paypal.com/docs/api-basics/notifications/ipn/

That said, if you are familiar with Php (or diverse languages but Xojo), you will find IPN code samples here:
https://github.com/paypal/ipn-code-samples

The Php example is fairly easy to customize, and it has the advantage of working on most hosts, when Xojo Web app usually require a VPS minimum.

There’s no need for a Xojo Web license for this. You can install an http socket just as well with a regular Desktop app. The only functional difference is that a Desktop app’s http socket runs synchronously on the main thread, i.e. you cannot process long-taking requests in multiple threads. But that’s not an issue for handling IPNs.

Good idea. Another issue with regular hosts is that a Linux Desktop app may not run, because most regular hosting services don’t install the GUI. Perhaps a windowless desktop app would do, but I never tested.

Ideally, a Linux console app would do, but that is an additional license if you don’t have the Pro license.

Another issue with shared hosting is that very seldom would you have access to the command line to launch the app.

If you have access to crontab, that is a nice way to run the Xojo app.

FYI, what I’ve done:

I got myself a true root server with Linux on it (45€/month), then installed VMware Workstation (one-time fee of $150) on it, and then run a macOS VM from that. So I now have a fairly fast macOS system running connected to a fast internet backbone :slight_smile:

Not the cheapest solution, but the coolest :smiley:

A cheaper way could be accomplished with a virtual root server, as provided by DigitalOcean. That worked as well with a macOS VM under VMware Workstation, but the performance wasn’t so great.

Each of us have a different culture.

My first Paypal IPN listener was based on the sample code I linked to, in Php. It ran just fine on a shared hosting. The Php page was run whenever Paypal tapped into it. Almost as simple as an html page.

That Php page executed without need for any emulation on a plain vanilla Linux host.

A couple years ago or so, I realized that I had been developing quite a bit in Xojo Web, and it made sense to use a Xojo Web program as listener.

I already had several programs running on now ServerWarp, which is a Linux host, and that made sense to use a cgi, so like the php, it could be called very simply by Paypal IPN server.

Altogether, I went with the KISS principle.

Note that I am quite comfortable with Linux, which after all is not necessarily the case for everybody.

A Mac version could very well be based on a real Mac with Web sharing, as long as you have a permanent Internet connection. Unless you have thousands of transactions an hour, the load is pretty light.

Thank you all, I will try to understand the links you gave me. I modified very small PHP script I found on the web as example just to see how it works.