Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created April 3, 2020 06:36
Show Gist options
  • Save andrewlimaza/b77d7454c56a3ca5eb256af9061b8c4b to your computer and use it in GitHub Desktop.
Save andrewlimaza/b77d7454c56a3ca5eb256af9061b8c4b to your computer and use it in GitHub Desktop.
Redirect WooCommerce PayPal Standard To PMPro IPN Handler.
<?php
// Redirect WooCommerce IPN Requests to PMPro IPN as well.
function my_ipn_redirect() {
if ( ! empty( $_REQUEST['wc-api'] ) && defined( 'PMPRO_DIR' ) ) {
require_once( PMPRO_DIR . "/services/ipnhandler.php" );
exit;
}
}
add_action('init', 'my_ipn_redirect');
@ideadude
Copy link

If you are using WooCommerce and PMPro. You can set the IPN URL in PayPal to the WooCommerce URL and then install this code to make sure PMPro processes IPN requests as well.

@laurenhagan0306
Copy link

This recipe is included in the blog post on "Redirect the PayPal IPN for PMPro to WooCommerce" at Paid Memberships Pro here: https://www.paidmembershipspro.com/redirect-the-paypal-ipn-for-pmpro-to-woocommerce/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment