Download the PHP package codetay/bankapi-laravel without Composer
On this page you can find all versions of the php package codetay/bankapi-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package bankapi-laravel
codetay/bankapi-laravel
Laravel bridge for codetay/bankapi-php: auto-registered
service provider, a BankApi facade, and a webhook-verifying middleware.
Install
The service provider (BankApi\Laravel\BankApiServiceProvider) is
auto-discovered. Publish the config file:
This creates config/bankapi.php. Set these environment variables:
Set BANKAPI_BASE_URL to your organization host (https://<your-org-slug>.bankapi.vn):
org-scoped operations (banking, webhook endpoints) are rejected with a 403 on
a non-organization host.
BANKAPI_WEBHOOK_SECRET is the secret shown once when you create a webhook
endpoint (see the core SDK README) — required only if you use the webhook
middleware.
The base URL must be https (plain http only for loopback hosts in local
development) — the API key travels on every request, so anything else is
refused at boot.
When Guzzle is installed, the package builds its HTTP client with bounded
timeouts and redirect following turned off (the API key rides in the
X-API-Key header, which Guzzle does not strip when a redirect changes host).
Tune the timeouts if your network needs it:
Facade usage
The facade resolves the same singleton BankApi\BankApi instance the
container builds from config/bankapi.php; you can also type-hint
BankApi\BankApi for constructor injection instead of the facade.
Webhook route
Register a route and attach the bankapi.webhook middleware alias. On
success it verifies the signature, puts the decoded event on the request as
bankapi_event, and dispatches a BankApi\Laravel\Events\BankApiWebhookReceived
event; on failure it aborts the request with 400 (bad signature) or 500
(webhook secret not configured).
CSRF exclusion
Webhook requests come from BankAPI's servers, not a browser session, so the route must be excluded from CSRF verification:
Laravel 11+ (in bootstrap/app.php):
Laravel 10 (in app/Http/Middleware/VerifyCsrfToken.php):
Handling the event
Prefer a queued listener over handling the webhook inline in the route, so
BankAPI gets a fast 2xx and retries don't pile up. Dedupe on
$event->event->deliveryId — BankAPI retries deliveries on 408/429/5xx
responses, so the same delivery can arrive more than once.
Register it in EventServiceProvider (or via Event::listen()):
See the core SDK README for the exception hierarchy, pagination, and the raw signature-verification contract.
All versions of bankapi-laravel with dependencies
codetay/bankapi-php Version ^2.0
illuminate/support Version ^10.0 || ^11.0 || ^12.0
illuminate/http Version ^10.0 || ^11.0 || ^12.0