PHPackages                             fmtl-studio/laravel-epay - 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. fmtl-studio/laravel-epay

ActiveLibrary[Payment Processing](/categories/payments)

fmtl-studio/laravel-epay
========================

Laravel adapter to accept payments through the ePay, EasyPay and BPay.

v1.0(6y ago)219[2 PRs](https://github.com/fmtl-studio/laravel-epay/pulls)MITPHP

Since Dec 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/fmtl-studio/laravel-epay)[ Packagist](https://packagist.org/packages/fmtl-studio/laravel-epay)[ Docs](https://www.fundamental.bg)[ RSS](/packages/fmtl-studio-laravel-epay/feed)WikiDiscussions master Synced 2d ago

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

Laravel ePay, EasyPay, BPay, ePay World integration module
==========================================================

[](#laravel-epay-easypay-bpay-epay-world-integration-module)

Laravel wrapper for easy and seamless integration with all available ePay payment methods:

- ePay
- EasyPay(10 digit identification number)
- BPay(Payment using ATM machine withdraw)
- ePay World(Payment using debit/credit card)

Made with love and code by [Fundamental Studio Ltd.](https://www.fundamental.bg)

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

[](#installation)

The package is compatible with Laravel 7+ version.

Via composer:

```
$ composer require fmtl-studio/laravel-epay
```

### Publish using the provider

[](#publish-using-the-provider)

After installing, the package should be auto-discovered by Laravel. In order to configurate the package, you need to publish the config file using this command:

```
$ php artisan vendor:publish --provider="Fundamental\Epay\EpayServiceProvider"
```

### Config

[](#config)

After publishing the config file, you should either add the needed keys to the global .env Laravel file:

```
EPAY_PRODUCTION=FALSE # Should the platform use the production or the test ePay endpoint
EPAY_MIN=XXXXXXXXXX # Official KIN number from the ePay platform
EPAY_SECRET=XXXXXXXXXX # Secret token from the ePay platform
EPAY_DEFAULT_CURRENCY="BGN" # Default currency
EPAY_DEFAULT_URL_OK="https://myurl.com/"
EPAY_DEFAULT_URL_CANCEL="https://myurl.com/"
EPAY_GENERATE_INVOICE=TRUE # Should the package generate random invoice number if one isn't presented
EPAY_EXPIRATION_HOURS=72 # What is the period(in hours) that tha package should add to the current timestamp for an expiration date

```

You are up &amp; running and ready to go.

Documentation and Usage instructions
------------------------------------

[](#documentation-and-usage-instructions)

The usage of our package is pretty seamless and easy. First of all, you need to use the proper namespace for our package:

```
use Fundamental\Epay\Epay;

```

### Creating the instance of our package:

[](#creating-the-instance-of-our-package)

```
$epay = new Epay('paylogin', array $data, 'BG'); // Use either paylogin or credit_paydirect, the second parameter is documented in the next section and the third parameter is the request language page will be shown in: BG or EN, default: BG.
$epay->setData(
    1000000000, // Could be either number or false(will be auto-generated if EPAY_GENERATE_INVOICE=TRUE)
    40.00, // Amount of the payment, double formatted either as double or string
    '14.12.2019 20:46:00', // Could be either formatted date in d.m.Y H:i:s or false(will be auto-generated)
    'Description of the payment in less than 100 symbols.', // Could be empty
    'BGN', // Available currencies: BGN, USD, EUR, default to bgn, may be ommited
    'utf-8' // Encoding, either null or utf-8, may be ommitted
);
```

### Quick way to initiate a payment

[](#quick-way-to-initiate-a-payment)

The setData function could be ommitted. The data may be set as array and second parameter to the constructor of the main class.

```
$epay = new Epay('paylogin', [
    'invoice' => 1000000000, // Could be either number or false(will be auto-generated if EPAY_GENERATE_INVOICE=TRUE)
    'amount' => 40.00, // Amount of the payment, double formatted either as double or string
    'expiration' => '14.12.2019 20:46:00', // Could be either formatted date in d.m.Y H:i:s or false(will be auto-generated)
    'description' => 'Description of the payment in less than 100 symbols.' // Could be empty
]);
```

All available methods are shown into the next section, including setter and getter methods.

### Generating payment fields and/or forms

[](#generating-payment-fields-andor-forms)

Retrieve the correct and formatted hidden fields, form, or array with all the needed parameters.

```
// Both, URL OK and URL Cancel can be ommitted as not required by the ePay platform.

// Would return all hidden fields as formatted html
$epay->generatePaymentFields('https://ok.url', 'https://cancel.url');

// Would return html form with the first parameter as id
$epay->generatePaymentForm('#form-id', 'https://ok.url', 'https://cancel.url');

// Would return array with all needed parameters for the platform request you need to do on your own
$epay->getPaymentParameters();
```

All available methods are shown into the next section.

### Notes

[](#notes)

All current requests can be used as a form for redirecting the user to the ePay platform, including:

- Payment through your ePay account
- BPay code for ATM withdraw using 6 digit code
- Payment through debit/credit card throught ePay World (If ePay World is included into your ePay contract)
- EasyPay tab, which will give you 10 digit code for payment

### EasyPay

[](#easypay)

However, if you need and want to integrate your platform with the EasyPay 10 digit code yourself, you can use:

```
// Using the initialization code from the upper piece of code
$easyPayIDN = $epay->requestIDNumber(); // Returning the 10 digit number for EasyPay payment or throws an exception
$epay->getEasypayIDN(); // Available method if needed and not assigned the requestIDNumber() to a variable
```

### Parsing the results

[](#parsing-the-results)

It is also possible to parse the return results and output them as array:

```
// Would like the $response array to have two members encoded and checksum.
$results = Fundamental\Epay\Epay::parseResult($response); // Will return full array of data, if the checksum check equals true
```

You can find our more about the available methods and differences between the paylogin and credit\_paydirect types. All available methods are shown into the next section.

Official ePay documentation can be found [here](https://www.epay.bg/v3main/img/front/tech_wire.pdf).

- Production ePay url endpoint:
- Demo ePay url endpoint:

Methods
-------

[](#methods)

All available methods with their arguments and return formats.

```
/**
 * Constructing the Epay class instance.
 *
 * @param String $type Can be either paylogin or credit_paydirect.
 * @param array $data May be ommitted and use the setData function.
 * @param String $language Can be either BG or EN.
 */
new Epay(String $type = 'paylogin', array $data = [], String $language = 'BG')

/**
 * Setting main data for creating and sending the request.
 *
 * @param String $invoice
 * @param [type] $amount The amount
 * @param String $expiration
 * @param String $description Invoice description content in less than 100 symbols.
 * @param string $currency
 * @param [type] $encoding
 * @return void
 */
public function setData($invoice = false, $amount, $expiration = false, String $description = '', $currency = 'BGN', $encoding = null)

/**
 * Setter for invoice number.
 *
 * @param String $invoice The invoice number.
 * @return void
 */
public function setInvoice($invoice): void

/**
 * Get the set or generated invoice number.
 *
 * @return String
 */
public function getInvoice(): String

/**
 * Setter for amount number.
 *
 * @param double|float|String $amount The invoice amount.
 * @return void
 */
public function setAmount($amount): void

/**
 * Get the invoice amount.
 *
 * @return Double
 */
public function getAmount(): Double

/**
 * Setter for expiration date in format d.m.Y H:i:s
 *
 * @param String $expiration Date format: d.m.Y H:i:s
 * @return void
 */
public function setExpiration($expiration): void

/**
 * Get the already set expiration time.
 *
 * @return String
 */
public function getExpiration(): String

/**
 * Setter for invoice description parameter.
 *
 * @param String $description Length should be less than 100 symbols.
 * @return void
 */
public function setDescription($description): void

/**
 * Get the already set description parameter.
 *
 * @return String
 */
public function getDescription(): String

/**
 * Send request to the ePay platform for 10 digit code generation and retrieve
 *
 * @return String
 */
public function requestIDNumber(): String

/**
 * Retrieve the requested and generated IDN for in place payment at EasyPay
 *
 * @return String
 */
public function getEasypayIDN(): String

/**
 * Parse result and get all status and ePay generated fields as array.
 *
 * @param array $data Should include encoded and checksum members of the array.
 * @return array
 */
public static function parseResult(array $data): array

/**
 * Generate the checksum of the send or already initialized data array.
 *
 * @param boolean $data
 * @return void
 */
public function generateChecksum($data = false)

/**
 * Get the encoded data string.
 *
 * @return String
 */
public function getEncoded(): String

/**
 * Get the calculated checksum string.
 *
 * @return String
 */
public function getChecksum(): String

/**
 * Get the target url for the ePay platform, using the english version and the test parameter.
 *
 * @return String
 */
public function getTargetUrl(): String

/**
 * Get all hidden input fields for the needed request.
 *
 * @param boolean $urlOk Using the default value from the config or being ommitted.
 * @param boolean $urlCancel Using the default value from the config or being ommitted.
 * @return String All needed hidden input fields
 */
public function generatePaymentFields($urlOk = false, $urlCancel = false): String

/**
 * Returns a html form with all hidden input fields for the needed request.
 *
 * @param String $id The id element of the generated form.
 * @param boolean $urlOk Using the default value from the config or being ommitted.
 * @param boolean $urlCancel Using the default value from the config or being ommitted.
 * @return String Html form with all hidden fields and set id attribute
 */
public function generatePaymentForm(String $id = '', $urlOk = false, $urlCancel = false): String

/**
 * Get all request parameters for making the ePay request on your own.
 *
 * @return array
 */
public function getPaymentParameters(): array
```

Changelog
---------

[](#changelog)

All changes are available in our Changelog file.

Support
-------

[](#support)

For any further questions, feature requests, problems, ideas, etc. you can create an issue tracker or drop us a line at

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

[](#contributing)

Read the Contribution file for further information.

Credits
-------

[](#credits)

- Konstantin Rachev
- Vanya Ananieva

The package is bundled and contributed to the community by Fundamental Studio Ltd.'s team.

Issues
------

[](#issues)

If you discover any issues, please use the issue tracker.

Security
--------

[](#security)

If your discover any security-related issues, please email  or  instead of using the issue tracker.

License
-------

[](#license)

The MIT License(MIT). See License file for further information and reading.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

2340d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfec0a16612b7177a93f4c2b8a4515352fa595e5e604254fdca83ad84211ddfa?d=identicon)[konstantinrachev](/maintainers/konstantinrachev)

---

Top Contributors

[![konstantinrachev](https://avatars.githubusercontent.com/u/7881742?v=4)](https://github.com/konstantinrachev "konstantinrachev (34 commits)")

---

Tags

epaylaravelpaymentsphp

### Embed Badge

![Health badge](/badges/fmtl-studio-laravel-epay/health.svg)

```
[![Health](https://phpackages.com/badges/fmtl-studio-laravel-epay/health.svg)](https://phpackages.com/packages/fmtl-studio-laravel-epay)
```

###  Alternatives

[lemonsqueezy/laravel

A package to easily integrate your Laravel application with Lemon Squeezy.

58596.1k](/packages/lemonsqueezy-laravel)[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

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