PHPackages                             forci/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. forci/epay

ActiveLibrary[Payment Processing](/categories/payments)

forci/epay
==========

Library for epay.bg

v0.1.0(8y ago)0111GPL-3.0PHPPHP ~5.5|~7.0

Since Dec 14Pushed 8y ago2 watchersCompare

[ Source](https://github.com/forci/epay)[ Packagist](https://packagist.org/packages/forci/epay)[ RSS](/packages/forci-epay/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (2)Used By (1)

Epay
====

[](#epay)

TODO
====

[](#todo)

- Tests

Usage

- Create a `Forci\Component\Epay\Client\ClientOptions` instance, responsible for providing all the options the `Forci\Component\Epay\Client\Client` needs. Its constructor needs the merchant ID and secret, provided by epay.bg. Remember to set the third constructor parameter to true or false depending on whether you're testing or not.
- Create a handler that implements the `Forci\Component\Epay\Client\PaymentHandlerInterface` interface. This interface has methods that are being called by the client
- Create an instance of `Forci\Component\Epay\Client\Client`, passing the above two
- To create a payment form, call `$client->getEpayForm($id, $amount, $description, $expiry, $formId, $okUrl, $cancelUrl)`
- To create an EasyPay payment ID, call `$response = $this->client->getEasyPayIdn($id, $amount, $description, $expiry)`. This will return a `Forci\Component\Epay\Response\EasyPayResponse` response. Call `$response->getIdn()` to get the ID. Beware, this method throws a `Forci\Component\Epay\Exception\EasyPayGetIdnError` exception.

The WucdbmEpayBundle  uses this library, head there for more examples.

```
$options = new \Forci\Component\Epay\Client\ClientOptions($merchantId, $merchantSecret, $isDebug);
// $options->set... to alter any options
$handler = new \My\Project\Payments\Epay\PaymentHandler(LogManager $some, PaymentManager $dependencies);
$client = new \Forci\Component\Epay\Client\Client($options, $handler);

```

Getting a payment form is done like this

```
$uniqId = uniqid(); // this is to make autosubmitting easy - $('#formId').submit();
$expiry = new \DateTime('today + 2 days');
// ... other parameters
$form = $client->getEpayForm($id, $amount, $description, $expiry, $formId, $okUrl, $cancelUrl);
// Display the form and optionally auto submit it. Another option is to alter the submit button through the options and let the user do that

```

Getting an EasyPay IDN

```
$id = $payment->getId();
$amount = $payment->getAmount();
$description = 'Payment #' . $payment->getId();
$expiry = $payment->getExpiryDate();

try {
    $response = $this->client->getEasyPayIdn($id, $amount, $description, $expiry);
    $idn = $response->getIdn();
    // display idn to the user, do some logging.
    // the response body is available at $response->getBody();
    return $idn;
} catch (\Forci\Component\Epay\Exception\EasyPayGetIdnError $ex) {
    $this->logEasyPayRequest($payment, $ex->getBody(), true);
    throw $ex;
}

```

Receiving payments

```
$response = $client->receiveResponse($post);
// the client will call your handler, which must deal with the payments received
// $response is an \Forci\Component\Epay\Response\ReceiveResponseInterface instance
// exceptions are caught internally and transformed into responses, the no data exception and checksum mismatch exceptions in particular generate a global error response for epay
echo $response->toString();
exit();
// alternatively, if you use Symfony's HttpFoundation component
$response = \Symfony\Component\HttpFoundation\Response($response->toString());

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

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

3074d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56129a0e9c0044d2857f405e0cf44b1c8f53bc86503dfc1c0ac3829401333c5e?d=identicon)[wucdbm](/maintainers/wucdbm)

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

---

Top Contributors

[![wucdbm](https://avatars.githubusercontent.com/u/1559022?v=4)](https://github.com/wucdbm "wucdbm (8 commits)")

---

Tags

libraryepaywucdbmepay.bg

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/forci-epay/health.svg)

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

###  Alternatives

[thehocinesaad/laravel-chargily-epay

Laravel-Chargily-ePay is a Laravel package that provides an easy interface to Chargily ePay gateway

202.1k](/packages/thehocinesaad-laravel-chargily-epay)

PHPackages © 2026

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