• Hi

    I have used this plugin to run some codes after receiving IPN,
    I have used this code with many hooks, and tried sandbox and live but the code is not running !

    function update_wc_order_status($posted) {
    if($posted[‘IPN_status’] == 1){
    echo ‘test’;
    global $wpdb , $user_ID;
    $invoice_id = $posted[‘invoice’];
    $payment_details = ‘json_encode( $p );’;
    $wpdb->query(
    $wpdb->prepare(“UPDATE “.$wpdb->prefix.”utc_invoicesSET details=%s WHERE invoice_id = %d”,
    $payment_details,$invoice_id)
    );

    update_user_meta($user_ID , ‘user_credit’ , $total);
    }
    }

    add_action(‘paypal_ipn_for_wordpress_ipn_response_handler’, ‘update_wc_order_status’, 10, 1);

    I used these hooks

    paypal_ipn_for_wordpress_ipn_response_handler

    paypal_ipn_for_wordpress_ipn_response_verified

    paypal_ipn_for_wordpress_payment_status_completed

    can you help me please !

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @elham94,

    Thanks for writing us here. We are looking into this and will get back to you as quickly as we can.

    Thanks!

    Hi There,

    I’m not sure what you are trying to achieve here. But after having our developer to look at your code. They suggested to use this code https://pastebin.com/jRXS5K6s and amend as per your need. But the format should be the same.

    Let me know if you have any other questions or concerns.
    Thanks!

    Thread Starter elham94

    (@elham94)

    Hi Oliver, thank you for your response.

    I’m sorry for bothering you, it was an error in my code

    all work fine now.

    Thank you so much.

    I’m glad to hear things are working well for you now! As such, I am going to close this ticket now, but please feel free to respond here again or create a new ticket if you have any more questions or concerns.

    Also, we would love to know what you think of our product and customer support. If you have a moment to [ leave a review ] it would be greatly appreciated..

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The code in the hook is not running’ is closed to new replies.