Download the PHP package thejano/areeba-payment-laravel without Composer
On this page you can find all versions of the php package thejano/areeba-payment-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thejano/areeba-payment-laravel
More information about thejano/areeba-payment-laravel
Files in thejano/areeba-payment-laravel
Package areeba-payment-laravel
Short Description A Laravel package for Areeba payment gateway integration.
License MIT
Informations about the package areeba-payment-laravel
Areeba Payment Laravel Package
A Laravel package for integrating with Areeba Payment Gateway.
The package supports two Areeba products:
- IXOPAY (default) — the transaction-based gateway hosted at
gateway.areebapayment.com. - MPGS / ePayment — Areeba's hosted-checkout product on
epayment.areeba.com, backed by MasterCard Payment Gateway Services. See Using the MPGS / ePayment Driver below.
Payment Flow
This flow requires you to redirect the end-user to the payment page as advised in the redirectUrl response.
- Initiate the payment with the appropriate API call.
- Upon success, the Gateway responds with a result containing
returnTypeasREDIRECTand the URL inredirectUrl. - You redirect the user to the given URL (usually via a
Locationheader). - The user completes the payment process on the payment page.
- The Gateway sends an asynchronous status notification to the URL provided in the initial API call.
- The user will be redirected to the
successUrl,errorUrl, orcancelUrlbased on the transaction status. The URL will contain thetransactionIdas a query parameter:url?transactionId={{$transactionId}}.
Installation
You can install the package via Composer:
Configuration
Publish the configuration file:
This will create a config/areeba.php file.
Set your environment variables in .env:
Usage
Using the Service Class for Payment Initiation
Using the Facade
Request Response Data Properties
The AreebaPaymentRequestData contains the following properties:
success(bool) - Indicates if the request was successful.uuid(string|null) - Unique identifier for the transaction.purchaseId(string|null) - The purchase reference ID.returnType(string|null) - Type of return response (e.g.,REDIRECT).redirectUrl(string|null) - URL where the user should be redirected to complete payment.paymentMethod(string|null) - Payment method used by the user.errorMessage(string|null) - Error message in case of failure.errorCode(int|null) - Error code if the transaction failed.
Based on the transaction status, the user will be redirected to the appropriate URL with ?transactionId={{$transactionId}} appended.
Checking Payment Status
This will return a JSON response including transactionStatus with possible values:
SUCCESS- Transaction was successful.REDIRECT- Transaction has not been processed yet.ERROR- Transaction failed.
Using the MPGS / ePayment Driver
Areeba also offers a hosted-checkout product (MPGS / ePayment) on https://epayment.areeba.com. It uses a different API than the IXOPAY gateway above: you create a checkout session, redirect the user to a hosted page (or embed checkout.js), and later query the order resource for the final payment status.
Selecting the Driver
Set AREEBA_DRIVER=mpgs in your .env to make app(PaymentGateway::class) resolve to the MPGS driver. Leaving it unset keeps the default IXOPAY behavior unchanged.
Alternatively, you can call the MPGS service directly without changing the default driver — the IXOPAY service remains available either way.
MPGS Environment Variables
The MPGS credentials are namespaced under AREEBA_MPGS_* so they do not collide with the IXOPAY keys:
The three redirect URLs are sent to MPGS as the interaction.returnUrl, interaction.cancelUrl, and interaction.timeoutUrl fields when a checkout session is created. MPGS will land the user on returnUrl whether the payment succeeded or failed — inspect the resulting order.status (see Checking Payment Status) to decide how to render the page.
Usage
Or via the facade:
Getting Just the Session ID or Payment Link
If you don't need the full AreebaPaymentRequestData object, two convenience methods return the value you want as a plain string (or null if the gateway call fails — the failure is already logged via Laravel's logger):
Both methods accept the same arguments as initiatePayment() and call it internally — they are pure projections of its result, so there is no extra network round-trip. Use initiatePayment() directly when you also need the error message or other fields on failure.
Embedded Checkout vs. Redirect
The purchaseId returned from initiatePayment is the MPGS session.id. With it you can either:
- Redirect the user to
$paymentData->redirectUrl(the hosted checkout page), or - Embed
checkout.json your own page and call:
Checking Payment Status
checkPaymentStatus returns the raw decoded JSON from MPGS so your application can map gateway-specific statuses to its own payment states.
License
This package is open-source and licensed under the MIT License.
API Documentation
For more details, visit the official API documentation:
https://www.areeba.com/projects/areeba_gateway/integration
https://www.areeba.com/documentations/areeba_docs.integration.html