PHPackages                             ajaxy/payment - 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. [Payment Processing](/categories/payments)
4. /
5. ajaxy/payment

ActiveAjaxy[Payment Processing](/categories/payments)

ajaxy/payment
=============

Ajaxy Payment

v1.0.0(8y ago)020MITPHPPHP &gt;=5.4.0

Since Feb 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/n-for-all/payment)[ Packagist](https://packagist.org/packages/ajaxy/payment)[ Docs](https://ajaxy.org)[ RSS](/packages/ajaxy-payment/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Ajaxy Payment
=============

[](#ajaxy-payment)

Installation
------------

[](#installation)

```
composer require ajaxy/payment
```

Examples
--------

[](#examples)

```
//using paypal
$__URL__ = 'http://www.example.com';
$paypal = new \Ajaxy\Payment\Gateway\Paypal(array(
    'email' => '',
    'custom' => array('user_id' => ''),
    'notify_url' => $__URL__.'/validate_ipn.php',
    'return_url' => $__URL__,
    'cancel_return' => $__URL__
));

$paypal->addItem('test1', 10, 1);
$paypal->addItem('test2', 10, 3);
//print the form
$paypal->getForm(true);

//or echo the url
echo 'Pay';

//using al mashreq bank
$__URL__ = "http://www.example.com";
$_SECURE_HASH_ = ''; //should be sent by the bank
$_MID_ = ''; //merchant id
$_ACCESS_CODE_ = ''; //access code

$almashreq = new \Ajaxy\Payment\Gateway\AlMashreq(array(

    'notify_url' => $__URL__.'/validate_mh.php',
    'return_url' => $__URL__.'/validate_mh.php',

    'order_number' => __ORDER__NO__,

    //pass any order info to the payment, you will receive this back
    'custom' => array('test' => 1),

    //the order total, maximum of 2 decimal places
    'total' => '321',

    //sandbox or live
    'mode' => 'sandbox',

    //merchant details, those details are sent by the bank
    'endpoint' => 'https://migs.mastercard.com.au',
    'access_code' => $_ACCESS_CODE_,
    'merchant' => $_MID_,
    'currency_code' => 'AED',
    'secure_hash' => $_SECURE_HASH_,

));

//print the form
$almashreq->getForm(true);

//or echo the url
echo 'Pay';
```

Validation
----------

[](#validation)

```
//you will receive the response at the return_url you have set before
//al mashreq
$response = new \Ajaxy\Payment\Gateway\AlMashreq\Response(_SECURE_HASH_, null);
if($response->validate()){
    $custom = $response->getCustom();
    print_r($custom);
    echo 'payment is valid';
}else{
    $code = $response->getResponseCode();
    echo $response->getResultDescription($code);
}

//paypal
$ipn = new \Ajaxy\Payment\Gateway\Paypal\IPN('php://input', true);
if($ipn->validate()){
    echo "valid";
}else{
    echo "failed";
}

//you can also pass a psr4 logger to log the response

use \Ajaxy\Logger\Logger;
use \Ajaxy\Logger\Handler\Stream;

$log = new Logger();
$log->addHandler(new Stream(dirname(__FILE__).'/log/'));
$ipn = new \Ajaxy\Payment\Gateway\Paypal\IPN('php://input', true, $log);

$response = new \Ajaxy\Payment\Gateway\AlMashreq\Response(_SECURE_HASH_, null, $log);
```

About
-----

[](#about)

### Requirements

[](#requirements)

- Ajaxy\\Logger works with PHP 5.6 or above.

### Submitting bugs and feature requests

[](#submitting-bugs-and-feature-requests)

Bugs and feature request are tracked on [GitHub](https://github.com/n-for-all/payment/issues)

### Author

[](#author)

Naji Amer -  -

### License

[](#license)

Ajaxy\\Payment is licensed under the MIT License - see the `LICENSE` file for details

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

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

Unknown

Total

1

Last Release

3000d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32e49358c0e912853bde988b1a3f4d64db27e443ab98a084c89de8881b73ea12?d=identicon)[naji090](/maintainers/naji090)

---

Top Contributors

[![n-for-all](https://avatars.githubusercontent.com/u/171367?v=4)](https://github.com/n-for-all "n-for-all (8 commits)")

### Embed Badge

![Health badge](/badges/ajaxy-payment/health.svg)

```
[![Health](https://phpackages.com/badges/ajaxy-payment/health.svg)](https://phpackages.com/packages/ajaxy-payment)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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