sabitahmad/laravel-bkash
Integrate bKash payments in Laravel (API v1.2.0) with tokenized and regular checkout, sandbox/production switching, auto token refresh, payment and agreement operations (create/execute/query/refund/search), transaction logging, retries, and validation.
PaymentCompleted, PaymentFailed, AgreementCreated), enabling decoupled workflows (e.g., notifications, order processing).SabitAhmad\Bkash\Facades\Bkash), reducing direct API dependency and simplifying future upgrades..env and published config files, adhering to Laravel’s 12-factor principles and simplifying environment-specific setups./bkash/callback endpoint, requiring minimal customization for webhook processing.BkashException) and retries for resilience.BKASH_TOKEN_CACHE_TTL) could disrupt payments.BKASH_CALLBACK_URL to prevent CSRF or replay attacks.PaymentCompleted) can trigger queued jobs (e.g., order fulfillment).composer require sabitahmad/laravel-bkash.php artisan vendor:publish --tag="laravel-bkash-migrations,laravel-bkash-config"..env with bKash credentials and URLs.createPayment flow.Bkash facade).https://yourdomain.com/bkash/callback).createPayment for regular payments.BKASH_RETRY_ATTEMPTS) and timeouts (BKASH_TIMEOUT) based on load testing.BKASH_TOKEN_CACHE_TTL) reduces API calls but may need tuning for high throughput.BKASH_RETRY_ATTEMPTS).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| bKash API downtime | Payments fail | Implement retry logic; provide manual payment options. |
| Callback URL unreachable | Unconfirmed payments | Monitor callback health; use webhook validation (e.g., HMAC). |
| Token refresh failure | Broken tokenized payments | Alert on failed refreshes; fall back to regular payments. |
| Database migration issues | Lost transaction logs | Backup logs before migrations; use feature flags for rollouts. |
| Invalid callback data (CSRF/replay) | Fraudulent transactions | Validate request signatures; rate-limit callbacks. |
| High latency in payment execution | Poor UX | Set realistic timeouts (BKASH_TIMEOUT); inform users of processing delays. |
Bkash::createPayment, Bkash::executeAgreement).PaymentCompleted.How can I help you explore Laravel packages today?