This file contains hidden or 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
add_action( 'wc_paytrace_capture_approved_response_processed', 'vanbodevelops_set_order_processing_after_capture', 10, 3 ); | |
/** | |
* @param $response | |
* @param \WC_Order $order | |
* @param $amount | |
*/ | |
function vanbodevelops_set_order_processing_after_capture( $response, $order, $amount ) { | |
// It's our gateway | |
if ( 'paytrace' != $order->get_payment_method() ) { |
This file contains hidden or 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
/** | |
* IMPORTANT: Add the code to your "themes/theme-name/functions.php" file. | |
*/ | |
add_filter( 'woocommerce_payment_complete_order_status', 'vanbodevelops_set_order_to_onhold_after_processing', 10, 3 ); | |
function vanbodevelops_set_order_to_onhold_after_processing( $status, $order_id, $order_now ) { | |
$order = wc_get_order( $order_id ); | |
if ( ! class_exists( 'WC_Paytrace_Order' ) ) { | |
return $status; | |
} |
This file contains hidden or 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
add_action( 'init', 'vanbodevelops_add_email_actions' ); | |
function vanbodevelops_add_email_actions() { | |
// Triggers for this email. | |
add_action( 'woocommerce_order_status_cancelled_to_processing_notification', 'send_order_emails', 11, 2 ); | |
add_action( 'woocommerce_order_status_failed_to_processing_notification', 'send_order_emails', 11, 2 ); | |
add_action( 'woocommerce_order_status_on-hold_to_processing_notification', 'send_order_emails', 11, 2 ); | |
add_action( 'woocommerce_order_status_pending_to_processing_notification', 'send_order_emails', 11, 2 ); | |
} | |
/** |
This file contains hidden or 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
// Actions | |
add_action( 'woocommerce_api_wc_gateway_paysafe_response', 'vanbodevelops_intercept_hosted_response', 9 ); | |
function vanbodevelops_intercept_hosted_response() { | |
/** | |
* @var \WcPaysafe\Gateways\Redirect\Gateway $gateway | |
*/ | |
$gateway = vanbodevelops_get_gateway( 'netbanx' ); | |
if ( 'hosted' != $gateway->get_option( 'integration', 'hosted' ) ) { | |
return; |
This file contains hidden or 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
add_filter( 'pay360_hosted_cashier_get_parameters', 'vanbodevelops_filter_hc_parameters', 10, 3 ); | |
function vanbodevelops_filter_hc_parameters( $args, $order, $gateway ) { | |
// This is the customer ID prefix, from the settings | |
$customer_prefix = $gateway->get_option( 'cashier_customer_prefix' ); | |
$ref_number_parts = explode( ':', $args['transaction']['merchantReference'] ); | |
$customer_prefix = str_replace( array( ' ', ':', ), array( '-', '-' ), $customer_prefix ); | |
This file contains hidden or 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
/** | |
* Add to "wp-content\themes\child-theme\functions.php" file | |
*/ | |
add_filter( 'wc_psigate_process_acc_manager_payment_parameters', 'vanbodevelops_filter_acc_parameters', 10, 2 ); | |
add_filter( 'wc_psigate_process_credit_card_payment_parameters', 'vanbodevelops_filter_acc_parameters', 10, 2 ); | |
function vanbodevelops_filter_acc_parameters( $parameters, $order ) { | |
$transaction_count = get_incremented_transaction_attempt( $order ); | |
// Check if the order is paid and which attempt of transaction it is | |
This file contains hidden or 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
/** | |
* IMPORTANT: Place the snippet inside your "wp-content\themes\child-theme\functions.php" file | |
*/ | |
/** | |
* Replace the Pay360 image in the checkout icon | |
*/ | |
add_filter( 'woocommerce_pay360_icon', 'vanbodevelops_pay360_icon', 10 ); | |
function vanbodevelops_pay360_icon( $image ) { | |
return WC_Pay360::plugin_url() . '/pay360-logo.png'; |
This file contains hidden or 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
/** | |
* NOTЕ: Add the code to your "themes\child-theme\functions.php" file | |
*/ | |
add_filter( 'pay360_hosted_cashier_get_parameters', 'vanbodevelops_do_not_register_profile', 10, 3 ); | |
function vanbodevelops_do_not_register_profile( $args, $order, $get_gateway ) { | |
// Send the 'registered' parameter as false, | |
// so Pay360 will not create a profile for the customer in their system. | |
if ( ! empty( $args['customer'] ) ) { | |
$args['customer']['registered'] = false; | |
} |
This file contains hidden or 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
/** | |
* Add to your "themes/child-theme-folder/functions.php" file | |
*/ | |
add_filter( 'wc_psigate_process_credit_card_payment_parameters', 'vanbo_combine_shipping_in_total', 10, 2 ); | |
function vanbo_combine_shipping_in_total( $parameters, $order ) { | |
$total = number_format( ( $order->get_total() - WC_Compat_PsiGate::get_total_shipping( $order ) - $order->get_total_tax() ), 2, '.', '' ); | |
// If the total is 0 | |
if ( 0 >= $total ) { | |
// Subtotal will equal the order total |
This file contains hidden or 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
/** | |
* NOTE: Add this snippet to your "child-theme\functions.php" file | |
*/ | |
add_action( 'wp_footer', 'vanbo_add_block_script_to_footer', 9999 ); | |
function vanbo_add_block_script_to_footer() { | |
?> | |
<script> | |
(function ($) { | |
/** |