Skip to main content

Creating a Payment Gateway Module

d
Written by dhru soft
Updated over 3 months ago

You can integrate your own payment gateway into DHRU FUSION by creating a custom gateway module. This guide walks you through the steps to build one using the provided development kit.


Getting Started

1. Download the Gateway Development Kit

📁 (Download)

2. Unzip the Kit

Locate the file named customgateway.php.

3. Rename the File

Rename customgateway.php to your preferred gateway name (e.g., mygateway.php).

• The filename must be all lowercase

• The filename must start with a letter

4. Update Function Names

Open the renamed file and replace all instances of customgateway_ with your chosen gateway name (e.g., mygateway_).


Configuration Array

The yourgatewayname_config() function defines the settings for your payment gateway module.

This array includes:

Display name

Configuration fields like:

• text (single-line input)

• textarea (multi-line input)

• dropdown (select menu)

• yesno (checkbox)

💡 Refer to the example in customgateway.php which uses PayPal as a reference.


Creating the Gateway Payment Button

Create a new function:

function yourgatewayname_link($params)

This function should:

• Return a string of HTML (usually a form)

• Use $params to access the necessary values (e.g., amount, invoice ID, return URL)

• Build the correct POST form to send data to your payment processor

Refer to the sample gateway in the dev kit for structure and logic.


Callbacks (IPN/Notifications)

A sample callback script is included in the development kit:

• File: customgatewaycallback.php

To use it:

1. Rename it to match your gateway (e.g., mygatewaycallback.php)

2. Edit the variables inside the file to match your payment provider’s return parameters

3. Use the comments in the file as a guide to customize the logic accordingly

Did this answer your question?