- 
      
- 
        Save JarrydLong/5a96584035b8b26812330ca214a82964 to your computer and use it in GitHub Desktop. 
    Post IPN data to multiple URLs example [Paid Memberships Pro]
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Forward IPN requests from WooCommerce PayPal Standard to also send to Paid Memberships Pro. | |
| * Please change the URL on line 9 to match that of your Paid Memberships Pro site URL. | |
| * Follow this guide to add this to your site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_forward_ipn() { | |
| if ( isset( $_REQUEST['callback'] && $_REQUEST['callback'] == 'gravityformspaypal' ) { | |
| $fp = wp_remote_post( 'https://saac-arts.org/wp-admin/admin-ajax.php?action=ipnhandler', $_POST ); | |
| } | |
| } | |
| add_action('wp_ajax_nopriv_ipnhandler', 'my_pmpro_forward_ipn', 5); | |
| add_action('wp_ajax_ipnhandler', 'my_pmpro_forward_ipn', 5); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment