Help me forward IPN to external api
-
Hello,
I’m forwarding ipns received from paypal from my website to external invoicing service so invoices can be created automatically for every order.
I’m using this code:
add_action( ‘valid-paypal-standard-ipn-request’, function( $post ) {
wp_remote_post( ‘https://apiaddresshere’, array( ‘body’ => $post ) );
} );This works fine for regular orders. Invoices are created.
However it doesn’t work for subscriptions.
If I send the subscription ipn manually from my server with curl -v –data ‘ipnfrompaypalhere’ https://apiaddresshere.com it works! The invoice is created. So the problem is with the forward from my website not the api.
What I’m assuming is that with subscriptions some other function in woocommerce is fired instead of the one I’m using in the code above and therefore the ipn isn’t forwarded and invoice isn’t created.
Is there some different code I should use with subscriptions? Something like valid-paypal-subscription-ipn-request or something like that? I’m just guessing as I couldn’t find any info about that on the internet.
Please help me with the required code so the ipns are forwarded properly from my website for regular orders as well as for RECURRING orders.
I know this post is related to woocommerce subscriptions extension because without them you cannot sell recurring products in woocommerce however the help I’m seeking (I think) is related to what function is fired in woocommerce.
I’m not really a developer in any way so be gentle ??
Thanks,
Goran
- The topic ‘Help me forward IPN to external api’ is closed to new replies.