Welcome to Fentas Pay Docs

Last updated: 2024-06-06

Fentas Pay is a simple and Secure payment automation tool which is designed to use personal account as a payment gateway so that you can accept payments from your customer through your website where you will find a complete overview on how Fentas Pay works and how you can integrate Fentas Pay API in your website.

API Introduction

Fentas Pay Payment Gateway enables Merchants to receive money from their customers by temporarily redirecting them to www.Fentas Pay.com. The gateway is connecting multiple payment terminal including card system, mobile financial system, local and International wallet. After the payment is complete, the customer is returned to the merchant's site and seconds later the Merchant receives notification about the payment along with the details of the transaction. This document is intended to be utilized by technical personnel supporting the online Merchant's website. Working knowledge of HTML forms or cURL is required. You will probably require test accounts for which you need to open accounts via contact with Fentas Pay.com or already provided to you.

API Operation

REST APIs are supported in two environments. Use the Sandbox environment for testing purposes, then move to the live environment for production processing. When testing, generate an order url with your test credentials to make calls to the Sandbox URIs. When you’re set to go live, use the live credentials assigned to your new signature key to generate a live order url to be used with the live URIs. Your server has to support cURL system. For HTML Form submit please review after cURL part we provide HTML Post method URL also

Live API End Point (Create Payment) https://pay.meghx.site/api/payment/create
Payment Verify API https://pay.meghx.site/api/payment/verify

Parameter Details

Variables Need to POST to Initialize Payment Process in gateway URL.

Field Name Description Required Example
cus_name Customer Full Name Yes John Doe
cus_email Email address of the customer Yes john@gmail.com
amount The total amount payable. Please note that you should skip the the trailing zeros in case the amount is a natural number. Yes 10 or 10.50 or 10.6
success_url URL to which the customer will be returned when the payment is made successfully. The customer will be returned to the last page on the Merchant's website where he should be notify the payment successful. Yes https://yourdomain.com/sucess.php
cancel_url URL to return customer to your product page or home page. Yes https://yourdomain.com/cancel.php
meta_data Pass any json formatted data No Json Formated
Variables Needs For Payment Verify
transaction_id Transaction id received as a query parameter from the success URL provided during payment creation. Yes OVKPXW165414

Required Headers

Header Name Value
Content-Type application/json
API-KEY Your App Key
SECRET-KEY Your Secret Key
BRAND-KEY Your Brand Key

Integration

You can integrate our payment gateway into your PHP Laravel WordPress WooCommerce sites.

Sample Request


<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://pay.meghx.site/api/payment/create',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{
    "success_url":"yourdomain.com/success",
    "cancel_url":"yourdomain.com/cancel",
    "metadata":{"phone":"016****"},
    "amount":"10"
}',
    CURLOPT_HTTPHEADER => array(
        'API-KEY: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef',
        'Content-Type: application/json',
        'SECRET-KEY: YourSecretKeyHere',
        'BRAND-KEY: YourBrandKeyHere'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

Response Details

Field Name Type Description
Success Response
status bool TRUE
message String Message for Status
payment_url String Payment Link (where customers will complete their payment)
Error Response
status bool FALSE
message String Message associated with the error response
Completing Payment Page task you will be redirected to success or cancel page based on transaction status with the following Query Parameters:

yourdomain.com/(success/cancel)?transactionId=******&paymentMethod=***&paymentAmount=**.**&paymentFee=**.**&status=pending/success/failed

Verify Request


<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://pay.meghx.site/api/payment/verify',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{"transaction_id":"ABCDEFH"}',
    CURLOPT_HTTPHEADER => array(
        'API-KEY: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef',
        'Content-Type: application/json',
        'SECRET-KEY: Secret key From API credentials',
        'BRAND-KEY: Brand key From Brands'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
Sample Response
{
    "cus_name": "John Doe",
    "cus_email": "john@gmail.com",
    "amount": "900.000",
    "transaction_id": "OVKPXW165414",
    "metadata": {
      "phone": "015****",
    },
    "payment_method": "bkash",
    "status": "COMPLETED"
}

Response Details

Field Name Type Description
Success Response
status string COMPLETED or PENDING or ERROR
cus_name String Customer Name
cus_email String Customer Email
amount String Amount
transaction_id String Transaction id Generated by System
metadata json Metadata used for Payment creation
Error Response
status bool FALSE
message String Message associated with the error response

Modules & Plugins

WooCommerce Plugin

Integrate our payment gateway into your WordPress/WooCommerce store effortlessly.

Download Plugin

WHMCS Module

Seamlessly accept payments in your WHMCS hosting business automation platform.

Download Module

SMM Panel

Streamline payments for your social media marketing services panel.

Download Module

Sketchware SWB

Integrate NobabPay directly into your Android app projects using Sketchware.

Ready to start?