Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Not getting entry to POST IPN to a 3rd Party Application
- This topic has 4 replies, 2 voices, and was last updated 5 years, 8 months ago by admin.
-
AuthorPosts
-
March 26, 2019 at 6:16 am #15366adminwvgsSpectator
I need to do some processing of membership payments made through the eStore. I turned on the IPN Post URL but cannot get an entry to that url when I make a payment using the PayPal Sandbox. The URL I used has been tested and it currently just writes the IPN post data to a database table for testing. Is there something else I must setup to get the POST IPN to a 3rd Party Application to work? This is difficult for you to reproduce because it has nothing to do with the front end of the site.
I could also do this using a hook that I found a few weeks ago, but I can’t find that hook now. I can only find:
add_action(‘eStore_paypal_recurring_payment_received’, ‘my_custom_payment_tweak’, 10, 2);
function my_custom_payment_tweak($ipn_data, $cart_items)
{
//Do something here
}But this is not a recurring payment.
March 26, 2019 at 6:47 am #79392adminKeymasterYou only need to specify the URL where you want the IPN to be forwarded. It sends the IPN there. It is likely a firewall is blocking that post.
You can use the following action hook. It gets triggered after a payment is processed and added to the database:
eStore_product_database_updated_after_payment
Example code below:
add_action(‘eStore_product_database_updated_after_payment’, ‘my_custom_payment_tweak’, 10, 2);
function my_custom_payment_tweak($ipn_data, $cart_items)
{
//Do something here
}
March 26, 2019 at 8:43 pm #79393adminwvgsSpectatorI assume eStore is completely done when this hook is called. Is that correct? If so I assume no return needed from the call to the payment tweak function?
Is this hook:
add_action('eStore_paypal_payment_received', 'paypal_payment_received', 10, 2);
function my_custom_payment_tweak($ipn_data, $cart_items)
{
//Do something here
}equivalent except the eStore product update may not be complete?
March 27, 2019 at 1:23 am #79394adminwvgsSpectatorI put the recommended hook and function in my child theme functions.php file. The function is still not being called. This is a purchase of a membership renewal. Here is the simple addition:
add_action('eStore_product_database_updated_after_payment', 'after_payment_tweak', 10, 2);
function after_payment_tweak($ipn_data, $cart_items) {
$ipn = print_r($ipn_data, true);
$cart = print_r($cart_items, true);
$data = $ipn . "n" . $cart;
global $wpdb;
$table = $wpdb->prefix . 'test';
$row = [ 'data' => $data];
$res = $wpdb->insert( $table, $row );
}Here is the relevant IPN log entry, so the payment was made:
[deleted log after checking]
March 27, 2019 at 6:52 am #79395adminKeymasterTroubleshooting custom code is beyond the scope of this support forum. You need to use the following option so a developer can go through your custom code and see what is going on:
-
AuthorPosts
- You must be logged in to reply to this topic.