Last active
June 15, 2020 02:05
-
-
Save webaware/6f0fd469855e7c2d5b8495b9708c8003 to your computer and use it in GitHub Desktop.
specify a custom Invoice Reference for Gravity Forms eWAY (Free and Pro) transactions. https://gfeway.webaware.net.au/
This file contains 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: GFeWAY Invoice Reference | |
Plugin URI: https://gist.github.com/webaware/6f0fd469855e7c2d5b8495b9708c8003 | |
Description: specify Invoice Reference for Gravity Forms eWAY transaction | |
Version: 1 | |
Author: WebAware | |
Author URI: https://gfeway.webaware.net.au/ | |
*/ | |
if (!defined('ABSPATH')) { | |
exit; | |
} | |
/** | |
* change the Invoice Reference field to a custom value | |
* @param string $invoiceReference | |
* @param array $form the Gravity Forms form | |
* @return string | |
*/ | |
add_filter('gfeway_invoice_ref', function($invoiceReference, $form) { | |
// set your custom reference here; perhaps a WordPress User ID, or field value | |
$invoiceReference = uniqid(); | |
return $invoiceReference; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @samheavyside,
That's great you can access the $_POST object so easily.
Really appreciate you sharing - have a great day!
CJ