Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Bkash

Laravel Bkash Laravel Package

sabitahmad/laravel-bkash

Integrate bKash payments into Laravel with full API v1.2.0 support: tokenized and regular checkout, agreements, refunds, queries, token refresh, transaction logging, events, and sandbox/production modes.

View on GitHub
Deep Wiki
Context7

Laravel bKash is a comprehensive package that brings full bKash API v1.2.0 integration to your Laravel applications. It supports both tokenized checkout (agreement-based) and regular checkout flows, with seamless switching between sandbox and production environments. Configure your merchant credentials through environment variables and handle every response with a clean, consistent API.

  • Complete payment operations: create, execute, query, refund, and search
  • Agreement management for faster tokenized repeat payments
  • Automatic token refresh with retry and timeout handling
  • Database transaction logging and Laravel event integration
  • Strict, configurable parameter validation
Frequently asked questions about Laravel Bkash
How do I install and configure laravel-bkash in a Laravel application?
Install it with composer require sabitahmad/laravel-bkash, then publish the migrations and config using php artisan vendor:publish for the laravel-bkash-migrations and laravel-bkash-config tags. Run php artisan migrate and set BKASH_APP_KEY, BKASH_APP_SECRET, BKASH_USERNAME, BKASH_PASSWORD, BKASH_SANDBOX, and callback/base URL values in .env. The published config controls sandbox mode, transaction logging, credentials, and base URLs.
Which Laravel and PHP versions does sabitAhmad/laravel-bkash support?
The README lists PHP 8.0+ and Laravel 8.x+ as requirements, while the technical evaluation describes modern Laravel 9.x+ stacks. Check the package constraints and test on your exact Laravel version before adopting it.
How do I switch laravel-bkash between sandbox and production mode?
Set BKASH_SANDBOX=true for sandbox testing and false for production, and provide the matching bKash credentials and base URLs. Keep the callback URL environment-specific so sandbox and live payments return to the correct endpoint. The package reads these values through config/laravel-bkash.php and your .env file.
What is the difference between regular checkout and tokenized checkout in laravel-bkash?
Regular checkout follows bKash's traditional payment flow, while tokenized checkout uses agreement management to support faster or recurring payments. Use tokenized checkout when you need saved agreements for subscribers; use regular checkout for one-off payments. Both flows are supported through the Bkash facade and API v1.2.0 operations.
How does laravel-bkash handle bKash token refresh and retries?
The package includes advanced token management with automatic refresh and retry mechanisms, plus network resilience through retries and timeout handling. Token behavior is configurable, including cache-related settings such as BKASH_TOKEN_CACHE_TTL. Review those settings carefully because token misconfiguration can interrupt payment flows.
How do I handle the bKash callback URL in Laravel with this package?
The package provides a structured /bkash/callback endpoint, and you should configure BKASH_CALLBACK_URL to a secure, environment-specific URL. In testing, validate callback handling with mock webhooks and sandbox payments. Use the PaymentCompleted and PaymentFailed events to trigger order updates or notifications after callbacks.
Does laravel-bkash log transactions to the database for auditing?
Yes. The package includes migrations for transaction logging with enhanced tracking, and logging can be controlled with BKASH_LOG_TRANSACTIONS. These records support audit trails and debugging, but financial or regulatory compliance may still require additional controls and retention policies.
What events does laravel-bkash fire for payments and agreements?
The package fires Laravel events including PaymentCompleted, PaymentFailed, and AgreementCreated. You can listen for these events to decouple order processing, notifications, and other workflows, including queued jobs.
Is sabitAhmad/laravel-bkash safe for production use with bKash API v1.2.0?
It is an unofficial, MIT-licensed package that is actively maintained, with a recent release noted as 2025-09-24. It abstracts bKash API v1.2.0 and includes sandbox/production separation, exception handling, retries, and event support. Risks include dependence on bKash API changes, token/callback misconfiguration, and limited adoption, so test thoroughly in sandbox and monitor production.
Can I use laravel-bkash for refunds, payment queries, and agreement cancellation?
Yes. The package supports payment create, execute, query, refund, and search operations, plus agreement create, execute, query, and cancel. These operations are exposed through the Bkash facade with detailed BkashException error handling.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections