Download the PHP package mainul12501/bkash-payment-b2c without Composer
On this page you can find all versions of the php package mainul12501/bkash-payment-b2c. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package bkash-payment-b2c
Laravel bKash Gateway
Laravel 11, 12, and 13 package for bKash payment gateway integrations, covering the public flows exposed in bKash's current developer docs and guides.
Features
- Checkout (URL based) Regular sale payment Auth and capture Void Query payment Search transaction Refund
- Tokenized checkout Grant token Refresh token Create agreement Execute agreement Query agreement Cancel agreement Create payment Execute payment Confirm payment Query payment Search transaction Refund Refund status helper
- Disbursement and wallet operations B2C payout to customer Organization balance query Intra-account transfer B2B merchant payout B2B payout initiation
- Integration helpers Automatic token caching and refresh retry Raw request escape hatch for undocumented or newly-added endpoints Webhook payload parsing and optional shared-secret check
Requirements
- PHP 8.2+
- Laravel 11, 12, or 13
Installation
Configuration
Default config file: config/bkash.php
Minimal .env example:
The sandbox and production URLs have sensible defaults in the config file. Override them only if bKash changes the endpoints:
If bKash gives you different credentials per service, set the service-specific keys:
Usage
Facade entry point
Checkout payment
The public checkout create-payment reference shows these required body fields:
amountcurrencyintentmerchantInvoiceNumber
Example:
Execute, capture, query, void
Search transaction
Refund
Tokenized checkout
The tokenized reference is structured differently from checkout. The package exposes both generic and convenience methods so you can mirror the exact request body from your bKash onboarding docs.
Tokenized agreement and payment queries
Tokenized refund and refund status
Note:
- The current bKash public guide for refund status is not modeled in the same embedded OpenAPI schema as the main reference pages.
- The guide currently shows
{{tokenized_url}}/v2/tokenized-checkout/refund/payment/status. - If your merchant onboarding doc uses a different refund-status path, override it per call:
B2C payout
The B2C payout guide documents these required fields:
amountcurrencymerchantInvoiceNumberreceiverMSISDN
Organization balance
Intra-account transfer
The public guide documents transferType as one of:
Collection2DisbursementDisbursement2Collection
B2B payout
The public B2B payout guide is a two-step flow.
Step 1: initiate
Step 2: B2B payout
Raw request escape hatch
This package intentionally includes a low-level method because bKash sometimes documents flows in guide pages before the embedded API reference catches up.
For absolute paths outside the service base version:
Webhooks
The package provides a simple parser and optional shared-secret header check.
Response handling
All gateway methods return Mainul12501\Bkash\Support\BkashResponse.
Error handling
Failed HTTP responses throw Mainul12501\Bkash\Exceptions\BkashRequestException.
Notes
- bKash's product overview currently states TLS 1.2+ only.
- Sandbox and production use different hostnames.
- Checkout and tokenized references expose different schemas and path styles.
- B2B payout is documented in guide pages instead of the same embedded OpenAPI model used by checkout and tokenized reference pages.
- Subscriptions and add-wallet are mentioned in product overview, but their public API details were not exposed in the fetched docs set above. Use
Bkash::raw()when bKash provides merchant-specific endpoint details.
Package API Summary
Bkash::checkout()
grantToken(): arrayrefreshToken(): arraycreatePayment(array $payload): BkashResponseexecutePayment(string $paymentID): BkashResponsecapturePayment(string $paymentID): BkashResponsequeryPayment(string $paymentID): BkashResponsevoidPayment(string $paymentID): BkashResponsesearchTransaction(string $trxID): BkashResponserefund(array $payload): BkashResponseb2cPayment(array $payload): BkashResponseorganizationBalance(): BkashResponseintraAccountTransfer(array $payload): BkashResponse
Bkash::tokenized()
grantToken(): arrayrefreshToken(): arraycreate(array $payload): BkashResponsecreateAgreement(array $payload): BkashResponsecreatePayment(array $payload): BkashResponseexecute(array $payload): BkashResponseexecuteAgreement(array $payload): BkashResponseexecutePayment(array $payload): BkashResponsequeryAgreement(array|string $agreement): BkashResponsecancelAgreement(array|string $agreement): BkashResponseconfirmPayment(string $confirmationType, array $payload): BkashResponsequeryPayment(array $payload): BkashResponsesearchTransaction(array|string $trx): BkashResponserefund(array $payload): BkashResponserefundStatus(array $payload, ?string $path = null): BkashResponse
Bkash::payouts()
grantToken(): arrayrefreshToken(): arrayinitiate(array $payload): BkashResponseb2b(array $payload): BkashResponse
Bkash::webhooks()
parse(string $payload): arrayfromRequest(Request $request): arrayhasMatchingSecret(Request $request, ?string $expected = null, ?string $header = null): boolassertMatchingSecret(Request $request, ?string $expected = null, ?string $header = null): void
All versions of bkash-payment-b2c with dependencies
illuminate/cache Version ^11.0|^12.0|^13.0
illuminate/config 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