Blog / General / A Straight-to-the-Point Guide to WooCommerce Custom Payment Gateways

A Straight-to-the-Point Guide to WooCommerce Custom Payment Gateways

Rishi Lodha
Last Updated: 09/07/24

WooCommerce supports two of the largest payment gateways in the world, PayPal and Stripe. It offers extensions to let you accept payments through these payment gateways.

But what if you want to look beyond these two payment gateways? That’s where custom payment gateways come in.

How to Add Custom Payment Gateways in WooCommerce?

There are a few major solutions available at your disposal that help you add custom payment gateways to WooCommerce. You can either use a plugin or get a WordPress expert to add a custom code to your site that would integrate your desired payment gateway with your WooCommerce store.

Use a Custom Payment Gateway Plugin

The first solution that would come to your mind is using a plugin, which is a given when you’re using WordPress and WooCommerce for your site. However, it isn’t exactly ideal when you’re looking to add a custom payment gateway to WooCommerce, especially if you don’t know anything about modifying code.

Sure, there are many WooCommerce PayPal plugins and even Stripe payment plugins that let you add these popular payment gateways to your store without using WooCommerce’s extensions designed for them. Some of those plugins even let you use the variations of these payment methods, such as PayPal recurring payments.

However, things aren’t as straightforward when you’re looking to add a completely different and not-so-popular local payment gateway, for instance.

To tell the truth, no plugin offers a real custom payment gateway integration in the way that doesn’t require you to have any knowledge of code. That said, there are plugins that allow your customers to submit their orders without making a payment and mention their desired payment method in the notes, or accept payments through your custom payment gateway but in a more manual way.

WooCommerce Custom Payment Gateway by WPRuby

If you think you can make things work with the first kind of plugin we mentioned above, you can go ahead and install the WooCommerce Custom Payment Gateway plugin by WPRuby. It allows your customers to submit an order without making a payment and mention in the notes the payment gateway they would like to use for their payment.

Once installed and activated, you will find it under WooCommerce → Settings → Payments.

When you’re on the Payments tab, scroll down to the bottom of the page and click on the Manage button for the Custom Payment option.

Managing custom payment functionality

Now you will land on the page where you can enable the custom payment option on your store. It will allow your customers who are not able to pay using any of your existing payment gateways to submit their order without making a payment, while being able to mention in the notes which payment gateway would they prefer.

WooCommerce custom payment gateway plugin


You can customize the message that’s shown to your customers as seen in the above image.

Now, this plugin also has a pro version that actually allows you to build a custom payment gateway. You can create a payment gateway form with customizable fields.

What’s more? It comes with the ability to connect your store to an external API belonging to your payment processor, allowing them to process the payment information submitted by your customers.

Of course, you would need a professional to set things up initially, but it would otherwise be the easiest way to add a custom payment gateway to your store.

The pricing is a little tricky, as the most basic single site license costs $69 and allows you to use the plugin for the lifetime. But it only supports updates and support for a year.

If you want to purchase a single site license with a lifetime of updates and support, it will cost you $199. Of course, you would have to shell out more if you want to use the plugin on multiple sites.

Custom Payment Gateways for WooCommerce by Imaginate Solutions

If you’re after a plugin that gets as close to creating a real custom payment gateway as possible for a free plugin, then Custom Payment Gateways for WooCommerce is worth a look.

The free version only lets you create a single payment gateway and comes with many restrictions, but the pro version allows you to create an unlimited number of custom payment gateways. It lets you create payment gateways for the payment methods you want, while allowing you to customize and control all the aspects.

Create a WooCommerce custom payment gateway

You can customize a lot of things right from the title and description of the payment gateway to the shipping methods it will be available for. You can also display the instructions on your store’s Thank You page as well as in the email your customers are sent after using your custom payment gateway.

You can also set the order status on your end for the orders you receive through your custom payment gateway. Most importantly, you can choose to add both fees and taxes to the payment amount.

Adding fees and taxes

Finally, you can also set a custom ‘thank you’ page. For those who know code, the plugin allows them to add a new field to collect more data on their store’s checkout page.

Collecting more customer data through new input fields

Talking about the limitations of the free version, you can only create a single custom payment gateway and a single input field. Similarly, you can only add one type of fee to the payment amounts.

The pro version, as we mentioned above, goes a lot further. Besides allowing you to create multiple payment gateways, it will also let you add multiple input fields for the checkout page, include multiple different fees, as well as choose a minimum and a maximum payment amount for which your custom payment gateway can be used.

The yearly license of the pro version costs $29.99 per year for a single site, and $79.99 per year for an unlimited number of sites. As for the lifetime licenses, the single site license is priced at $49.99 while the unlimited site license costs $149.99.

Create Your Own Custom Payment Gateway Plugin in WooCommerce

Now this might sound daunting, but if you want to develop a custom payment gateway where you can use the payment processor’s API and integrate it within your WooCommerce store, then you may want to consider creating your own custom payment gateway plugin.

Needless to say, you need to know your way around code here. By doing some searching around you may be able to find sample or reference code for a major part of the entire project, but there will be a lot of customizations and modifications to the code needed according to the payment processor you want to use.

The one significant customization here would be creating a link between the plugin and your payment processor’s API, and code functions that send and receive information back and forth between the customer and your payment processor.

I know it sounds complicated, but it is what it is. If you don’t have any experience playing around with code, you will need to hire a WordPress agency or professional to create a custom plugin for you.

However, for those looking for the technical basics involved, let us walk you through a quick overview of the process.

  • First, you need to create a file for your custom payment gateway in your plugins folder on the backend;
  • Add basic details and description in the plugin file using basic PHP;
  • Create custom PHP code to extend the default WooCommerce payment gateway class.

Now, as we said above, you can find some readymade code for this purpose, but you will still have to make the customizations for everything to work correctly.

Modify and Extend the WooCommerce Class Code

There’s another solution but another one that involves working with the code. Depending on your requirements though, this could be simpler than developing your own plugin.

WooCommerce offers payment gateway extensions through a form of code that are known as core classes. You can get a coding professional to use these core classes and add custom functions to them to extend their functionality and cover the custom payment gateway you need.

A lot of it is going to be similar to the method explained above, since you will basically be using the same code functions.

But since you would already have a solid base to work with here, the work involved or the development cost could be lower. However, this would probably only be possible if your custom payment gateway can be integrated within these WooCommerce core classes.

Create a Custom Payment Gateway Redirect on Your WooCommerce Store

Some store owners also want to set up their WooCommerce custom payment gateway solution in a way that lets them redirect their customers to the payment gateway when they land on the payments page.

Now, if this was any other page, you could use our plugin Profile Builder to create a custom redirect. Profile Builder allows you to create a WordPress redirect to another page or an external URL.

However, the case here is unique and complicated. It’s not just a matter of redirecting your customers to a different page, but the ‘live’ information transfer that takes place between the last customer action on your store and your custom payment gateway.

And this is why you would again need to do some messing around with the code here. It would basically involve using your payment processor’s API so that your store can transfer the payment information to it.

Again, if you have never done something like this before, you will have no option but to seek the help of a professional coding expert.

I understand that you’re looking for a custom payment gateway solution, but a lot of store owners don’t really need one. Moreover, there are certain issues associated with one that we would talk about in more detail below.

That being said, if you don’t have a real, specific reason for using a custom payment gateway, then Paid Member Subscriptions can probably offer everything you need in terms of payment management.

Paid Member Subscriptions is a WordPress membership plugin. It’s specifically designed to handle WordPress recurring payments as well as help you create subscription products and sell memberships.

So if you’re running a WooCommerce store that sells subscription products or memberships, then using Paid Member Subscriptions is likely going to be your best bet. In fact, if you only wanted to go for a custom payment gateway because some WordPress payments plugins don’t offer support for recurring payments through PayPal Standard, then Paid Member Subscriptions is going to be a perfect fit for you.

It lets you accept recurring payments through both PayPal and Stripe. In addition, your customers will also be able to pay using their credit cards through PayPal Standard.

Apart from accepting and managing payments, Paid Member Subscriptions offers a whole lot of other features that make it a complete WooCommerce membership plugin.

The easiest way to accept recurring payments through PayPal or Stripe for your WooCommerce subscription products.

Get Paid Member Subscriptions

Custom Payment Gateways Come at a Cost!

Some store owners just want to try and cover as many local payment gateways as they can, without thinking of all the issues that might come with them. They believe having payment options on their store will somehow increase conversions or offer a better customer experience.

But in most cases, it does neither. A lot of customers are going to use their card to make a payment anyway, so you’re going to be covered with a good WordPress payments plugin like Paid Membership Subscriptions as we discussed above.

It would probably be very rare for a customer to not be able to pay via any of the options covered by PayPal and Stripe. So your custom local payment gateways might just be additional payment options for them, and not necessary payment options.

Common Issues Associated with Custom Payment Gateways

In addition, as we mentioned above, you might run into some serious issues with custom payment gateways regardless of whether they would offer any real benefit to you. This is especially true if you’re bad at technical troubleshooting and correcting and modifying snippets of code.

The lack of standard support for these custom payment gateways is going to be a major cause of concern for you. And this might make it difficult for you to offer a seamless payment experience to your customers.

Even if you hire a professional developer to create a WooCommerce custom payment gateway plugin for you, it doesn’t guarantee a foolproof payment integration with your custom payment gateways forever.

If your custom payment gateways make some significant changes on their end, specifically anything that involves their API, you might end up with a broken connection and need help with the code again.

Similarly, smaller, local custom payment gateways going down at random times isn’t exactly uncommon. So is having issues with your account with them that could lead to your account being no longer able to accept payments temporarily.

Managing multiple custom payment gateways is going to be quite a hassle in itself.

All of these issues are going to lead to lost conversions and a loss in revenue. In addition, payment management may turn out to be an entire job too.

All said and done, I’m in no way trying to scare you away from using a custom payment gateway. If there’s a local custom payment option that’s very popular among your customers and you have solid tech support to handle any integration issues then you can certainly add that custom payment gateway to your store.

However, if it’s not necessary and you’re neither good with code yourself nor have someone very good at it assisting you, then it may just not be worth the hassle.

After going through all the analysis we shared above, a lot of store owners may find it pointless to take on the trouble of adding custom payment gateways to their stores. If you’re one of them, know that Paid Member Subscriptions can build a solid payment infrastructure for your store, especially if you’re dealing with subscription or membership payments.

However, even if you’re going to add a WooCommerce custom payment gateway, Paid Member Subscriptions might still be useful. You see, you will likely still need to offer PayPal (if not both PayPal and Stripe) as a payment option to your customers. After all, it’s one of the most popular payment platforms and would handle credit card payments for you. So either way, Paid Member Subscriptions Pro can be a great asset for your WooCommerce store.

It will not only make payment management a breeze for you, but also take care of a lot of other things related to payment and user management. So give it a try today and it will allow you to focus more on the areas of your business that matter the most and bring in the dollars!

Even if you choose to add custom payment gateways to your store, PMS is still going to serve your store in more ways than one, including handling PayPal and Stripe payments.

Get Paid Member Subscriptions

Do you have any more questions on WooCommerce custom payment gateways? Ask them in the comments below!

From the blog

Related Articles

WordPress User Registration

Author: Cristian Antohe
Last Updated: February 24th, 2020

Have you hit a road block when it comes to WordPress user registration? You probably would like to have new users register before being able to take certain actions (for example, posting reviews or commenting) but do not want them to have access to the WordPress Dashboard? Truth is, WordPress User Registration doesn't have to […]

Continue Reading

How to Create WordPress Redirects to Another Page, External URLs, or a Subdomain

Author: Rishi Lodha
Last Updated: June 6th, 2024

There are different reasons WordPress site owners want to create WordPress redirects to another page, external URL, or a subdomain. The redirect can be based on an important user action or set up to redirect all users landing on a particular page. Whatever the type or need of your redirect, WordPress offers the flexibility to […]

Continue Reading

How To Create a bbPress Private Forum and Restrict it Based on Membership Subscription

Author: Patricia Borlovan
Last Updated: September 13th, 2021

In order to build a successful paid membership community with a discussion area, you may want to create a bbPress private forum and restrict access to some content areas, based on subscription plan. If you use both Paid Member Subscriptions and Profile Builder Pro, you have to know that bbPress is fully integrated with both […]

Continue Reading