Download the PHP package ibnnajjaar/mib-global-pay without Composer

On this page you can find all versions of the php package ibnnajjaar/mib-global-pay. 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 mib-global-pay

MIB Global Pay SDK

Latest Version on Packagist Tests Total Downloads

A Framework-agnostic PHP SDK for integrating with MIB Global Pay – enabling merchants to initiate payments and retrieve payment statuses using a clean, developer-friendly interface.

Table of Contents

Requirements

Installation

Install the package using Composer:

Setup & Configuration

Environment Setup

Before using the SDK, obtain your Merchant ID and API Key from the MIB Merchant Portal.

Environment (Sandbox or Production):

Client Initialization

Initialize the client:

Environment Variables (Recommended)

Store credentials securely using environment variables:

Note: NEVER commit your env file to the repository.

Implementation Guide

Create Payment

To initiate a payment, first prepare the order data:

Send the request with the data:

Important: Save the successIndicator in your database for later verification after redirection.

Redirect to MIB Checkout

Once you have the session ID, redirect the user to the page below. You will need to update the sandbox.gateway.mastercard.com to the appropriate URL and also send the session ID to the view. This view will automatically redirect the user to the MIB Global Pay payment page.

Handle Payment Completion

After the payment process, MIB will redirect the user to the return_url you provided earlier. On that page, verify the payment result:

Retrieve Payment Status

To double-check the status of a payment via API:

Best Practice: Always verify payment status with the get order API for critical orders.

Handling Webhook Data

A webhook notifies you of successful transactions at predefined intervals, which is very useful for marking orders as paid. Sometimes, users may close their browser or interrupt the session before the payment gateway returns the transaction information. In such cases, your order might remain marked as unpaid in your database, even though the payment was completed in the merchant portal.

The webhook sends the successful transaction data to a predefined URL. You can use this data to update and mark the order as paid. Additionally, you can set a secret token in the merchant portal that will be included in the webhook request headers. This token can be used to verify the authenticity of the data.

Since webhook notifications are sent as POST requests, your application must be able to accept POST requests at the specified endpoint.

You can convert the webhook data into a response data object as shown below:

Error Handling

The SDK may encounter various errors during API calls. Always implement proper error handling:

API Response Structures

Create Payment Response

This is a typical response you will receive when you send a create transaction request:

Payment Status Response

This is a typical response you will receive to your return URL:

Note: The order ID is present because it was included in the return URL. If you did not include the order ID in the return URL, the order key will not be present.

Response Methods

All responses have the following methods available:

Security Considerations

Credential Management

HTTPS Requirements

Test Card Numbers

Use test card numbers provided by the bank. Test cards will be listed in the documentation.

Testing

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

Contributors

License

MIT License.


For additional support, please raise an issue.


All versions of mib-global-pay with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0|^8.1|^8.2|^8.3
guzzlehttp/guzzle Version ~6.0|~7.0
ext-json Version *
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 ibnnajjaar/mib-global-pay contains the following files

Loading the files please wait ....