Skip to content

Instantly share code, notes, and snippets.

@anthonysbrown
Last active February 27, 2019 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonysbrown/69a0266ce30e5b907bce6525682c6bd6 to your computer and use it in GitHub Desktop.
Save anthonysbrown/69a0266ce30e5b907bce6525682c6bd6 to your computer and use it in GitHub Desktop.
function.php
<?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