Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Revised function to apply to multiple forms

chrishajer Feb 13th, 2013 392 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // http://www.gravityhelp.com/forums/topic/sending-additional-information-to-authorizenet-via-namevalue-pairs#post-146608
  3. add_filter('gform_authorizenet_before_single_payment','my_anet_custom_fields', 10, 2);
  4. function my_anet_custom_fields($transaction, $form_data) {
  5.  
  6.         # GET DATA FROM FORM INPUT BASED ON FORM ID
  7.        # CREATE MULTIPLE FORM to FIELD MAPPINGS HERE
  8.  
  9.         # form 75 uses input_3 for the phone number
  10.        if (rgpost('form_id') == 75 {
  11.                 $form_data["phone"] = rgpost('input_3');
  12.         }
  13.         # form 14 uses input_17 for the phone number
  14.         else if (rgpost('form_id') == 14 {
  15.                 $form_data["phone"] = rgpost('input_17');
  16.         }
  17.  
  18.         # ADD DATA TO TRANSACTION OBJECT
  19.        $transaction->phone = $form_data["phone"];
  20.  
  21.         return $transaction;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top