asciisd / mastercard-php
Mastercard Library for php
Requires
- php: >=7.1.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
Requires (Dev)
- phpunit/phpunit: ^8.0
- scrutinizer/ocular: ~1.6
- squizlabs/php_codesniffer: ~2.3
README
The Mastercard PHP library provides convenient access to the Mastercard API from applications written in the PHP language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses which makes it compatible with a wide range of versions of the Mastercard API.
Requirements
PHP 7.1.0 and later.
Install
Composer
You can install the bindings via Composer. Run the following command:
composer require asciisd/mastercard-php
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
Dependencies
The bindings require the following extensions in order to work properly:
If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.
Usage
Mastercard::setMerchantId('your_merchant_id'); Mastercard::setApiKey("your_merchant_password"); Mastercard::setApiVersion(53); $result = \Mastercard\Session::create(); $session_id = $result->session->id;
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email aemad@asciisd.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.