How to integrate custom payment gateways with Balbooa Joomla Forms?

In this step-by-step tutorial, we'll show you how to integrate 3rd party payment gateways to Balbooa Joomla Forms.


1. Go to: components ➝ com_baforms ➝ libraries ➝ custom-payment-gateway ➝ custom-payment-gateway.xml.

<payment>
    <label>PayPal Payment</label>
    <path>media/paypal/paypal.php</path>
    <class>payPal</class>
</payment>



2. Create paypal.php file in the specified location with a custom Payment Gateway Class. Class must contain a method with 1 argument which accepts payment data:

class payPal
{
    public function executePayment($paymentData)
    {
        //Code to execute payment
    }
}



$paymentData is a object with such properties:

{
    "id": 1,
    "userEmail": "example @ mail.com"
    "total" => 260
    "products": [
    	{
    		"title": "Product 1",
            "price": 30,
            "quantity": 1,
            "total": 30
    	},
    	{
    		"title": "Product 2",
            "price": 50,
            "quantity": 2,
            "total": 100
    	},
    	{
    		"title": "Shipping",
    		"quantity": 1,
            "price": 25,
            "total": 25
    	},
    ],
    "title": "Field title",
    "code": "Entered currency code",
    "discount": "Discount amount",
    "shipping": {
    	"price": 25
        "title": "Shipping"
    }
}