PHPackages                             maxpay/hpp-client - 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. maxpay/hpp-client

ActiveLibrary[API Development](/categories/api)

maxpay/hpp-client
=================

Maxpay PHP Library

3.0.0(2mo ago)675.0k—5%8[3 PRs](https://github.com/maxpay/php-hpp-client/pulls)1MITPHPPHP ^8.2CI passing

Since Oct 21Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/maxpay/php-hpp-client)[ Packagist](https://packagist.org/packages/maxpay/hpp-client)[ Docs](https://maxpay.com/)[ RSS](/packages/maxpay-hpp-client/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (16)Used By (1)

Maxpay HPP Client
=================

[](#maxpay-hpp-client)

[![Latest Stable Version](https://camo.githubusercontent.com/0b4d270abaf28c90dd30ecf1dcc025f6cf1cfdca1c395f3e849223b742bf95b3/68747470733a2f2f706f7365722e707567782e6f72672f6d61787061792f6870702d636c69656e742f76)](https://packagist.org/packages/maxpay/hpp-client)[![PHP Version Require](https://camo.githubusercontent.com/8c2a632acde3701c46891beccd9a26d8db4887e8c54577207aad6470c0bf7235/68747470733a2f2f706f7365722e707567782e6f72672f6d61787061792f6870702d636c69656e742f726571756972652f706870)](https://packagist.org/packages/maxpay/hpp-client)[![License](https://camo.githubusercontent.com/8d83ce666713f4806c5e05ae23fc5d78b6d8e4b02c91addd5c73bfc332c857c0/68747470733a2f2f706f7365722e707567782e6f72672f6d61787061792f6870702d636c69656e742f6c6963656e7365)](https://packagist.org/packages/maxpay/hpp-client)

PHP library for Maxpay payment gateway integration.

📋 Version Support
-----------------

[](#-version-support)

VersionPHP VersionStatusBranch**3.x****8.2+**✅ **Active development**[3.x](https://github.com/maxpay/php-hpp-client/tree/3.x)2.x7.1 - 7.4🔒 Security fixes only[2.x](https://github.com/maxpay/php-hpp-client/tree/2.x)📦 Installation
--------------

[](#-installation)

### For PHP 8.2+ (Recommended)

[](#for-php-82-recommended)

```
composer require maxpay/hpp-client
```

### For PHP 7.1-7.4 (Legacy)

[](#for-php-71-74-legacy)

```
composer require maxpay/hpp-client:^2.0
```

🚀 Upgrading to 3.0
------------------

[](#-upgrading-to-30)

Migrating from 2.x? See [UPGRADE-3.0.md](UPGRADE-3.0.md)

Getting Started
---------------

[](#getting-started)

You can sign up for a maxpay account at

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

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

Simple payment form
-------------------

[](#simple-payment-form)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
echo $scriney->buildButton('userId')->buildPopup();
```

Payment form with pre-selected product
--------------------------------------

[](#payment-form-with-pre-selected-product)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
echo $scriney->buildButton('userId')->setProductId('productIdInMportal')->buildPopup();
```

Payment form with filled user information
-----------------------------------------

[](#payment-form-with-filled-user-information)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
echo $scriney->buildButton('userId')->setUserInfo(
          new \Maxpay\Lib\Model\UserInfo(
              'example@example.com',
              'John',
              'Anderson',
              'USA',
              'Los angeles',
              '90217',
              '2896 Providence Lane',
              '+6267746913'
          )
      )->buildPopup();
```

Payment form with custom return urls
------------------------------------

[](#payment-form-with-custom-return-urls)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
echo $scriney->buildButton('userId')
    ->setSuccessReturnUrl("https://example.com/success")
    ->setDeclineReturnUrl("https://example.com/decline")
    ->setBackUrl("https://example.com/back")
    ->buildPopup();
```

Payment form with custom params, params will be returned in callback
--------------------------------------------------------------------

[](#payment-form-with-custom-params-params-will-be-returned-in-callback)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
echo $scriney->buildButton('userId')->setCustomParams(
        [
            'custom_param1' => 'param value 1',
            'custom_param2' => 'param value 2'
        ]
    )->buildPopup();
```

Payment form with dynamic products
----------------------------------

[](#payment-form-with-dynamic-products)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
echo $scriney->buildButton('userId')->setCustomProducts(
          [
              new \Maxpay\Lib\Model\FixedProduct(
                  'myProducId1',
                  'Garden Table',
                  198.98,
                  'USD',
                  null,
                  null,
                  'Magic Garden Table & Set of 2 Chairs'
              ),
              new \Maxpay\Lib\Model\FixedProduct(
                  'myProducId2',
                  'Chair',
                  110.50,
                  'USD',
                  null,
                  null,
                  'Magic Garden Rocking Chair'
              )
          ]
      )->buildPopup();
```

Valdiate callback data
----------------------

[](#valdiate-callback-data)

$data - json string of callback response data read from file\_get\_contents('php://input'); $headers - array of callback response headers

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
if ($scriney->validateCallback($data, $headers)) {
    echo 'callback data is valid';
} else {
    echo 'invalid callback data';
}
```

Api
===

[](#api)

Rebilling api
-------------

[](#rebilling-api)

### Create simple rebilling request by existing product

[](#create-simple-rebilling-request-by-existing-product)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');

try {
    $result = $scriney->createRebillRequest(
        '569ded06-c1c0-4ecb-9b9c-59c1630f6969',
        'userId'
    )->setProductId(
        'p_3ba675d110'
    )->setUserInfo(
         new \Maxpay\Lib\Model\UserInfo(
             'example@example.com',
             'John',
             'Anderson',
             'USA',
             'Los angeles',
             '90217',
             '2896 Providence Lane',
             '6267746913'
         )
     )->send();
} catch (\Maxpay\Lib\Exception\GeneralMaxpayException $e) {
    //
}

if ($scriney->validateApiResult($result)) {
    //Api result is valid
}
```

### Create rebilling request with custom product and custom params

[](#create-rebilling-request-with-custom-product-and-custom-params)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');

try {
    $result = $scriney->createRebillRequest(
        '569ded06-c1c0-4ecb-9b9c-59c1630f6969',
        'userId'
    )->setUserInfo(
         new \Maxpay\Lib\Model\UserInfo(
             'example@example.com',
             'John',
             'Anderson',
             'USA',
             'Los angeles',
             '90217',
             '2896 Providence Lane',
             '6267746913'
         )
     )->setCustomProduct(
        new \Maxpay\Lib\Model\FixedProduct(
            'myProducId1',
            'Garden Table',
            198.98,
            'USD',
            null,
            null,
            'Magic Garden Table & Set of 2 Chairs'
        )
     )->setCustomParams(
        [
            'custom_param_name1' => 'value 1',
            'custom_param_name2' => 'value 2'
        ]
     )->send();
} catch (\Maxpay\Lib\Exception\GeneralMaxpayException $e) {
    //
}

if ($scriney->validateApiResult($result)) {
    //Api result is valid
    //Api result example:
    /*
        Array
        (
            [transactionId] => hppR1463555724.2658mId548aId9
            [uniqueUserId] => userId
            [totalAmount] => 198.98
            [currency] => USD
            [transactionType] => SALE
            [status] => success
            [message] => Transaction processed successfully
            [code] => 0
            [productList] => Array
                (
                    [0] => Array
                        (
                            [productId] => myProducId1
                            [name] => Garden Table
                            [amount] => 198.98
                            [currency] => USD
                        )

                )

            [customParameters] => Array
                (
                    [custom_param_name1] => value 1
                    [custom_param_name2] => value 2
                )

            [checkSum] => 285e7c239dd8945b49157e36c0000692932e3dca04e8581ffa43abecef260beb
        )
    */
}
```

Cancel subscription api
-----------------------

[](#cancel-subscription-api)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
$result = $scriney->stopSubscription('hppR1463555724.2658mId548aId9', 'userId');
if ($scriney->validateApiResult($result)) {
    //Api result is valid
}
```

Cancel post trial product api
-----------------------------

[](#cancel-post-trial-product-api)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
$result = $scriney->cancelPostTrial('hppR1463555724.2658mId548aId9');
if ($scriney->validateApiResult($result)) {
    //Api result is valid
}
```

Full/partial Refund api
-----------------------

[](#fullpartial-refund-api)

```
$scriney = new \Maxpay\Scriney('publicKey', 'privateKey');
$result = $scriney->refund('hppR1463555724.2658mId548aId9', 123.24, 'USD');
if ($scriney->validateApiResult($result)) {
    //Api result is valid
}
//Api result example
/*
  Array
  (
      [message] => Refund processed successfully, but all subscriptions already stopped.
      [status] => Success
      [transactionId] => hppAR1468587714.1807mId548aId9
      [checkSum] => ee7ecd3b401735c40c5da4c3dcaf38952df5721d9626402cbbc1ccadd65b5616
  )
*/
```

Development
===========

[](#development)

Install dependencies:

```
composer install
```

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance84

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~341 days

Recently: every ~381 days

Total

11

Last Release

83d ago

Major Versions

1.0.3 → 2.0.12020-08-10

2.x-dev → 3.0.02026-02-23

PHP version history (3 changes)1.0.0PHP &gt;=5.4

1.0.3PHP &gt;=7.1

3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b277c1be46ee2c8c9bf4c285a35a29983bc2e4d540c6c858fcc232d8e519bdc?d=identicon)[Maxpay](/maintainers/Maxpay)

---

Top Contributors

[![SergeyMiheev](https://avatars.githubusercontent.com/u/3327613?v=4)](https://github.com/SergeyMiheev "SergeyMiheev (13 commits)")[![EugeniyPetrov](https://avatars.githubusercontent.com/u/2155621?v=4)](https://github.com/EugeniyPetrov "EugeniyPetrov (11 commits)")[![dbyvalin](https://avatars.githubusercontent.com/u/64464506?v=4)](https://github.com/dbyvalin "dbyvalin (6 commits)")[![VyacheslavDolya](https://avatars.githubusercontent.com/u/3057705?v=4)](https://github.com/VyacheslavDolya "VyacheslavDolya (6 commits)")[![max-d](https://avatars.githubusercontent.com/u/5785681?v=4)](https://github.com/max-d "max-d (4 commits)")[![aleksandr-cherniy](https://avatars.githubusercontent.com/u/247553902?v=4)](https://github.com/aleksandr-cherniy "aleksandr-cherniy (3 commits)")

---

Tags

pspmaxpay

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maxpay-hpp-client/health.svg)

```
[![Health](https://phpackages.com/badges/maxpay-hpp-client/health.svg)](https://phpackages.com/packages/maxpay-hpp-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69433.0M114](/packages/algolia-algoliasearch-client-php)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

517.9M7](/packages/avalara-avataxclient)[alexacrm/dynamics-webapi-toolkit

Web API toolkit for Microsoft Dynamics 365 and Dynamics CRM

81324.1k1](/packages/alexacrm-dynamics-webapi-toolkit)[linkorb/buckaroo

Buckaroo BPE3 API client for PHP. PSR-0 Compliant.

11112.7k1](/packages/linkorb-buckaroo)[webit/w-firma-api

wFirma.pl API

1820.2k](/packages/webit-w-firma-api)

PHPackages © 2026

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