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
// Normal order | |
add_filter( 'wc_paysafe_request_params', 'prefix_add_account_number', 10, 2 ); | |
// Subscriptions/Pre-Orders order | |
add_filter( 'wc_paysafe_addons_request_params', 'prefix_add_account_number', 10, 2 ); | |
/** | |
* @param $params | |
* @param WC_Order $order | |
* | |
* @return mixed | |
*/ |
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
// Removes the 'ip' from TrustCommerce single payment request | |
add_filter( 'wc_trustcommerce_process_single_payment_request', 'prefix_remove_ip_from_request', 10, 3 ); | |
function prefix_remove_ip_from_request( $request, $order, $gateway ) { | |
if ( isset( $request['ip'] ) ) { | |
unset( $request['ip'] ); | |
} | |
return $request; | |
} |
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
add_action( 'wp_footer', 'prefix_hide_the_card_form' ); | |
function prefix_hide_the_card_form() { | |
// Checkout or the Pay page | |
if ( is_checkout() || is_checkout_pay_page() ) { | |
?> | |
<style> | |
.payment_method_psigate div#credit_card_info { | |
display: none !important; | |
} |
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
add_filter( 'wc_paytrace_transaction_request', 'prefix_filter_paytrace_transaction_request', 10, 5 ); | |
/** | |
* @param array $request_parameters | |
* @param WC_Order $order The order to be charged | |
* @param float $amount Amount to be charged | |
* @param bool $is_subscription Is this a subscription | |
* @param bool $is_paid_with_profile Is this a profile payment(true) or new card is used(false) | |
* | |
* @return array | |
*/ |
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
add_filter( 'wc_borica_certificates_password', 'pref_set_p12_password', 10, 2 ); | |
function pref_set_p12_password( $default, $password_type ) { | |
$pass = $default; | |
if ( 'p12_certificate' == $password_type ) { | |
// In 'set_your_pass' write any password you want. | |
// You will use this same password to add the certificate to the browser | |
$pass = 'set_your_pass'; | |
} | |
return $pass; |
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
// Normal order | |
add_filter( 'wc_paysafe_request_params', 'prefix_add_accordd', 10, 2 ); | |
// Subscriptions/Pre-Orders order | |
add_filter( 'wc_paysafe_addons_request_params', 'prefix_add_accordd', 10, 2 ); | |
function prefix_add_accordd( $params, $order ) { | |
$params['accordD'] = array( | |
// This is the type of financing offered. Possible values are: | |
// DEFERRED_PAYMENT – Deferred payment financing | |
// EQUAL_PAYMENT – Equal payment financing |
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
add_filter( 'wc_borica_certificates_password', 'prefix_set_private_key_password', 10, 2 ); | |
function prefix_set_private_key_password( $default, $password_type ) { | |
$pass = $default; | |
if ( 'private_key' == $password_type ) { | |
// Replace 'set_your_pass' with your actual private key password. | |
$pass = 'set_your_pass'; | |
} | |
return $pass; | |
} |
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
add_filter( 'pay360_hosted_get_parameters', 'prefix_add_request_parameters' ); | |
function prefix_add_request_parameters($args, $order, $gateway) { | |
// Add, remove or update a parameter | |
// Add template parameter | |
$args['template'] = 'template_name'; | |
// Always return the arguments back | |
return $args; | |
} |
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
add_filter( 'pay360_hosted_cashier_get_parameters', 'prefix_limit_description', 10, 3 ); | |
function prefix_limit_description($args, $order, $gateway) { | |
// Add, remove or update a parameter | |
// Limit the description to 252 chars and add ... at the end | |
$args['transaction']['description'] = substr( $args['transaction']['description'], 0, ( 252 ) ) . '...'; | |
// Always return the arguments back | |
return $args; | |
} |
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
/** | |
* Adds hooks on the rest init | |
*/ | |
function prefix_filter_order_fields() { | |
// Rest API update of the order | |
add_filter( "woocommerce_rest_pre_insert_shop_order_object", 'prefix_transfer_tracking_info_to_format', 5, 2 ); | |
} | |
add_action( 'rest_api_init', 'prefix_filter_order_fields', 0 ); | |
/** |