Chapter 7
253
credentials are set up on the Payment Processor tab of the Bank window. Currently, the API
signature is hardcoded in the code, which I expect it will be replaced with the usage of the API
certicate le in the live environment.
There's more...
PayPal provides other APIs to capture a payment, authorize a payment, and so on, which can
be used to support the different transaction types listed by ADempiere.
Integrating PayPal Instant Payment
Notication (IPN)
If you are interested in receiving asynchronous notication from PayPal about the payments
made to a PayPal account, then this recipe intends to cover that. This is a very useful feature
provided by PayPal to integrate and automate our back-ofce operation (for example, initiate
shipping as soon as the payment is conrmed).
Getting ready
Make sure your machine is accessible on the internet, as it is a must to implement IPN.
How to do it...
1. Install XAMPP, which provides the Apache Web server, on the machine. You may refer
to Chapter 5, VirtueMart Integration, for the steps. Say, we have installed the XAMPP
in c:\xampp
2. Create an IPN listener by referring to PayPal's IPN guide: https://cms.paypal.
com/cms_content/US/en_US/files/developer/IPNGuide.pdf.
This guide provides a PHP implementation of the listener, which you can use to follow
this recipe. Say, we have named the listener IPNListener.php.
3. Keep the IPNListener.php in your Web server folder, which is accessible, say,
in c:\xampp\htdocs. In this case, the URL that we will use with PayPal will be
http://<your host address>/IPNListener.php.
4. On the PayPal Sandbox page, select the Website Payments Pro account and go to
the My Account | Prole page of the same.
5. Click on the Instant Payment Notication preferences link under the Selling
preferences section.
6. Click on Choose IPN Settings and enter the URL of your IPN listener and select the
Receive IPN messages radio before saving the setting.
Down l o a d f r o m Wow ! e B o o k < www. w o w e b o o k . com>