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( "woocommerce_rest_shop_order_object_query", 'prefix_filter_orders', 5, 2 ); | |
| /** | |
| * @param $args | |
| * @param WP_REST_Request $request | |
| * | |
| * @return mixed | |
| */ | |
| function filter_orders( $args, $request ) { | |
| $get_params = $request->get_query_params(); | |
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
| /** | |
| * @param WC_Order $order | |
| * @param string $response_code The transaction response code. Possible values are: | |
| * 00 - Successful transaction | |
| * 85 - Reversal Transaction already registered | |
| * 86 - Transaction already registered | |
| * 87 - Wrong protocol version | |
| * 88 - BOReq parameter is not given | |
| * 89 - Original transaction is not found. | |
| * 90 - Card is not registered in the Directory Server |
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
| /** | |
| * Orders containing virtual or processing products only will be set to Completed essentially skipping the Processing status. | |
| * If you need those orders to first be set to Processing: | |
| * 1. Use the code below to have WooCommerce mark the order as Processing | |
| * 2. Go to WooCommerce > Settings > Products > Downloadable Products > Uncheck the checkbox "Grant access to downloadable products after payment" > Save | |
| * | |
| * This process will mark the orders as Processing and wait until the order is in Completed status before grants a download access | |
| */ | |
| add_action( 'woocommerce_order_item_needs_processing', 'prefix_item_need_processing', 10, 3 ); | |
| function prefix_item_need_processing( $needs_procesing, $product, $order_id ) { |
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_payment_customer_redirect_url', 'prefix_custom_redirect_url', 10, 3 ); | |
| function prefix_custom_redirect_url( $url, $status, $order_id ) { | |
| /** | |
| * $status possible values are: | |
| * 'success', | |
| * 'error', | |
| * 'hold', | |
| * 'timeout', | |
| * 'decline', | |
| */ |
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_ipay88_order_description', 'prefix_change_ipay88_payment_description', 10, 2 ); | |
| /** | |
| * @param $desc | |
| * @param WC_Order $order | |
| * | |
| * @return string | |
| */ | |
| function prefix_change_ipay88_payment_description( $desc, $order ) { | |
| return sprintf( 'Payment for order %s', $order->get_order_number() ); | |
| } |
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 ); |
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
| /** | |
| * 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
| 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
| /** | |
| * 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 ); |