Search

Language:  
Search for:

Available article translations:

How to set up PayPal payment gateway to receive IPN messages from PayPal system

Article ID: 112756, created on Nov 8, 2011, last review on May 11, 2014

APPLIES TO:
  • Plesk 10.4 for Linux/Unix
  • Plesk 10.3 for Linux/Unix
  • Plesk 10.4 for Windows
  • Plesk 10.3 for Windows

Symptoms

The PayPal payment processing system can send IPN messages only to standard HTTP (80) or HTTPS (443) ports. However the Customer & Business Manager component receives the same messages using only custom ports - 8880 for HTTP, 8443 for HTTPS. To forward PayPal notifications from standard ports to custom, you should add a proxying script to a publicly available website and specify the path to this script in the PayPal plugin settings.
 
We assume that you run Customer & Business Manager at mycompany.com:8443 and do not yet have the mycompany.com site. If this is the case, add a webspace and create the mycompany.com domain under it. If you already have the site, skip this preparatory step.

Resolution

1. Open the document root of mycompany.com. You can do so either by File Manager, FTP, SSH, or other ways.
2. In the directory, create a PHP file (i.e. paypalipn.php) with the following content:
<?php

$url = 'https://mycompany.com:8443/plesk-billing/gw/paypal.php';
$fields = $_POST;
if (count($fields) > 0) {
//url-ify the data for the POST
foreach ( $fields as $key => $value ) {
$fields_string .= $key . '=' . $value . '&';
}
rtrim ( $fields_string, '&' );

//open connection
$ch = curl_init ();

//set the url, number of POST vars, POST data
curl_setopt ( $ch, CURLOPT_URL, $url );
curl_setopt ( $ch, CURLOPT_POST, count ( $fields ) );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $fields_string );
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, FALSE );
curl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, FALSE );

//execute post
$result = curl_exec ( $ch );
//close connection
curl_close ( $ch );
}
?>
3. Make sure that this file is accessible at http://mycompany.com/paypalipn.php or https://mycompany.com/paypalipn.php.
4. Open the PayPal payment gateway configuration page (All Settings > Payment Gateways > PayPal) in Customer & Business Manager and set the IPN URL to http://mycompany.com/paypalipn.php or https://mycompany.com/paypalipn.php.

Troubleshooting

If the IPN messages are not received check check that PayPal site with paypalipn.php is resolved, available and executable via target URL (like http://mycompany.com/paypalipn.php and https://mycompany.com/paypalipn.php).




ff5a00b8ead2e480367b019417a04207 a914db3fdc7a53ddcfd1b2db8f5a1b9c 85a92ca67f2200d36506862eaa6ed6b8 c796c01d6951fa24ed54c7f1111667c6 f2d85fccc955a226f0b30e58456170cb e8756e9388aeca36710ac39e739b2b37 29d1e90fd304f01e6420fbe60f66f838 dd0611b6086474193d9bf78e2b293040 f4ce8084cb23619ef5fe9428ecc388ea 56797cefb1efc9130f7c48a7d1db0f0c

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No
 
 
 
 
 
 
Server Virtualization
- Odin Cloud Server
- Odin Containers for Windows 6.0
- Odin Virtuozzo Containers
Automation
- Odin Automation
- Odin Automation for Cloud Infrastructure
- Odin Business Automation Standard
- Odin Virtual Automation
- Odin Plesk Panel Suite
- Web Presence Builder
- Odin Plesk Automation
- Odin Small Business Panel
- Value-added Services for Hosters
- Odin Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification