By now, you probably know that you should never run WooCommerce with a single payment gateway. We’ve already seen in the “PayPal or Stripe?” article that (spoiler alert!), the best solution is “PayPal AND Stripe”. Which means you need to understand that different customers prefer different kinds of payment methods (and this could increase your conversion rate dramatically).
Now we move to the next step: the chargebacks issue, and the risk of having your payment gateways banned by their providers.
A user recently told us that he has a WooCommerce subscription-based business, which is great. The problem is that sometimes customers don’t read that part and think they’re making a one-time purchase. And sometimes, when they realize they purchased something different than what they had in mind, they ask their bank or credit card company to issue a chargeback.
A chargeback happens when a cardholder makes a claim to their bank or credit card company that a payment made on their card was fraudulent. When a chargeback occurs, the business to which the payment was originally made is required to repay the full purchase amount, plus a chargeback fee.
While you can really do your best to avoid chargebacks by being transparent on your website and order receipts, sometimes – especially for WooCommerce Subscriptions – that’s not enough. Investors say: “Don’t Put All Your Eggs in One Basket” and the same applies here: you’d better record your active subscriptions under PayPal, Stripe, Authorize, and so on, so that all your recurring revenue is not in the same account.
As you probably already know, WooCommerce offers the easiest way to build an online store with WordPress.
Depending on your individual needs, WooCommerce allows you
to add digital products as well as subscriptions. One of the most important
components of your store is the payment gateway you use.
This is what offers your shoppers a secure shopping experience by connecting your store to an online payment service where they can pay for their orders, safely and securely.
What is a WooCommerce Payment Gateway?
WooCommerce payment gateways work by verifying the billing information for every customer, approving requests and ensuring you get paid.
The type of WooCommerce payment gateway to choose depends on several factors which include how easy it is to integrate with WooCommerce, the target clients you serve, related costs and the level of security you need.
I invoice clients via WooCommerce, and then send them the “Invoice Email”, which takes them to the “Order Pay” page. Of course, I want to give them the option to pay via “Bank Transfer” (bacs), but I don’t want this to be visible on the default checkout page.
Today we take a look at the WooCommerce Checkout Page and specifically at how to disable a payment gateway (for example PayPal) when a specific shipping method is selected (e.g. “local_pickup”). Enjoy!
If you wish to print the payment gateway name on order emails (in its own paragraph below the order items table), here’s a handy snippet for you.
All you need to use is the “woocommerce_email_after_order_table” hook to pick the correct position, and then the “get_payment_method_title” WooCommerce function to return the payment gateway name. Enjoy!
You may want to disable payment gateways depending on the user role or user capability. For example, you may want to disable PayPal for “user role: shop_manager” or enable a specific gateway for “user role: customer”. All you need is pasting the following code in your functions.php
You might want to disable PayPal for non-local customers or enable a specific gateway for only one country… Either way, this is a very common requirement for all of those who trade internationally.
Here’s a simple snippet you can further customize to achieve your objective. Simply pick the payment gateway “slug” you want to disable/enable (“paypal”, “authorize”, “stripe”, etc.) and the country code (US, ES, IE, etc.) and then apply your conditional rules in the plugin below.