Welcome To Greenpaybd Docs Last updated: 2023-01-01

Greenpaybd 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 Greenpaybd works and how you can integrate Greenpaybd API in your website


API Introduction

Greenpaybd Payment Gateway enables Merchants to receive money from their customers by temporarily redirecting them to www.Greenpaybd.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 Greenpaybd.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 (Using cURL):

https://pay.Greenpaybd.com/checkout.php

Live API End Point (Using cURL):

https://pay.greenpaybd.com/woocommerce_checkout.php

Parameter Details

Variables Need to POST to Initialize Payment Process in gateway URL

Field Name Description Required Example Values
apikey Api Key will be provided by Greenpaybd Yes dc0c2802bf04
clientkey Client Key will be provided by Greenpaybd Yes d2ab3336ec
secretkey Secret Key will be provided by Greenpaybd Yes 123456789
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
cus_name Customer Full Name Yes Mr. ABC
cus_email Email address of the customer who is making the payment. Yes abc@gmail.com
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

Sample Response

Error Response Parameters

Property Description Type
status Successful string
statusMSG Message associated with the status, explaining the status. string
statusCode Unique code assigned to the API call status. string

Sample Request

Sample Request

							
				Sample Request
				 'https://pay.greenpaybd.com/checkout.php',
					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 => array(
						'api' => $apikey,
						'client' => $clientkey,
						'secret' => $secretkey,
						'amount' => $amount,
						'success_url' => $success_url,
						'cancel_url' => $cancel_url,
						'cus_name' => $cus_name,
						'cus_email' => $cus_email
					),
				));
				$response = curl_exec($curl);
				curl_close($curl);
				echo $response;
				?>
							
						

Sample Request

							
				Sample Request
				 'https://pay.greenpaybd.com/checkout.php',
    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 => array('api' => $apikey,'client' => $clientkey,'secret' => $secretkey,'amount' => $amount,'position' => $hostname,'success_url' => $success_url,'cancel_url' => $cancel_url,'cus_name' => $cus_name,'cus_email' => $cus_email),
    ));
    $response = curl_exec($curl);
    curl_close($curl);
    echo $response;
?>
							
						

Sample Request

							
				Verify success;
			 'https://pay.greenpaybd.com/verify.php',
    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 => array('transaction_id' => $transaction_id_greenpaybd),
    ));
    $response = curl_exec($curl);
    curl_close($curl);
    
    if($response == 1){
    	echo "success";
    }else{
         echo "Failed. Id Not Match";
    }

?>
							
						

Integration

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

cURL PHP Code Example

Smart SMM Panel Code

Laravel Full Module

Laravel Code Example

Javascript Code Example

Woocomerce Plugin 1.6 - Ecommerce Type Website

See Setup Video: Youtube Video

Woocomerce Plugin 1.6 - Digital Product Selling Type Website

See Setup Video: YouTube Video

WHMCS Module 1.5

See Setup Video: Video herek

SmmPanel Module (All Panel Supported) 1.3

See Setup Video: Video Here

SmmPanel Module (All Panel Supported) 1.8

See Setup Video: Video here/