Adding a new payment gateway

JoomBri comes with PayPal, Bank Transfer,, MoneyBookers/Skrill and 2Checkout. But our system can support integration with any gateways without altering the core files. Follow the simple steps below carefully to integrate your desired payment gateway.


  1. We assume that you are using JoomBri Freelance v2.1 Stable & above.
  2. The below document is explained for the gateway Hello.


Download the skeleton or the prototype of the Hello payment gateway to quickly get started.

Hello Payment Gateway

Files Structure

  • files_hello
    • forms
      • hello.xml
    • images
      • hello.png
    • language
      • en-GB
        • en-GB.files_hello.sys
    • class.hello.php
    • index.html
    • install.sql
    • script.php

The explanation of the above file structures is given below.

1: forms → hello.xml

Create an XML file which stores the settings specific for each payment gateway like account ID, merchant ID, etc. The name of the file should be [gatewaycode].xml (for example, paypal.xml). The gateway code is assumed in Step 1. A sample XML file is given below.

<?xml version="1.0" encoding="UTF-8"?>
	<fieldset name="settings">
		<field type="text" name="publisherKey" label="Publisher Key" description="You can get the key from Dashboard -> Account -> API Keys" default="" class="required input-large" />
		<field type="text" name="secretKey"  label="Secret Key" description="You can get the key from Dashboard -> Account -> API Keys" default="" class="required input-large" />
		<field type="text" name="currencyCode" default="USD" label="Currency" description="Currency supported by Stripe" class="required input-mini" />

2: images → hello.png

This should be a png file having a size (approx) 200px x 85px

3: language → en-GB → en-GB.files_hello.sys

A sample of language file is given below.

; JoomBri Freelance
; Copyright (C) 2012 - 2020 BriTech Solutions. All rights reserved.
; License GNU General Public License version 2 or later
; Note : All ini files need to be saved as UTF-8 - No BOM
FILES_HELLO="JoomBri - Hello Payment"
FILES_HELLO_DESC="Hello payment gateway integration with JoomBri Freelance."

4: class.hello.php

This step is very important which creates the payment form, process the payment, etc. Create a PHP file in the name class.[gatewaycode].php (for example, class.paypal.php).

Explanation of PHP File

The explanation of the file is given above each function name. You need appropriate integration guide of payment gateway to find how the payment form is submitted and payment is validated.

 * @company		:	BriTech Solutions
 * @created by	:	JoomBri Team
 * @contact		:, This email address is being protected from spambots. You need JavaScript enabled to view it.
 * @created on	:	24 May 2020
 * @file name	:	gateways/class.hello.php
 * @copyright   :	Copyright (C) 2012 - 2016 BriTech Solutions. All rights reserved.
 * @license     :	GNU General Public License version 2 or later
 * @author      :	JoomBri Support
 * @description	: 	Payment processing gateway for Hello (jblance)
defined('_JEXEC') or die('Restricted access');
class hello_class {
	var $fields = array();
	var $payconfig = array();
	var $details = array();
	 * Constructor function which initiates certain variable.
	function hello_class($payconfig, $details){
		$this->payconfig = $payconfig;
		$this->details = $details;
	 * This function is called before making the payment. 
	 * It creates the payment form which is submitted to the payment gateway.
	 * Note: Submission of payment form will vary from one gateway to other.
	function helloPayment(){
		// The following variables will vary depending on the variable used in hello.xml.
		$payconfig   = $this->payconfig;
		$publisherKey  = $payconfig->publisherKey;
		$secretKey = $payconfig->secretKey;
		$currencyCode = $payconfig->currencyCode;
 		$details = $this->details;
		$amount = $details['amount'];
		$taxrate = $details['taxrate'];
		$orderid = $details['orderid'];
		$itemname = $details['itemname'];
		$item_num = $details['item_num'];
		$invoiceNo = $details['invoiceNo'];
		$link_status = JURI::base().'index.php?option=com_jblance&task=membership.returnafterpayment&gateway=hello';
		$link_cancel = JRoute::_(JURI::base().'index.php?option=com_jblance&view=membership&layout=thankpayment&type=cancel');
		$this->submit_hello_post(); // auto submit the fields to hello
	 * This function is called after the payment from the gateway.
	 * It return true and invoice number if the payment is successful 
	function helloReturn($data){
		$return = array();
			// get the invoice number from the POST variable. Getting the invoice will be different for gateways.
			$invoice_num = array_key_exists('invoice', $data) ? $data['invoice'] : '';
			$return['success'] = true;
			$return['invoice_num'] = $invoice_num;
			$return['success'] = false;
		return $return;
	 * This function validates the payment.
	 * It returns true if the payment verification is successful
	 * Otherwise, returns false
	function validate_ipn($data){
		// validate the payment	here

5: hello.xml

This manifest file includes the general installation information of the package file.
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.9" type="file" method="upgrade">
	<creationDate>24 May 2020</creationDate>
	<author>JoomBri Team</author>
	<copyright>Copyright (C) 2012 - 2020 BriTech Solutions. All rights reserved.</copyright>
	<license> GNU/GPL</license>
	<authorEmail>This email address is being protected from spambots. You need JavaScript enabled to view it.</authorEmail>
	       		<file driver="mysql" charset="utf8">install.sql</file>
		<files target="components/com_jblance/gateways">
		<files folder="forms" target="components/com_jblance/gateways/forms">
		<files folder="images" target="components/com_jblance/gateways/images">
		<files target="administrator/manifests/files/hello">
		<language tag="en-GB">language/en-GB/en-GB.files_hello.sys.ini</language>

6: install.sql

Replace the following SQL script with the payment gateway you want to integrate.

INSERT INTO `#__jblance_paymode` (gateway_name, published, ordering, shortcode, gwcode, is_withdraw, withdrawFeeFixed, withdrawDesc, depositfeeFixed, depositfeePerc, params, withdrawFeePerc, is_subscription, is_deposit) VALUES ('Hello', TRUE, 5, 'HLO', 'hello', FALSE, 0.0, 'Withdraw funds to your Hello account.', 0.3, 2.9, '{}', 0.0, TRUE, TRUE);

7: script.php

This file is reserved for the future user and it can be empty.

8: Installation

Archive the above files into and install the package.

© Copyright 2012 - 2023 BriTech Solutions. All rights reserved.