Bypass specific WooCommerce payment_request_type
-
Hello, thank you very much for your work on this plugin. It is greatly appreciated.
I was wondering if you could please add options to the plugin for bypassing specific payment_request_type’s such as ‘apple_pay’. I’m hoping some options could be added to the plugin to target the specific options such as apple_pay, google_pay, etc. It would be beneficial to bypass these express payment methods while still keeping turnstile enabled for the credit card form method of Stripe.
// Skip if Turnstile disabled for payment method
$skip = 0;
if ( isset( $_POST['payment_method'] ) ) {
$chosen_payment_method = sanitize_text_field( $_POST['payment_method'] );
// Retrieve the selected payment methods from the cfturnstile_selected_payment_methods option
$selected_payment_methods = get_option('cfturnstile_selected_payment_methods', array());
if(is_array($selected_payment_methods)) {
// Check if the chosen payment method is in the selected payment methods array
if ( in_array( $chosen_payment_method, $selected_payment_methods, true ) ) {
$skip = 1;
}
}
if ( 'stripe' == $chosen_payment_method && isset($_POST['payment_request_type']) ) {
$stripe_payment_request_type = sanitize_text_field( $_POST['payment_request_type'] );
if ( 'apple_pay' == $stripe_payment_request_type ) {
$skip = 1;
}
}
The topic ‘Bypass specific WooCommerce payment_request_type’ is closed to new replies.