From 5c699e27bd4fb2d92dab15898e3a512ac96d7c3e Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 11 Mar 2013 10:23:14 +0000 Subject: [PATCH] Legacy IPN handler. #2665 --- readme.txt | 1 + woocommerce-functions.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/readme.txt b/readme.txt index 905b3b910db..419a320f8a0 100644 --- a/readme.txt +++ b/readme.txt @@ -184,6 +184,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Fix - Mijireh Page Slurp. * Fix - Removed unused 'woocommerce_prepend_shop_page_to_urls' setting from breadcrumbs. * Fix - hide_cart_widget_if_empty option. +* Fix - Added legacy paypal IPN handling. * Localization - Finnish translation by Arhi Paivarinta. = 2.0.2 - 06/03/2013 = diff --git a/woocommerce-functions.php b/woocommerce-functions.php index 8eb4bfa4692..d5d2f00b666 100644 --- a/woocommerce-functions.php +++ b/woocommerce-functions.php @@ -10,6 +10,24 @@ * @version 1.6.4 */ +/** + * Handle IPN requests for the legacy paypal gateway by calling gateways manually if needed. + * + * @access public + * @return void + */ +function woocommerce_legacy_paypal_ipn() { + if ( ! empty( $_GET['paypalListener'] ) && $_GET['paypalListener'] == 'paypal_standard_IPN' ) { + global $woocommerce; + + $woocommerce->payment_gateways(); + + do_action( 'woocommerce_api_wc_gateway_paypal' ); + } +} + +add_action( 'init', 'woocommerce_legacy_paypal_ipn' ); + /** * Handle redirects before content is output - hooked into template_redirect so is_page works. *