Skip to content

Instantly share code, notes, and snippets.

@sidharrell
Created July 2, 2013 00:16
Show Gist options
  • Save sidharrell/5905827 to your computer and use it in GitHub Desktop.
Save sidharrell/5905827 to your computer and use it in GitHub Desktop.
fix for firstdata e4
<?php
// This is the full contents of the updated init.php file for firstdata_e4 for the fix added to 3.1.34-BETA
// This is for the gateway display
add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header');
add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer');
event_espresso_require_gateway("firstdata_e4/e4_vars.php");
if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'firstdata_e4') {
event_espresso_require_gateway("firstdata_e4/e4_ipn.php");
add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_firstdata_e4_get_attendee_id');
add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_firstdata_e4');
}
// end the init.php file.
// start of the updated function in e4_ipn.php
function espresso_transactions_firstdata_e4_get_attendee_id($attendee_id) {
if (!empty($_REQUEST['x_cust_id'])) {
$attendee_id = $_REQUEST['x_cust_id'];
}
if (!empty($_REQUEST['x_reference_3'])) {
$temp_array = explode(' ', $_REQUEST['x_reference_3']);
$_REQUEST['registration_id'] = $temp_array[0];
$_REQUEST['type'] = $temp_array[1];
}
return $attendee_id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment