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( 'wc_trustcommerce_process_profile_payment_request_request', 'prefix_modify_token_payment_request', 10, 3 ); | |
| /** | |
| * @param array $request | |
| * @param WC_Order $order | |
| * @param $gateway | |
| * | |
| * @return mixed | |
| */ | |
| function prefix_modify_token_payment_request( $request, $order, $gateway ) { | |
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
| // Modify XML-API test URL | |
| add_filter( 'wc_psigate_xml_test_url', 'prefix_modify_xml_api_test_url' ); | |
| function prefix_modify_xml_api_test_url($url) { | |
| // Put any url in the place of the example one | |
| return 'https://staging.psigate.com:27989/Messenger/XMLMessenger'; | |
| } | |
| // Modify Account Manager API test URL | |
| add_filter( 'wc_psigate_manager_test_url', 'prefix_modify_account_manager_test_url' ); | |
| function prefix_modify_account_manager_test_url($url) { |
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( 'wp_footer', 'prefix_add_script_to_footer' ); | |
| /** | |
| * Adds a script to automatically load the Paysafe Layover on the WooCommerce pay page | |
| */ | |
| function prefix_add_script_to_footer() { | |
| if ( ! is_checkout_pay_page() ) { | |
| 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 the gist to your "theme/functions.php" file or any file loading with after the "theme/functions.php" file | |
| */ | |
| add_filter( 'wc_paysafe_checkoutjs_order_iframe_props', 'prefix_modify_overlay_parameters', 10, 3 ); | |
| /** | |
| * @param array $parameters | |
| * @param \WC_Order $order | |
| * @param \WcPaysafe\Api\Checkoutjs\Service $service | |
| * |
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( 'wc_psigate_process_credit_card_payment_parameters', 'prefix_allow_free_trial_subscription', 10, 2 ); | |
| /** | |
| * @param array $parameters | |
| * @param \WC_Order $order | |
| * | |
| * @return mixed | |
| */ | |
| function prefix_allow_free_trial_subscription( $parameters, $order ) { | |
| if ( ! function_exists('wcs_order_contains_subscription') ) { | |
| return $parameters; |
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
| /** | |
| * Place the code in your theme/functions.php file | |
| */ | |
| add_filter( 'wc_epay_one_touch_payment_setup_params', 'prefix_epaytouch_setup_params', 10, 4 ); | |
| function prefix_epaytouch_setup_params( $params, $device_id, $token, $account_payment_class ) { | |
| if ( isset( $params['EXP'] ) ) { | |
| // remove the expiration time | |
| unset( $params['EXP'] ); | |
| } | |
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( 'http_api_curl', 'paytrace_http_api_curl', 10, 3 ); | |
| /** | |
| * Force posts to Paytrace to use TLS v1.2. | |
| * | |
| * @param string $handle | |
| * @param mixed $r | |
| * @param string $url | |
| */ | |
| function paytrace_http_api_curl( $handle, $r, $url ) { | |
| if ( strstr( $url, 'https://' ) && ( strstr( $url, 'api.paytrace.com' ) || strstr( $url, 'paytrace.com/api' ) ) ) { |
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 the code to the 'theme/functions.php" file | |
| */ | |
| add_filter( 'wc_paytrace_request_timeout', 'vanbo_paytrace_edit_timeout', 10 ); | |
| /** | |
| * @param int $timeout The current seconds | |
| * | |
| * @return int Return the seconds you want the timeout to be | |
| */ | |
| function vanbo_paytrace_edit_timeout($timeout){ |
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( 'admin_init', 'vanbo_update_order_status', 10 ); | |
| function vanbo_update_order_status() { | |
| // We need the 'post', 'action' = edit, and 'prefix-change-status' to be set. | |
| // If even one is not set, bail | |
| if ( ! isset( $_GET['post'] ) | |
| || ( ! isset( $_GET['action'] ) || 'edit' != $_GET['action'] ) | |
| || ! isset( $_GET['prefix-change-status'] ) ) { | |
| 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( 'wc_paysafe_layover_on_checkout', 'vanbo_wc_paysafe_layover_on_checkout' ); | |
| function vanbo_wc_paysafe_layover_on_checkout( $on_checkout ) { | |
| return true; | |
| } |