PHPackages                             dlds/yii2-payment - 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. dlds/yii2-payment

ActiveYii2-extension[Payment Processing](/categories/payments)

dlds/yii2-payment
=================

Library to handle payments with Estonian banks

1.1.1(11y ago)12.0k1proprietaryPHP

Since Jan 28Pushed 11y ago1 watchersCompare

[ Source](https://github.com/dlds/yii2-payment)[ Packagist](https://packagist.org/packages/dlds/yii2-payment)[ RSS](/packages/dlds-yii2-payment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (9)Used By (1)

PaymentHandler extension for Yii2
=================================

[](#paymenthandler-extension-for-yii2)

Library to handle payments with Estonian banks. Main features includes:

- Payment service implemented with the following handlers: IPizza (Swedbank, SEB, LHV, Danske, Krediidipank), Estcard, Nordea
- Object oriented and extensible code, you can easily add custom adapters
- Generates payment forms from transaction objects
- Handles bank post-back requests

This is a very basic "low-level" component for implementing payments. If you also need functionality for shopping baskets and orders, you might want to look at [opus-online/yii2-ecom](https://github.com/opus-online/yii2-ecom) extension.

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

[](#installation)

Just define the required package in your `composer.json`.

```
{
	"require": {
		"opus-online/yii2-payment": "*",
	}
}
```

Usage
-----

[](#usage)

Overwrite `PaymentHandlerBase` class and at least the method `getConfiguration`. Complement the two configuration files with your account details and locations of key and certificate files. You can just copy the files from under `examples/config`.

```
class MyPaymentHandler extends \dlds\payment\PaymentHandlerBase
{

    /**
     * Returns the configuration array
     */
    public function getConfiguration()
    {
        return [
            // common parameters for all adapters
            'common' => array(
                'returnRoute' => 'bankController/return',
            ),
            // adapter-specific parameters
            'adapters' => \yii\helpers\ArrayHelper::merge(require 'banks-default.php', require 'banks-local.php')
        ];
    }
}
```

### Render all payment forms

[](#render-all-payment-forms)

```
// create the payment service
$service = MyPaymentHandler::createPaymentService();

// create a transaction object
$transaction = $service->createTransaction(1234, 234, ['comment' => 'Comment']);

// render the widget
echo \dlds\payment\widgets\PaymentWidget::widget([
    'forms' => $service->generateForms($transaction),
]);
```

#### Customize the payment form

[](#customize-the-payment-form)

The default implementation uses the widget `dlds\payment\widgets\PaymentWidget`. You can override and use this to use custom forms or elements.

```
class MyPaymentWidget extends PaymentWidget
{
    protected function generateSubmit(Form $form) {
        return Html::submitButton('MyCustomLabel');
    }
}
```

And then just render your customized widget instead of the default one (see the widget example above).

### Receive return requests from the bank

[](#receive-return-requests-from-the-bank)

```
$service = PaymentHandler::createPaymentService();
$response = $service->handleResponse($_REQUEST);

// re-generate the transaction object from the response
$transaction = $response->getTransaction();

if ($response->isSuccessful()) {
	// see the Transaction object for more details
	echo $transaction->getTransactionId();
}
```

Added `cancelRoute` and `getCancelUrl()` to AdapterAbstract to allow different redirecting after cancelling a payment

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 59.3% 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 ~61 days

Recently: every ~43 days

Total

8

Last Release

4061d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23f0d05bb48111bd348c97af007c453b374ba03c36ec4fd114dfd73896bf5958?d=identicon)[dlds](/maintainers/dlds)

---

Top Contributors

[![ivokund](https://avatars.githubusercontent.com/u/2707429?v=4)](https://github.com/ivokund "ivokund (16 commits)")[![martinkaru](https://avatars.githubusercontent.com/u/2072688?v=4)](https://github.com/martinkaru "martinkaru (7 commits)")[![viilveer](https://avatars.githubusercontent.com/u/1699307?v=4)](https://github.com/viilveer "viilveer (2 commits)")[![jirisvoboda](https://avatars.githubusercontent.com/u/10264326?v=4)](https://github.com/jirisvoboda "jirisvoboda (1 commits)")[![svobik7](https://avatars.githubusercontent.com/u/761766?v=4)](https://github.com/svobik7 "svobik7 (1 commits)")

### Embed Badge

![Health badge](/badges/dlds-yii2-payment/health.svg)

```
[![Health](https://phpackages.com/badges/dlds-yii2-payment/health.svg)](https://phpackages.com/packages/dlds-yii2-payment)
```

###  Alternatives

[guanguans/yii-pay

适配于 Yii 的 alipay 和 wechat 的支付扩展包

515.5k](/packages/guanguans-yii-pay)[hscstudio/yii2-cart

Yii2 extension that adds shopping cart functions

242.1k](/packages/hscstudio-yii2-cart)

PHPackages © 2026

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