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
| /** | |
| * 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_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
| // 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_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
| /** | |
| * Response actions | |
| * | |
| * do_action( 'wc_paysafe_payment_response_processed', $order, $response ); | |
| * do_action( 'wc_paysafe_redirect_hosted_response_processed', $response, $this, $order ); | |
| * do_action( 'wc_paysafe_redirect_hosted_declined_response_processed', $response, $this, $order ); | |
| * do_action( 'wc_paysafe_redirect_hosted_cancelled_response_processed', $response, $this, $order ); | |
| * do_action( 'wc_paysafe_redirect_hosted_errored_response_processed', $response, $this, $order ); | |
| * do_action( 'wc_paysafe_redirect_hosted_pending_response_processed', $response, $this, $order ); | |
| * do_action( 'wc_paysafe_redirect_hosted_settlement_response_processed', $response, $this, $order ); |
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_checkoutjs_account_id', 'prefix_paysafe_checkout_api_account_id', 10, 3 ); | |
| /** | |
| * @param string $account_id The default Account ID for the type | |
| * @param \WcPaysafe\Api\Data_Sources\Order_Source|\WcPaysafe\Api\Data_Sources\User_Source $data_source | |
| * @param string $payment_type The type of payment to be processed. | |
| * Possible values: cards|directdebit|interac|iframe | |
| * Note : The $payment_type values explained: | |
| * 1. cards - Cards API transaction | |
| * 2. directdebit - Direct Debit API transaction | |
| * 3. interac - Interac transaction - not yet supported |
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( 'wc_trustcommerce_process_single_payment_request', 'prefix_modify_payment_request', 10, 3 ); | |
| function prefix_modify_payment_request( $request, $order, $gateway ) { | |
| // You have access to all request properties right before a payment request is sent. | |
| // Disable the AVS | |
| if ( isset( $request['avs'] ) ) { |
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
| /** | |
| * The code goes into your "theme\functions.php" file or any php file that is loaded on page load. | |
| */ | |
| add_filter( 'wc_psigate_process_credit_card_payment_parameters', 'prigate_xml_api_add_order_details', 11, 2 ); | |
| /** | |
| * @param array $original_parameters | |
| * @param WC_Order $order | |
| * | |
| * @return array |
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: The filters only work for the Paysafe Hosted Payments API integration. | |
| * Other integrations like Paysafe Checkout JS will have separate filters for the requests | |
| */ | |
| // Normal order | |
| add_filter( 'wc_paysafe_request_params', 'prefix_paysafe_modify_request', 10, 2 ); | |
| // Subscriptions/Pre-Orders order | |
| add_filter( 'wc_paysafe_addons_request_params', 'prefix_paysafe_modify_request', 10, 2 ); |