PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Help to use paypal_fulfillment

  1. batouri
    Member

    Hi,
    I am new to gform and I need to use the paypal_fulfillment hook, but I face some issues:
    -I added

    "add_action("gform_paypal_fulfillment", "process_order", 10, 4); "

    in Init function of paypal.php
    -I created the following function in paypal.php:

    function process_order($entry, $config, $transaction_id, $amount)
    {
      global $wpdb;
      $order_id = $entry['id'];
      $start_date = $entry['payment_date'];
      $amount = $entry['payment_amount'];
      $pseudo = $entry['7'];
      $SQL = "INS ERT INTO test (order_id, pseudo, start_date, amount) VALUES ( $order_id, $pseudo, $start_date, $amount)";
       $wpdb->query($SQL);
    }

    But nothing is inserted in test table.

    Can you help me?

    Regards

    [chrishajer edited INSERT to get past firewall]

    Posted 12 years ago on Wednesday September 19, 2012 | Permalink
  2. -I added "add_action("gform_paypal_fulfillment", "process_order", 10, 4); " in Init function of paypal.php

    -I created the following function in paypal.php:

    You should not do that. All hooks and filters are to be used in your theme's functions.php file. We don't support modifying the plugin files.

    Please return the plugin files to their original state and we'll help you from there.

    Posted 12 years ago on Thursday September 20, 2012 | Permalink
  3. batouri
    Member

    Hi,
    thanks for your reply, I re installed the plugin and added these lines in the theme's functions.php file. But it doesn't work.
    What can I do?

    Thanks

    F

    Posted 12 years ago on Thursday September 20, 2012 | Permalink
  4. batouri
    Member

    Hi,
    I have to add that I am using paypal sandbox and in wp_rg_paypal_transaction table I can see the transactions but they are in pending state.

    Thanks

    F

    Posted 12 years ago on Thursday September 20, 2012 | Permalink
  5. When the PayPal transactions show pending, it's usually because PayPal cannot communicate with your server to send the IPN (payment notification.) Therefore, Gravity Forms will not update the status beyond "Pending."

    Regarding gform_paypal_fulfillment, if your transactions are showing pending, this hook will never fire and your code will never run. You have to fix IPN first. What does the PayPal IPN history look like?

    Can you post the IPN URL from your PayPal settings in Gravity Forms? This would be the URL, but for your site: http://example.com/wp-admin/admin.php?page=gf_settings&addon=PayPal

    Also, please confirm that IPN is enabled at PayPal.

    Posted 12 years ago on Thursday September 20, 2012 | Permalink
  6. batouri
    Member

    Hi,

    The IPN URL is: http://www.OptimaProf.com/?page=gf_paypal_ipn

    I confirm that IPN is activated.

    Posted 12 years ago on Thursday September 20, 2012 | Permalink
  7. What does the PayPal IPN history show?

    Posted 12 years ago on Thursday September 20, 2012 | Permalink
  8. batouri
    Member

    Hi,
    I configured biz and personal sandbox accounts that I am using to test my website.
    When I look at the PayPal IPN History I can see many transactions sent.
    I also use the registration addon.
    The personal account is registered at the end of the paiment but I still see transactions in a pending
    state, and the fulfillment action is still not fired.
    Can you help?

    Posted 12 years ago on Thursday September 20, 2012 | Permalink
  9. batouri
    Member

    It is working.
    Thanks

    Posted 12 years ago on Thursday September 20, 2012 | Permalink
  10. Thank you for the update @batouri.

    Posted 12 years ago on Saturday September 22, 2012 | Permalink