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 1mo ago

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 54% of packages

Maintenance40

Moderate activity, may be stable

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

505d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fb2c853583ff43254052deed7eadb21e3a5a800f91fecbebaeabe11323a7b24?d=identicon)[aleprosli](/maintainers/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

[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)

PHPackages © 2026

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