KaChingPal - How to set up PayPal IPN

KaChingPal uses the PayPal Instant Payment Notification system (IPN).

To set this up, log into your PayPal account and select Profile, then select My selling tools. Click on the Update link next to the Instant Payment Notifications section.

Once in the IPN Preferences page, click the Edit Settings button.

In the Edit Settings screen, enter the address http://kachingpal.com/ipn.php as the Notification URL and make sure that the Receive IPN messages button is activated.

Finally, click the Save button and you are done.


NOTE: If you are already using the IPN notification service for your own e-Commerce website, you can get your site to forward the request on to kachingpal after it has processed it. You first need to go to the My Account page and set up a secret word on your account to prevent unauthorized access and then add some code to your e-Commerce site to make a web request to http://kachingpal.com/pay.php. Here is some example PHP code to do that:

function kachingpal($email, $secret, $currency, $amount)
{
        $host = 'kachingpal.com';
        $uri = '/pay.php?email='. urlencode($email)
              .'&secret='. urlencode($secret)
              .'¤cy='. urlencode($currency)
              ."&amount=$amount";
        $request = "GET $uri HTTP/1.1\r\n"
                  ."Host: $host\r\n"
                  ."Connection: close\r\n"
                  ."\r\n";

        $address = gethostbyname($host);
        $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
        socket_connect($socket, $address, 80);
        socket_write($socket, $request, strlen($request));
        socket_read($socket, 1024);
        socket_close($socket);
}