Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Originally from here http://pastebin.com/XceGeuBF
- // Reference: http://www.gravityhelp.com/forums/topic/sending-additional-information-to-authorizenet-via-namevalue-pairs?replies=5#post-143109
- /**
- * E-COMM -- Authorize.net API for GravityForms
- *
- * Modify the transaction data sent to Authorize.net
- * Ref: plugins/gravityformsauthorizenet/authorizenet.php
- */
- add_filter('gform_authorizenet_before_single_payment','my_anet_custom_fields', 10, 2);
- function my_anet_custom_fields($transaction, $form_data) {
- # GET DATA FROM FORM INPUT
- $form_data["my_invoice"] = rgpost("input_7"); // different for each form!
- $form_data["customer_id"] = rgpost("input_8"); // different for each form!
- $form_data["custom_data"] = rgpost("input_9"); // different for each form!
- # ADD DATA TO TRANSACTION OBJECT
- $transaction->invoice_num = $form_data["my_invoice"];
- $transaction->cust_id = $form_data["customer_id"];
- $transaction->description = 'My Custom Data: ' . $form_data["custom_data"];
- # CUSTOM FIELDS: based on the AuthNet AIM api, this should work but it does NOT.
- //$transaction->setCustomField("Color", "Blue");
- return $transaction;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement