Download the PHP package srustamov/laravel-azericard without Composer
On this page you can find all versions of the php package srustamov/laravel-azericard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download srustamov/laravel-azericard
More information about srustamov/laravel-azericard
Files in srustamov/laravel-azericard
Package laravel-azericard
Short Description Azericard payment gateway integration for the Laravel framework
License MIT
Informations about the package laravel-azericard
Azericard Payment Package for Laravel
English · Azərbaycanca
Requirements
| Package | PHP | Laravel |
|---|---|---|
^4.0 |
^8.2 |
12.x 13.x |
^3.0 |
>=8.0 |
10.x 11.x 12.x |
^1.0 |
<8.0 |
< 8.x |
Laravel 11 is not supported: every 11.x release carries unpatched security advisories and Composer refuses to install it.
Installation
Publish the config file:
Generating the keys
Azericard requires an RSA 2048 key pair in PEM format. The package ships a command that creates one:
It writes <merchant>_private_key.pem (mode 0600) and
<merchant>_public_key.pem into storage/app/azericard. Options:
| Option | Default | Purpose |
|---|---|---|
--path= |
storage/app/azericard |
Output directory |
--name= |
configured MERCH_NAME |
File name prefix |
--bits= |
2048 |
Key size, 2048 is the minimum |
--force |
— | Replace existing keys, asks first |
Three keys are involved and they are easy to mix up:
| Key | Who makes it | Where it goes |
|---|---|---|
| Merchant private | you | AZERICARD_PRIVATE_KEY, signs requests |
| Merchant public | you | sent to Azericard |
| Azericard public | the bank | AZERICARD_PUBLIC_KEY, verifies callbacks |
The public key this command generates does not go into
AZERICARD_PUBLIC_KEY — that variable holds the key Azericard gives you.
Once Azericard has registered your public key, regenerating the pair makes every request fail signature verification.
--forceasks for confirmation before overwriting.
The equivalent openssl commands, if you would rather run them by hand:
Configuration
Everything is driven by environment variables:
Both key values accept either an absolute file path or the inline PEM contents, so keys can live in a secret manager instead of on disk.
Set
AZERICARD_PUBLIC_KEY. When it is empty the callback signature is not verified and any caller who knows your callback URL can forge a successful payment.
AZERICARD_VERIFY_SSL defaults to true and should stay that way — this is a
payment endpoint.
Usage
createOrder() returns the payload for an auto-submitting form:
Completing an order
Refund and reversal
Azericard has two reversal types: 22 (online) while the transaction has not
settled yet, and 24 (offline) once it has. refund() picks between them with
a 24-hour heuristic on created_at.
Enums
Card storage and recurring payments
All token flows post to /token/cgi_link and are reached through token().
Store a card while taking a payment (spec 6.1) — render the returned payload
as a form, exactly like createOrder():
The callback then carries TOKEN and CARD alongside the usual fields:
Pay with a stored card (spec 6.2 / 6.3):
Recurring — registration (spec 7.1 / 7.3). Both return a form payload; the
callback additionally carries EXT_NET_REF, which you must store next to the
token:
Recurring — charging. These are merchant initiated, so there is no browser
redirect: they are sent server to server and return bool (or throw
FailedTransactionException):
A successful charge dispatches TokenCharged.
Production token endpoint. The published specification only documents the test URL (
https://testmpi.3dsecure.az/token/cgi_link). This package assumes the production URL follows the same pattern (https://mpi.3dsecure.az/token/cgi_link) — confirm it with the bank before going live.
Events
| Event | Dispatched |
|---|---|
OrderCreating |
before the payment form payload is signed |
OrderCreated |
after the payload is built |
OrderCompleted |
after a successful capture (TRTYPE 21) |
OrderRefunded |
after a successful reversal (TRTYPE 22/24) |
TokenCharged |
after a successful MIT charge (TRTYPE 1/3) |
Long-running workers
TIMESTAMP and NONCE are generated when the instance is resolved. Under
Octane or in a queue worker, refresh them before each transaction:
Example
Routes
Controller
Testing
Fake the gateway so nothing leaves your test suite:
Upgrading
See UPGRADE.md for the 3.x → 4.0 migration.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-azericard with dependencies
ext-curl Version *
ext-json Version *
ext-openssl Version *
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0