PHPackages                             asciisd/mastercard-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. asciisd/mastercard-php

ActiveLibrary[API Development](/categories/api)

asciisd/mastercard-php
======================

Mastercard Library for php

v1.0.7(6y ago)191MITPHPPHP &gt;=7.1.0CI failing

Since Oct 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/asciisd/mastercard-php)[ Packagist](https://packagist.org/packages/asciisd/mastercard-php)[ Docs](https://github.com/asciisd/mastercard-php)[ RSS](/packages/asciisd-mastercard-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (7)Dependencies (3)Versions (9)Used By (0)

mastercard-php
==============

[](#mastercard-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8b5cb0f1605dcf849791bc56a8f854aab72a711a73bb0f8cafd556708be2f7a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617363696973642f6d6173746572636172642d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/mastercard-php)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/425ba4ab94ed43116d849e42bacba8d093603e68deec619614e1608adfcab61e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f617363696973642f6d6173746572636172642d7068702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/asciisd/mastercard-php)[![Total Downloads](https://camo.githubusercontent.com/dd34bdab9a55e99f31c579ff9325d8b33808cc8f6c1c1996a104eee7bd8d00f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617363696973642f6d6173746572636172642d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/mastercard-php)

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

[](#requirements)

PHP 7.1.0 and later.

Install
-------

[](#install)

Composer
--------

[](#composer)

You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:

```
composer require asciisd/mastercard-php
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once('vendor/autoload.php');
```

Dependencies
------------

[](#dependencies)

The bindings require the following extensions in order to work properly:

- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer
- [`json`](https://secure.php.net/manual/en/book.json.php)
- [`mbstring`](https://secure.php.net/manual/en/book.mbstring.php) (Multibyte String)

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

[](#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
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Amr Emad](https://github.com/amead)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

2391d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77636067?v=4)[ASCII SD](/maintainers/asciisd)[@asciisd](https://github.com/asciisd)

---

Top Contributors

[![aemaddin](https://avatars.githubusercontent.com/u/11630742?v=4)](https://github.com/aemaddin "aemaddin (20 commits)")

---

Tags

phpmastercardasciisdmastercard-php

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/asciisd-mastercard-php/health.svg)

```
[![Health](https://phpackages.com/badges/asciisd-mastercard-php/health.svg)](https://phpackages.com/packages/asciisd-mastercard-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
