Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter drmarvin2k5

    (@drmarvin2k5)

    One last thing, and I know it’s not directly related to your plugin, but I’m curious if you happen to know if and how to access $_SESSION variables from within an action.

    Thanks for any help

    Thread Starter drmarvin2k5

    (@drmarvin2k5)

    That is excellent. Apparently I have been accessing DBs in WP the hard way. I may have to redo a few things. Otherwise, I got it to work. I thoroughly appreciate your help. Thanks so much!!!

    Thread Starter drmarvin2k5

    (@drmarvin2k5)

    Trying it agin, I must still be missing something. I have added the following under the variables within the action (in functions.php)

    $servername = “localhost”;
    $username = “user”;
    $password = “password”;
    $dbname = “dbmame”;
    // Create connection
    $conn = mysqli_connect($servername, $username, $password, $dbname);
    // Check connection
    if (!$conn) {
    die(“Connection failed: ” . mysqli_connect_error());
    }
    $updateipn = “INSERT INTO pbs_ipndata (txn_id, txn_status)
    VALUES (‘$txn_id’,’$IPN_status’)”;

    mysqli_query($conn, $updateipn);

    With actually connection info, obviously. Nothing seems to go into the database. Thoughts?

    Thanks

    Thread Starter drmarvin2k5

    (@drmarvin2k5)

    Actually, I have not had a chance to try it. If I understand correctly, I should setup my SQL insert inside the action in the functions.php. Is this correct?

    Thread Starter drmarvin2k5

    (@drmarvin2k5)

    Hi again

    To clarify, I have placed the following into the functions.php

    add_action(‘paypal_ipn_for_wordpress_payment_status_completed’, ‘process_completed_payment_ipn’, 10, 1);
    function process_completed_payment_ipn($posted)
    {
    $mc_gross = isset($posted[‘mc_gross’]) ? $posted[‘mc_gross’] : ”;

    }

    etc

    Then, when I successfully complete a transaction and the information ends up in the IPN plugin form. Then, variables such as “$mc_gross” should just be available globally, or only in a specific spot or page?

    Thread Starter drmarvin2k5

    (@drmarvin2k5)

    That makes sense. I was just testing the “echo” so I could see if I was getting any values. I’m just not sure how to call things (ie. the hook) to be able to access things such as

    $mc_fee = isset($posted[‘mc_fee’]) ? $posted[‘mc_fee’] : ”;
    $address_country_code = isset($posted[‘address_country_code’]) ? $posted[‘address_country_code’] : ”;
    $address_name = isset($posted[‘address_name’]) ? $posted[‘address_name’] : ”;
    $notify_version = isset($posted[‘notify_version’]) ? $posted[‘notify_version’] : ”;

    so I can add them to my MYSQL INSERT statements

    Thanks in advance

    Thread Starter drmarvin2k5

    (@drmarvin2k5)

    Sorry again.

    Now to set it up on the page, is this correct?

    paypal_ipn_for_wordpress_payment_status_completed();

    Then I should be able to access something like $txn_id?

    In theory, I could
    $_SESSION[“txn_id”]=$txn_id;
    Then access the info on my next page?

    I think that whatever I’m doing, I’m doing it wrong, since I can’t echo the result. All your help is greatly appreciated.

    Thread Starter drmarvin2k5

    (@drmarvin2k5)

    I see. It had not clicked that the actions were already set up. I thought you needed a custom name. That makes more sense. I found the list of all the actions on your site, too, so I will work with it.

    Thanks so much for the input.

    Cheers

    Thread Starter drmarvin2k5

    (@drmarvin2k5)

    Hi there. Basically, I have a single SKU that I will be selling (software) with a registration form that gets entered into my database after purchase, and then a serial number and download link are assigned to the customer. I was hoping to use IPN to give me the following PayPal fields:

    IPN Variables
    $payment_type
    $payment_date
    $payment_status
    $payer_email
    $payer_id
    $receiver_email
    $receiver_id
    $mc_currency
    $mc_fee
    $mc_gross
    $mc_gross1
    $txn_type
    $txn_id
    $notify_version
    $invoice
    $verify_sign
    $IPN_status

    Which could also be entered into my DB after the purchase has been verified. All the DB stuff for registration is functional, and my email to the customer. I am able to review the IPN info (from sandbox) in the plugin form section, but I’d like to be able to utilize the data in my custom DB so reporting is easy.

    Thanks for your help. ??

Viewing 9 replies - 1 through 9 (of 9 total)