PHPackages                             genome-eu/hpp - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. genome-eu/hpp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

genome-eu/hpp
=============

Genome PHP Library

2.0.3(4y ago)111.9k[1 PRs](https://github.com/genome-eu/hpp/pulls)MITPHPPHP &gt;=7.1

Since Jun 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/genome-eu/hpp)[ Packagist](https://packagist.org/packages/genome-eu/hpp)[ Docs](https://genome.eu/)[ RSS](/packages/genome-eu-hpp/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (10)Used By (0)

You can sign up for a genome account at

Requirements
============

[](#requirements)

PHP 7.1 and later.

Composer
========

[](#composer)

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

```
composer require genome-eu/hpp
```

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

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

Getting Started
===============

[](#getting-started)

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

[](#simple-payment-form)

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

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

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

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

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

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

```
$scriney = new \Genome\Scriney('publicKey', 'privateKey');
echo $scriney->buildButton('userId')->setUserInfo(
          new \Genome\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 \Genome\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 \Genome\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 \Genome\Scriney('publicKey', 'privateKey');
echo $scriney->buildButton('userId')->setCustomProducts(
          [
              new \Genome\Lib\Model\FixedProduct(
                  'myProducId1',
                  'Garden Table',
                  198.98,
                  'USD',
                  null,
                  null,
                  'Magic Garden Table & Set of 2 Chairs'
              ),
              new \Genome\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 \Genome\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 \Genome\Scriney('publicKey', 'privateKey');

try {
    $result = $scriney->createRebillRequest(
        '569ded06-c1c0-4ecb-9b9c-59c1630f6969',
        'userId'
    )->setProductId(
        'p_3ba675d110'
    )->setUserInfo(
         new \Genome\Lib\Model\UserInfo(
             'example@example.com',
             'John',
             'Anderson',
             'USA',
             'Los angeles',
             '90217',
             '2896 Providence Lane',
             '6267746913'
         )
     )->send();
} catch (\Genome\Lib\Exception\GeneralGenomeException $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 \Genome\Scriney('publicKey', 'privateKey');

try {
    $result = $scriney->createRebillRequest(
        '569ded06-c1c0-4ecb-9b9c-59c1630f6969',
        'userId'
    )->setUserInfo(
         new \Genome\Lib\Model\UserInfo(
             'example@example.com',
             'John',
             'Anderson',
             'USA',
             'Los angeles',
             '90217',
             '2896 Providence Lane',
             '6267746913'
         )
     )->setCustomProduct(
        new \Genome\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 (\Genome\Lib\Exception\GeneralGenomeException $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 \Genome\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 \Genome\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 \Genome\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

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~186 days

Total

4

Last Release

1646d ago

Major Versions

1.0.1 → 2.02020-07-21

PHP version history (2 changes)1.0.1PHP &gt;=5.4

2.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8d9242ba3c435a91e04173c674b8fae375c6143aae94e00b3b4010777f838d8?d=identicon)[integration.genome](/maintainers/integration.genome)

---

Top Contributors

[![VyacheslavDolya](https://avatars.githubusercontent.com/u/3057705?v=4)](https://github.com/VyacheslavDolya "VyacheslavDolya (6 commits)")[![aleksandr-cherniy](https://avatars.githubusercontent.com/u/247553902?v=4)](https://github.com/aleksandr-cherniy "aleksandr-cherniy (2 commits)")

---

Tags

genome

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/genome-eu-hpp/health.svg)

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

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514135.1M625](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[phpro/soap-client

A general purpose SoapClient library

8895.9M52](/packages/phpro-soap-client)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k42](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

749284.3k35](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7126.9M203](/packages/illuminate-broadcasting)

PHPackages © 2026

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