Download the PHP package mainul/pay-station-disbursement without Composer

On this page you can find all versions of the php package mainul/pay-station-disbursement. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pay-station-disbursement

Laravel bKash Disbursement Package

PHP Version Laravel

mainul/pay-station-disbursement is a Laravel package for the PayStation bKash disbursement API.

It currently implements the two documented endpoints:

Method Endpoint Description
POST /merchant/disbursement/request Disburse money to a bKash account
POST /merchant/disbursement/status Check the status of a disbursement transaction

The package is designed for Laravel 11, 12, and 13, uses Laravel's HTTP client, validates request payloads before sending them, and throws explicit exceptions for configuration, validation, transport, and API-level failures.

Features

Requirements

Installation

Install the package with Composer:

The service provider and facade are registered automatically via Laravel's package auto-discovery.

Publish the config file:

This publishes config/bkash-disbursement.php to your application's config directory.

Configuration

Add these values to your .env file:

Optional configuration (with defaults):

Variable Required Default Description
BKASH_DISBURSEMENT_BASE_URL No https://api.paystation.com.bd API base URL
BKASH_DISBURSEMENT_MERCHANT_ID Yes - Your merchant/store ID
BKASH_DISBURSEMENT_PASSWORD Yes - Pre-hashed password
BKASH_DISBURSEMENT_PORTAL_KEY Yes - Portal authentication key
BKASH_DISBURSEMENT_TIMEOUT No 30 Request timeout (seconds)
BKASH_DISBURSEMENT_CONNECT_TIMEOUT No 10 Connection timeout (seconds)
BKASH_DISBURSEMENT_RETRY_TIMES No 1 Number of retry attempts
BKASH_DISBURSEMENT_RETRY_SLEEP No 200 Delay between retries (milliseconds)

Note: The API requires the password to be sent in hashed form. The package does not hash it for you -- store the pre-hashed value in your environment.

Usage

Disbursement request

Using the DisbursementPayload DTO:

You can also pass a plain array:

Transaction status

Dependency injection

Runtime credential overrides

Useful when your application serves multiple merchants:

Error handling

The package throws specific exceptions so callers can handle failures precisely:

Exception hierarchy

Exception When it's thrown Key properties
RequestValidationException Payload validation fails before the HTTP request errors (array)
InvalidConfigurationException Required credentials are missing -
HttpRequestException Non-2xx HTTP response or connection failure httpStatus, responseBody
ApiException API returns an application-level error payload apiStatusCode, response
UnexpectedResponseException API returns non-JSON or malformed response responseBody

Response objects

DisbursementResponse

Returned by the disburse() method.

Property Type Description
statusCode string API status code
status string Status label (e.g. success)
invoiceNumber string The invoice number sent in the request
amount string Disbursed amount
charge string Transaction charge
transactionId string Unique transaction identifier
transactionTime ?string Timestamp of the transaction
message string Human-readable status message

DisbursementStatusResponse

Returned by the status() method.

Property Type Description
statusCode string API status code
status string Status label
transactionStatus string Transaction status (success or not_found)
invoiceNumber ?string The invoice number
amount ?string Disbursed amount
transactionId ?string Unique transaction identifier
transactionTime ?string Timestamp of the transaction
message string Human-readable status message

Helper methods:

Method Returns Description
isSuccessful() bool true if transactionStatus === 'success'
isNotFound() bool true if transactionStatus === 'not_found'

Validation rules

The DisbursementPayload is validated before each request:

Field Rules
invoice_number required, string
bank_type required, integer, must be 1
bank_id required, integer, min 1
acc_no required, string
amount required, numeric, min 20

Testing

Run the package tests with:

API reference

The package was implemented from the PayStation bKash disbursement API documentation. The two supported endpoints are:

Request headers (sent automatically by the package):

Header Required for
merchantId Both endpoints
password Both endpoints
requestFromMerchantPortalKey Disbursement request only

Disbursement form fields: invoice_number, bank_type, bank_id, acc_no, amount

Status form fields: invoice_number

License

This package is open-sourced software licensed under the MIT license.


All versions of pay-station-disbursement with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
guzzlehttp/guzzle Version ^7.8
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/validation Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mainul/pay-station-disbursement contains the following files

Loading the files please wait ...