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.

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 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

PHP Build Version
Package Version
Requires php Version >=8.1
codetay/bankapi-php Version ^2.0
illuminate/support Version ^10.0 || ^11.0 || ^12.0
illuminate/http Version ^10.0 || ^11.0 || ^12.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 codetay/bankapi-laravel contains the following files

Loading the files please wait ...