Interfacing with PayPal

The Activation Server provides an interface called PayPal KeyGen for integration with the PayPal payment gateway service. This enables you to automate the whole process of selling and licensing software, including accepting a payment, updating customer records, generating an Activation Key, and sending an order confirmation email. The PayPal KeyGen is available in the following directory:




The PayPal KeyGen is compatible with the PayPal IPN protocol and messages. PayPal IPN (Instant Payment Notification) is a message service that basically sends out a notification when your PayPal account receives a payment. When the PayPal KeyGen receives an IPN message, it automatically performs the tasks to fulfill the received order, which include the following:


         Identify the purchased product that matches the product ID received from PayPal. In the provided Activation Server, the EcommerceProdID2 field in the Products table is assigned to interface with PayPal.

         Create an activation account (including Activation Key) for the purchased product in the Activation Server.

         Update the ecommerce and customer information to the activation account such as seller, purchase ID, purchase date, name, company, email, address, etc.

         Send an order confirmation email containing the Activation Key to the customer.

In terms of security, the PayPal KeyGen uses the postback method to verify the IPN message if it indeed comes from PayPal. The method works as follows:


         When receiving an IPN message, the PayPal KeyGen sends the complete unaltered message back to PayPal.

         PayPal verifies the postback message and replies a single word back, which is either VERIFIED or INVALID.

You can test the integration with PayPal by using the PayPal Sandbox, which is a testing environment provided by PayPal. You can find more information and sign up for an account at


See Also

         Configuring Activation Server for PayPal KeyGen

         Order Confirmation Email Template

         Testing PayPal KeyGen

         PayPal Purchase Button

         Product Upgrade Purchase