Download the PHP package sabitahmad/laravel-bkash without Composer

On this page you can find all versions of the php package sabitahmad/laravel-bkash. 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 laravel-bkash

Laravel bKash Payment Gateway Integration

Latest Version on Packagist Total Downloads

A comprehensive solution for integrating bKash payments into Laravel applications.

Table of Contents


Features

Requirements


Installation

You can install the package via composer:

You can publish and run the migrations with:

You can publish the config file with:

This is the contents of the published config file:

Optionally, you can publish the views using

[//]: # ()

Configuration

Add the following environment variables to your .env file:

Usage

Agreement Management (Tokenized Checkout)

Create Agreement

Execute Agreement

Payment Operations

Create Payment (Regular)

Create Payment (Tokenized with Agreement)

Execute Payment

Handle Callback

Additional Operations

Refund Payment

Query Payment Status

Search Transaction

Refund Status Check

Agreement Operations

Using the Helper Class

Response Methods

BaseResponse Methods (Available in All Response Classes)

Method Returns Description
isSuccess() bool Whether operation succeeded
hasError() bool Whether operation has error
getErrorMessage() ?string Error message if failed
getStatusCode() ?string bKash status code
getStatusMessage() ?string bKash status message
getErrorCode() ?string bKash error code
getRawData() array Complete API response
toArray() array Response as array

PaymentResponse Methods

Method Returns Description
getPaymentId() ?string Payment ID
getPaymentUrl() ?string Redirect URL for payment
getTrxId() ?string bKash transaction ID
getAmount() ?float Transaction amount
getCustomerMsisdn() ?string Customer phone number
getTransactionStatus() ?string "Completed"/"Failed" etc
getInvoiceNumber() ?string Merchant invoice number
getPayerReference() ?string Payer reference
getCurrency() ?string Transaction currency
getIntent() ?string Payment intent
getMode() ?string Payment mode
getPaymentExecuteTime() ?Carbon Execution timestamp
getCreateTime() ?Carbon Creation timestamp
getUpdateTime() ?Carbon Last update timestamp
isCompleted() bool Whether payment completed
isCancelled() bool Whether payment cancelled
isFailed() bool Whether payment failed

AgreementResponse Methods

Method Returns Description
getAgreementId() ?string Agreement ID
getAgreementUrl() ?string Redirect URL for agreement
getAgreementStatus() ?string Agreement status
getPayerReference() ?string Payer reference
getCustomerMsisdn() ?string Customer phone number
getAgreementExecuteTime() ?Carbon Agreement execution time

RefundResponse Methods

Method Returns Description
getRefundId() ?string Refund transaction ID
getOriginalPaymentId() ?string Original payment ID
getRefundAmount() ?float Refunded amount
getTransactionStatus() ?string Refund status
getRefundTime() ?Carbon Refund timestamp
getCharge() ?float Refund charge
getTrxId() ?string Transaction ID
getPaymentId() ?string Payment ID
getCurrency() ?string Currency
getReason() ?string Refund reason

QueryResponse Methods

Method Returns Description
getPaymentId() ?string Payment ID
getTrxId() ?string Transaction ID
getTransactionStatus() ?string Current payment status
getAmount() ?float Transaction amount
getCustomerMsisdn() ?string Customer phone number
getMerchantInvoiceNumber() ?string Invoice number
getCurrency() ?string Transaction currency
getIntent() ?string Payment intent
getInitiationTime() ?Carbon Transaction initiation time
getCompletedTime() ?Carbon Transaction completion time
isCompleted() bool Whether transaction completed
isCancelled() bool Whether transaction cancelled
isFailed() bool Whether transaction failed

SearchResponse Methods

Method Returns Description
getTransactions() array Array of transactions
getTransactionCount() int Number of transactions
getFirstTransaction() ?array First transaction
getTransactionByTrxId() ?array Find transaction by trx ID
getTransactionByPaymentId() ?array Find transaction by payment ID

Controller Example

See examples/BkashController.php for a complete implementation example showing:

Events

The package dispatches the following events:

You can listen to these events in your EventServiceProvider:

Configuration Options

The package supports extensive configuration options:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Upgrading from 2.0 to 2.1

If you are upgrading from v2.0.x, please note the following changes:

  1. Config File Updates: The urls configuration array has been simplified. If you previously published the config file, you may want to republish it or update your config to use the new base_url and endpoints format. The package maintains backward compatibility for existing configurations.
  2. Database Migrations: The bkash_payments table has two new columns: payer_reference and invoice_number. Please publish the updated migration and run php artisan migrate.
  3. Status Constants: We recommend replacing hardcoded magic strings (e.g., 'Completed') with the new SabitAhmad\Bkash\Enums\TransactionStatus class constants.
  4. Interface Injection: You can now type-hint SabitAhmad\Bkash\Contracts\BkashInterface instead of the concrete Bkash class.

Recent Improvements

Version 2.2.0

Version 2.1.0

Version 2.0.0

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-bkash with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^8.0|^9.0|^10.0|^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 sabitahmad/laravel-bkash contains the following files

Loading the files please wait ...