View difference between Paste ID: Mfh0YLuA and KZJSE0rR
SHOW: | | - or go back to the newest paste.
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-
        # GET DATA FROM FORM INPUT
4+
5-
        $form_data["phone"] = rgpost('input_3');
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
}