PHPackages                             dotlines-io/ghoori-ondemand - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. dotlines-io/ghoori-ondemand

ActiveLibrary[Payment Processing](/categories/payments)

dotlines-io/ghoori-ondemand
===========================

This package can be used for OnDemand Payment integration with Ghoori Platform.

1.1.3(4y ago)015MITPHPPHP ^7.4|^8.0

Since May 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/dotlines-io/ghoori-ondemand)[ Packagist](https://packagist.org/packages/dotlines-io/ghoori-ondemand)[ Docs](https://github.com/dotlines-io/ghoori-ondemand)[ RSS](/packages/dotlines-io-ghoori-ondemand/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (6)Versions (15)Used By (0)

Ghoori OnDemand Package
=======================

[](#ghoori-ondemand-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a1bd4fb461161f748389d27b2e5baa201a358e3e9a2e58814113e426af8cd902/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f746c696e65732d696f2f67686f6f72692d6f6e64656d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dotlines-io/ghoori-ondemand)[![Tests](https://github.com/dotlines-io/ghoori-ondemand/actions/workflows/run-tests.yml/badge.svg)](https://github.com/dotlines-io/ghoori-ondemand/actions/workflows/run-tests.yml)[![Psalm](https://github.com/dotlines-io/ghoori-ondemand/actions/workflows/psalm.yml/badge.svg)](https://github.com/dotlines-io/ghoori-ondemand/actions/workflows/psalm.yml)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/7bae39cb3cc20f9cc02a9f63f8ccb81609f061b3ee57f97f84c1d950f3dc10a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f646f746c696e65732d696f2f67686f6f72692d6f6e64656d616e642f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/dotlines-io/ghoori-ondemand/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/fc0ac555b922de7705ae4930b5966f81ab6a961c7343c24b4eeeae44cf7bca96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f746c696e65732d696f2f67686f6f72692d6f6e64656d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dotlines-io/ghoori-ondemand)[![Total Downloads](https://camo.githubusercontent.com/c1e395515cc7ddfb0c27c6c928b5b09bcec5d16addafc57522600d99f1ffd7fe/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f646f746c696e65732d696f2f67686f6f72692d6f6e64656d616e64)](https://packagist.org/packages/dotlines-io/ghoori-ondemand)

---

This composer package can be used for OnDemand payment integration with [Ghoori](http://ghoori.com.bd) Platform. For the credentials, please contact with  or call 8809612332215

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require dotlines-io/ghoori-ondemand
```

Usage
-----

[](#usage)

```
/**
 * ******************************************************
 * ******************* Token Fetching *******************
 * *********** Contact Ghoori For Credentials ***********
 * ******************************************************
 */
$tokenUrl = 'https:///oauth/token';
$username = '';
$password = '';
$clientID = '';
$clientSecret = '';

$accessTokenRequest = \Dotlines\Ghoori\AccessTokenRequest::getInstance($tokenUrl, $username, $password, $clientID, $clientSecret);
$tokenResponse = $accessTokenRequest->send();
echo json_encode($tokenResponse) . '';

/**
 * Access Token Request Response looks like below:
 * {
 *  "token_type": "Bearer",
 *  "expires_in": 3600,
 *  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdW.....",
 *  "refresh_token": "def50200284b2371cad76b4d2a4e24746c44fd6a322....."
 * }
 */

/**
 * Access Token can be cached and reused for 1 hour
 * Before the end of accessToken lifetime every hour
 * you can use the refresh token to fetch new accessToken & refreshToken
 */
$accessToken = $tokenResponse['access_token'];
$refreshToken = $tokenResponse['refresh_token'];

/**
 * ******************************************************
 * ******************* Charge Request *******************
 * ******************************************************
 */
$chargeUrl = 'https:///api/v2.0/charge';
$orderID = ''; //must be unique for each request
$package = ''; //must be pre-registered with Ghoori
$amount = ''; //must be greater than or equal to BDT 2
$callBackURL = ''; //user will be redirected back this url
$details = ''; //optional
$mobile = ''; //optional
$email = ''; //optional
$reference = ''; //optional
$chargeRequest = \Dotlines\GhooriOnDemand\ChargeRequest::getInstance($chargeUrl, $accessToken, $clientID, $orderID, $package, $amount, $callBackURL, $details, $mobile, $email, $reference);
echo json_encode($chargeRequest->send()) . '';

/**
 * Success Charge Request Response looks like below.
 * You must redirect the user to the "url" for payment.
 * {
 *  "url": "https://sb-payments.ghoori.com.bd/v2.0/pay/BD/bKash?spTransID=5QUWSGRBP41EE46",
 *  "spTransID": "5QUWSGRBP41EE46",
 *  "errorCode": "00",
 *  "errorMessage": "Operation Success"
 * }
 * Fail response only contains errorCode & errorMessage
 */

/**
 * ******************************************************
 * ******************* Status Request *******************
 * ******************************************************
 */
$statusUrl = 'https:///api/v2.0/status';
$spTransID = '';
$statusRequest = \Dotlines\GhooriOnDemand\StatusRequest::getInstance($statusUrl, $accessToken, $clientID, $spTransID);
echo json_encode($statusRequest->send()) . '';

/**
 * Status Request Response looks like below:
 * {
 *  "processingStatus": "CHARGED",
 *  "status": "DONE",
 *  "amount": "10.00",
 *  "errorCode": "00",
 *  "errorMessage": "Operation Successful",
 *  "bKashTransID": "6JS7L72YMV",
 *  "reference": "reference not provided"
 * }
 * Fail response only contains errorCode & errorMessage
 */

/**
 * ******************************************************
 * ******************* Refresh Token *******************
 * ******************************************************
 */
$refreshTokenRequest = \Dotlines\Ghoori\RefreshTokenRequest::getInstance($tokenUrl, $accessToken, $clientID, $clientSecret, $refreshToken);
$tokenResponse = $refreshTokenRequest->send();
echo json_encode($tokenResponse) . '';

/**
 * Refresh Token Request Response looks like below:
 * {
 *  "token_type": "Bearer",
 *  "expires_in": 3600,
 *  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdW.....",
 *  "refresh_token": "def50200284b2371cad76b4d2a4e24746c44fd6a322....."
 * }
 */
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [TareqMahbub](https://github.com/TareqMahbub)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 65.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

14

Last Release

1816d ago

PHP version history (2 changes)v1.0.0PHP ^7.0

1.0.9PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/59867500f5299217fec76ab7e0b813ffcb1e63a4b197ba8f41dd49b2d4df48c3?d=identicon)[TareqMahbub](/maintainers/TareqMahbub)

---

Top Contributors

[![TareqMahbub](https://avatars.githubusercontent.com/u/1318776?v=4)](https://github.com/TareqMahbub "TareqMahbub (36 commits)")[![Mritunjoy71](https://avatars.githubusercontent.com/u/32269388?v=4)](https://github.com/Mritunjoy71 "Mritunjoy71 (15 commits)")[![afsara-ben](https://avatars.githubusercontent.com/u/44926095?v=4)](https://github.com/afsara-ben "afsara-ben (4 commits)")

---

Tags

dotlines-iodotlinesghoori-ondemand

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dotlines-io-ghoori-ondemand/health.svg)

```
[![Health](https://phpackages.com/badges/dotlines-io-ghoori-ondemand/health.svg)](https://phpackages.com/packages/dotlines-io-ghoori-ondemand)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
