Skip to content

Instantly share code, notes, and snippets.

@Preciousomonze
Created October 15, 2024 08:09
Show Gist options
  • Save Preciousomonze/55ca0304e645f7404edcede86bdb74f2 to your computer and use it in GitHub Desktop.
Save Preciousomonze/55ca0304e645f7404edcede86bdb74f2 to your computer and use it in GitHub Desktop.
Korapay gateway for WooCommerce Mini docu
if ( ! function_exists( 'WC_KORAPAY\\display_proper_error' ) ) {
/**
* Display messages properly.
*
* Incase of debugging
*
* @param array $response
* @param array $kora_params
* @param int $order_id
*/
function display_proper_error( $response, $kora_params, $order_id ) {
if ( ! ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) {
$s = WC()->payment_gateways();
var_dump( $response->error_data['korapay_api_failed']['data'], $kora_params );
//var_dump($kora_params);
}
}
}
add_action( 'wc_korapay_redirect_payment_error', 'WC_KORAPAY\\display_proper_error', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment