Last active
February 27, 2019 20:20
-
-
Save anthonysbrown/69a0266ce30e5b907bce6525682c6bd6 to your computer and use it in GitHub Desktop.
function.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Gravity Forms Authorize.net Custom Fields | |
* Plugin URI: http://codeable.io | |
* Description: GF Extra fields for beyer | |
* Author: Anthony Brown | |
* Author URI: http://codeable.io | |
* Version: 1.0.0 | |
* WC tested up to: 3.5.4 | |
* WC requires at least: 3.0 | |
* Text Domain: gf-beyer | |
*/ | |
function load_GF_AUTHORIZE_CF(){ | |
new GF_AUTHORIZE_CF; | |
} | |
add_action('plugins_loaded', 'load_GF_AUTHORIZE_CF'); | |
class GF_AUTHORIZE_CF{ | |
function __construct(){ | |
add_filter( 'gform_authorizenet_transaction_pre_capture',array($this,'add_custom_field'), 10, 5 ); | |
} | |
function add_custom_field( $transaction, $form_data, $config, $form, $entry ) { | |
$transaction->cust_id = rgar( $entry, '5' ); | |
$transaction->invoice_num = rgar( $entry, '4' ); | |
$transaction->description = rgar( $entry, '14' ); | |
return $transaction; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment