Tag Archives: paypal

Paypal IPN: notification url in configuration page does not match url to which IPN notifications are sent to

When setting up a Paypal Instant Payment Notification listener, I ran into the following issue: I configured my sandbox account to direct IPN messages to a specific url, but when clicking on any IPN notification, I could see that it was sent to another url. After hours lost looking for the solution, I finally found out the reason. In my paypal submit form, I had added a hidden field named “notify_url” with a given value. As explained in paypal doc, this takes precedence over the configuration set at account level. Removing this hidden field solved my issue. All IPN messages […]

Paypal IPN listener with Zend Framework

Below is a fully working code for creating a Paypal Instant Payment Notification listerner using Zend Framework: /** * Handle paypal response and return true if ok * * @return bool */ function isPaypalIPNMsgValid() { $client = new Zend_Http_Client(PAYPAL_IPN_URL, array( ‘maxredirects’ => 0, ‘timeout’      => 250, ‘rfc3986_strict’ => false)); //not rfc3986_strict necessary to be replicate with paypal input message global $data; $data[‘cmd’] = ‘_notify-validate’; foreach ($_POST as $key => $value) { // ‘cmd’ arg must be first => we add other POST entries after it $data[$key] = $value; } $client->setParameterPost($data); $response = $client->request(‘POST’); // query paypal for transaction informations if […]

paypal ipn: wrong txn_type (transaction_type)

When you test your Instant Payment Notification (IPN) listener using paypal IPN test tool (https://developer.paypal.com/us/cgi-bin/devscr), make sure to check the value of the txn_type field and update it to the value you want. When changing global dropdown value, I found out that this field was NOT always updated (hence the manual update). It takes the appropriate value on first page load, but not when changing the select field. sources https://developer.paypal.com/us/cgi-bin/devscr?cmd=_ipn-link-session