Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor angelleye

    (@angelleye)

    Within your hook functions you can use $posted[‘payment_status’] which will have the value “Completed” when the payment is indeed completed.

    Thread Starter chrissi_lisa

    (@chrissi_lisa)

    What do you mean with hook-functions?

    Regularly I use the plugin “Quick Paypal Payments” here I can set a listenerskript in the IPN-option, f.e. “listener.php”. Here I have to use $posted[‘payment_status’] ?

    Thread Starter chrissi_lisa

    (@chrissi_lisa)

    This is my lister:

    global $theme;

    include (“wp-config.php”);
    get_header();

    if($posted[‘payment_status’]==’completed’){

    $unique_id = $_SESSION[‘unique_id’];

    $abfrage = “UPDATE eigene_angebote SET bezahlt = 1, bezahlt_am = NOW()
    WHERE unique_id='”.$unique_id.”‘”;

    $result=$wpdb->get_results($abfrage, ARRAY_A);

    }

    But even if the payment was successful, there is no UPDATE … Where is the mistake?

    BR
    chrissi_lisa

    Plugin Contributor angelleye

    (@angelleye)

    @chrissi_lisa,

    Our plugin provides the IPN listener for you, and then it provides hooks that allow you to trigger your own functions when different IPN events occur. $posted is only going to be available within that.

    So it sounds like what you want to do is set the IPN URL that our plugin provides as the IPN listener in your PayPal payment plugin. You should also set that same URL in your PayPal account profile just to act as a catch-all.

    That way IPNs will be sent through our listener, and you can use our hooks to build your code accordingly. Our Developer Guide walks you through this procedure, and there’s a link to our Hooks Guide at the bottom of that.

    Let me know if you have any specific questions about any of that. Hope it helps!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘distinguish wether a payment was successful or not in PHP-Skript’ is closed to new replies.