Payment Gateways – Page 3

Disable Payment Gateways based on User Role

In this tutorial I will show you how to enable or disable WooCommerce payment gateways for a specific user role. And also how to condition them for registered users.

Restrict Payments Gateways for Specific Products / Product Categories

Charge Extra Fees Based on Payment Gateway Selected

In this tutorial I will show you how to add extra charges to a specific payment gateway without plugins with the help of woocommerce_cart_calculate_fees filter hook.

charge additional fees for specific WooCommerce payment gateways
We add an additional £2 fee when customer chooses to pay with PayPal. And also displayed it near a payment gateway title.

Disable Payment Gateway based on Shipping Method

Enable payment gateway by shipping method in WooCommerce
In this example we have three payment gateways – COD, PayPal and Credit Card. We deactivate “Cash on delivery” payment method for local pickups.

How to Hide Payment Methods based on Postal Code

In this tutorial I will show you how you can disable or enable payment gateways in WooCommerce depending on customer shipping or billing postcode with the help of woocommerce_available_payment_gateways filter hook.

Disable Payment Gateway for Specific Country

In this tutorial we are going to talk about country based payments in WooCommerce. Because it is a common case that some payment gateways may not work for specific countries.

In this tutorial I will show you how to condition it easily and without any plugins.

Here is what we are going to create:

restrict WooCommerce payment gateways by country selected
At the moment of writing this tutorial PayPal doesn’t work for Monaco. So let’s deactivate PayPal payment gateway for Monaco.

Add ID Column to Payment Methods Table

Sometimes when you work with payment gateways on your website, you need to know their IDs (slugs). In this tutorial I show how to add a column to the payment gateways table in WooCommerce settings using a small piece of code.

Here is our result:

Payment method ID column
“Misha Gateway” is a custom payment gateway we created in this tutorial.