Skip to content

Instantly share code, notes, and snippets.

@sidharrell
Last active December 30, 2015 22:39
Show Gist options
  • Select an option

  • Save sidharrell/7895923 to your computer and use it in GitHub Desktop.

Select an option

Save sidharrell/7895923 to your computer and use it in GitHub Desktop.
fix eway response message
// replaces gateways/eway/ewaypaymentprocess.php lines 87-97
if ($eway_settings['use_sandbox']) {
echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('Debugging / Sandbox output', 'event_espresso') . '</h3><br />';
echo "Response code = " . $responsecode;
echo "\nResponse = ";
var_dump($response);
echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('End of Debugging / Sandbox output (this will go away when you switch to live transactions)', 'event_espresso') . '</h3>';
$subject = 'Instant Payment Notification - Gateway Variable Dump';
$body = "An instant payment notification failed\n";
$body .= "from " . " on " . date('m/d/Y');
$body .= " at " . date('g:i A') . "\n\nDetails:\n";
$body .= $response;
wp_mail($payment_data['contact'], $subject, $body);
} else {
echo 'There was a problem processing your transaction<br>';
$responsemessage = fetch_data($response, '<TrxnResponseMessage>', '</TrxnResponseMessage>');
echo 'eWay reports that: ' . $responsemessage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment