PHPackages                             herepay/herepay-php-sdk - 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. herepay/herepay-php-sdk

ActiveSdk[Payment Processing](/categories/payments)

herepay/herepay-php-sdk
=======================

Herepay payment gateway PHP SDK.

v1.2.3(1y ago)06MITPHPPHP ^7.4|^8.0|^8.1|^8.2

Since Dec 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Herepay/herepay-php-sdk)[ Packagist](https://packagist.org/packages/herepay/herepay-php-sdk)[ RSS](/packages/herepay-herepay-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (5)Versions (4)Used By (0)

Herepay SDK
===========

[](#herepay-sdk)

A PHP SDK for integrating with the Herepay payment gateway. This package provides a simple and efficient way to interact with the Herepay API for managing transactions, retrieving payment channels, and more.

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

[](#installation)

Install the package via Composer:

```
composer require Herepay/herepay-php-sdk
```

If using Laravel, publish the configuration file:

```
php artisan vendor:publish --provider="HerepaySDK\HerepayServiceProvider" --tag=config
```

Configuration
-------------

[](#configuration)

Ensure you add the following environment variables to your `.env` file:

```
HEREPAY_SANDBOX=true
HEREPAY_SECRET_KEY=your_secret_key
HEREPAY_API_KEY=your_api_key
HEREPAY_PRIVATE_KEY=your_private_key
```

Or you can manually configure the SDK by passing the configuration array when initializing the `HerepayService`.

Usage
-----

[](#usage)

### Initialize the SDK

[](#initialize-the-sdk)

```
use HerepaySDK\HerepayService;

$config = [
    'sandbox' => true, // Use false for production
    'secret_key' => 'your_secret_key',
    'api_key' => 'your_api_key',
    'private_key' => 'your_private_key',
];

$herepay = new HerepayService($config);
```

### Get Payment Channels

[](#get-payment-channels)

Retrieve available payment channels:

```
$paymentChannels = $herepay->getPaymentChannels();
echo $paymentChannels;
```

### Initiate transaction

[](#initiate-transaction)

Initiate transaction, response will redirect to Acquiring Bank

```
$transactionData = [
    'payment_code' => 'REF-123',
    'created_at' => date('Y-m-d H:i:s'),
    'amount' => 100,
    'name' => 'John Doe',
    'email' => 'john.doe@example.com',
    'phone' => '0123456789',
    'description' => 'Test Transaction',
    'bank_prefix' => 'TEST0021',
    'payment_method' => 'Online Banking',
];

$transactionData['checksum'] = $herepay->generateChecksum($transactionData);
$response = $herepay->initiate($transactionData);
header($response);
```

### Get Transaction Details

[](#get-transaction-details)

Retrieve the details of a transaction:

```
$referenceCode = 'HP-INVAPI-XXXXXXXXXX';
$transactionDetails = $herepay->getTransactionDetails($referenceCode);
echo $transactionDetails;
```

### Get Latest Transaction

[](#get-latest-transaction)

Retrieve the latest transaction:

```
$transactions = $herepay->getTransactions();
echo $transactions;
```

### Generate Checksum

[](#generate-checksum)

Generate a checksum for data validation:

```
$transactionData = [
    'payment_code' => 'REF-123',
    'created_at' => date('Y-m-d H:i:s'),
    'amount' => 100,
    'name' => 'John Doe',
    'email' => 'john.doe@example.com',
    'phone' => '0123456789',
    'description' => 'Test Transaction',
    'bank_prefix' => 'TEST0021',
    'payment_method' => 'Online Banking',
];

$checksum = $herepay->generateChecksum($transactionData);
echo $checksum;
```

Testing
-------

[](#testing)

Run the tests using PHPUnit:

```
vendor/bin/phpunit --testdox tests
```

Ensure that the `.env.testing` file is properly set up with sandbox credentials.

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

[](#contributing)

Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

3

Last Release

551d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/72934759?v=4)[Aliff Rosli](/maintainers/aleprosli)[@aleprosli](https://github.com/aleprosli)

---

Top Contributors

[![aleprosli](https://avatars.githubusercontent.com/u/72934759?v=4)](https://github.com/aleprosli "aleprosli (16 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/herepay-herepay-php-sdk/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.5M9](/packages/chargebee-chargebee-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)

PHPackages © 2026

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