Website Building » Shopify » How Do I Create a Custom Payment Gateway in Shopify?

How Do I Create a Custom Payment Gateway in Shopify?

Last updated on January 8, 2023 @ 6:34 am

Are you looking to add a custom payment gateway to your Shopify store? Maybe you’re using a new payment processor that isn’t supported by Shopify’s default gateways.

Or maybe you’re just looking for a way to give your customers more payment options. Whatever the reason, adding a custom payment gateway to your Shopify store is a relatively easy process. In this article, we’ll walk you through the steps of creating a custom payment gateway in Shopify.

Creating a custom payment gateway in Shopify requires two main components:

1. A Custom Payment Provider: This is the company or service that will actually be processing your payments.
You’ll need to sign up for an account with them and get all of the necessary credentials (API keys, etc.) before proceeding.

2. A Custom Payment Gateway: This is the actual gateway that will be integrated into your Shopify store.
You can think of it as the bridge between your shop and the payment provider. It’s what will allow you to take payments via the provider you’ve chosen.

PRO TIP: Please be aware that creating a custom payment gateway in Shopify is a complex process and is not recommended for beginners. If you are not comfortable with coding, we recommend finding a Shopify Expert to help you with this task.

The first step is to create a new file in your shop’s “Config” directory. The file should be named “custom_payment_gateway.<name_of_your_gateway>.json”. In this file, you’ll need to specify some basic information about your gateway, including its name, display name, and whether or not it supports partial refunds:

{
  "name": "Custom Gateway",
  "display_name": "Custom Gateway",
  "supports_partial_refunds": true
}

Next, you'll need to create a new file in your shop's "Settings" directory. The file should be named "<name_of_your_gateway>. In this file, you'll need to specify some basic information about your gateway, including its name, display name, and whether or not it supports partial refunds:

{
  "name": "Custom Gateway",
  "display_name": "Custom Gateway",
  "api_key": "<your_api_key>", //provided by your payment provider
  .. //other settings as specified by your payment provider  
}

With those two files in place, you should be able to activate your custom payment gateway in the Shopify admin panel. Just go to "Settings > Payments" and select it from the list of available gateways. After that, you should be able to start taking payments through your new gateway!

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.