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.

Invoice Number Appended to Product Field Label - PayPal

  1. I have a form (form ID 4) where I used a "User Defined Price" Product field (field ID 4), to collect the amount that the user is going to pay. I also have a Single Line Text field (field ID 10) that the user inputs their invoice number (invoice was mailed out to them).

    Since PayPal has nothing available to send over a reference or invoice number, I want to append 'Inv #' and the input from field 10, to the label of field 4, and send that to PayPal.

    I did some research, and know what I need to use gform_pre_submission_filter, but I don't know where to start to make this work. (I saw this http://www.gravityhelp.com/forums/topic/paypal-for-invoices-user-defined-price, but it is not what I need because it always updates 'invoice 123', and I can't make it work).

    How is this done (hi David Smith lol)?
    Help is greatly appreciated!!
    Thanks!!

    Posted 12 years ago on Wednesday June 20, 2012 | Permalink
  2. There is actually a way to send an invoice # to paypal. I used the following code:

    //Gravity Forms PayPal Invoice Edits
    add_filter("gform_paypal_invoice", "change_invoice", 10, 3);
    function change_invoice($invoice_id, $form, $entry){
        return $entry["10"];//field ID you want to be the invoice number
    }
    Posted 12 years ago on Sunday October 7, 2012 | Permalink
  3. btrilli,

    That's awesome, I will try it out.

    Thanks for the help!

    Posted 12 years ago on Sunday October 7, 2012 | Permalink
  4. The hook is documented here for anyone curious:
    http://www.gravityhelp.com/documentation/page/Gform_paypal_invoice

    Posted 12 years ago on Monday October 8, 2012 | Permalink