PHPackages                             bitweb/bank-link - 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. bitweb/bank-link

ActiveLibrary[Payment Processing](/categories/payments)

bitweb/bank-link
================

BitWeb bank links for Estonian banks.

2.1.0(7y ago)32.4k1[1 PRs](https://github.com/BitWeb/bank-link/pulls)proprietaryPHPPHP &gt;=5.3.3

Since Mar 14Pushed 7y ago14 watchersCompare

[ Source](https://github.com/BitWeb/bank-link)[ Packagist](https://packagist.org/packages/bitweb/bank-link)[ Docs](http://bitweb.ee/)[ RSS](/packages/bitweb-bank-link/feed)WikiDiscussions master Synced 3w ago

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

bank-link
=========

[](#bank-link)

Classes for handling Banklink MAC consturction and verification.

Usage examples
==============

[](#usage-examples)

Banklink request construction example
-------------------------------------

[](#banklink-request-construction-example)

```
$sebTestUrl = 'https://www.seb.ee/cgi-bin/dv.sh/ipank.r';

$sebTestMerchantKeyPem '-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQC+AROlXiRvi1T7Q9fAh0Lw73szAn26mqfKDqd6Bdplq3v+gVWC
3v0+bgtfNakRE/UVYOxEA0z0viqRpKzPuNy8OstTMe8fFKs19NW8lBYik6NzJ4Bk
+B6VmovOm0nJLQJytXKiJyuHP9DqPOVmP8S+azzX7Uqzov1nxo9fvH7y2QIDAQAB
AoGAFhbD9O6r57fYCloJxB01gBMnTHfWrBH8vbXUbJAvorA7+wuIKG3KHS7n7Yqs
fArI7FJXRVTo5m8RPdtaJ9ADAT9rjAi3A17TaEueyJl+B/hjHYhsd8MeFhTb2fh0
rY3F6diL8U/YDbiAIegnKO0zcc6ynJrsQZvzb6DlY/CLPe0CQQD3KXJzw1ZfJ1ts
c370b/ZC1YrRURw41Q0I8ljYJ8EJw/ngVxrnCIsd43bRnOVp9guJrjTQRkhDC3Gn
J2Y0+42LAkEAxMxmh7QY4nItBTS0fe1KCat4VDxhyxYEhZKlGDhxW75vNROrripB
1ZfBsq5xkY2MM9R7WKmL7SpStrUPIvEVqwJBAOXA4ISd61cupbytrDEbNscv7Afh
pyNpYOGVLmNYqQgj5c7WCcsD1RYmkRgPCe8y6czFZJDLFHdGVxLz+/16bTsCQC9J
Ob2TnYMTkhO1JUU4tdh69e+vjoPgp3d80+Rs83fq2wey0UaI6saqryUC21Dw5OYz
QOv92RxEVhmGibuIl/8CQCiYrzwlZJDlsKrWPZT0E8rzNmLZkhNHzYJP9S7x+FKk
m3gFeXEBgzGn9UOd6xIAp0p7A1XVBN8XzDMa09gSOks=
-----END RSA PRIVATE KEY-----
';

try {

    $timeNow = new \DateTime();
    //Seb test merchant key
    $keyPem = $sebTestMerchantKeyPem;
    $storeId = 'testvpos';
    $returnUrl = 'http://localhost/banklink-return/seb';

    $txnId = '1';
    $amount = '0.01';
    $referenceNo = '643519';
    $msg = 'BitWeb test';

    $link = new \BitWeb\BankLink\Seb\Seb();
    $link->setUrl($sebTestUrl);
    $link->setPrivateKey($keyPem);
    $link->setStoreId($storeId);
    $link->setReturnUrl($returnUrl);
    $link->setDatetime($timeNow);

    $link->setStamp($txnId);
    $link->setAmount($amount);
    $link->setReferenceNumber($referenceNo);
    $link->setMessage($msg);

    $link->create('1012');

    echo $link->getForm();

} catch(Exception $e) {
    print_r($link);
    print_r($e);
}

```

Bank link return request handling example
-----------------------------------------

[](#bank-link-return-request-handling-example)

```
$sebTestBankCertPem = '-----BEGIN CERTIFICATE-----
MIIDRTCCAq6gAwIBAgIBADANBgkqhkiG9w0BAQQFADB7MQswCQYDVQQGEwJFRTEO
MAwGA1UECBMFSGFyanUxEDAOBgNVBAcTB1RhbGxpbm4xDDAKBgNVBAoTA0VZUDEL
MAkGA1UECxMCSVQxDDAKBgNVBAMTA2EuYTEhMB8GCSqGSIb3DQEJARYSYWxsYXIu
YWxsYXNAZXlwLmVlMB4XDTk5MTExNTA4MTAzM1oXDTk5MTIxNTA4MTAzM1owezEL
MAkGA1UEBhMCRUUxDjAMBgNVBAgTBUhhcmp1MRAwDgYDVQQHEwdUYWxsaW5uMQww
CgYDVQQKEwNFWVAxCzAJBgNVBAsTAklUMQwwCgYDVQQDEwNhLmExITAfBgkqhkiG
9w0BCQEWEmFsbGFyLmFsbGFzQGV5cC5lZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEAvgETpV4kb4tU+0PXwIdC8O97MwJ9upqnyg6negXaZat7/oFVgt79Pm4L
XzWpERP1FWDsRANM9L4qkaSsz7jcvDrLUzHvHxSrNfTVvJQWIpOjcyeAZPgelZqL
zptJyS0CcrVyoicrhz/Q6jzlZj/Evms81+1Ks6L9Z8aPX7x+8tkCAwEAAaOB2DCB
1TAdBgNVHQ4EFgQUFivCzZNmegEoOxYtg20YMMRB98gwgaUGA1UdIwSBnTCBmoAU
FivCzZNmegEoOxYtg20YMMRB98ihf6R9MHsxCzAJBgNVBAYTAkVFMQ4wDAYDVQQI
EwVIYXJqdTEQMA4GA1UEBxMHVGFsbGlubjEMMAoGA1UEChMDRVlQMQswCQYDVQQL
EwJJVDEMMAoGA1UEAxMDYS5hMSEwHwYJKoZIhvcNAQkBFhJhbGxhci5hbGxhc0Bl
eXAuZWWCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBfkayuot+e
fwW8QmPwpWF5AY3oMT/fTncjCljDBOg39IQv4PjnpTdDfwwl3lUIZHHTLM2i0L/c
eD4D1UFM1qdp2VZzhBd1eeMjxYjCP8qL2v2MfLkCYcP30Sl6ISSkFjFc5qbGXZOc
C82uR/wUZJDw9kj+R1O46/byG8yA+S9FVw==
-----END CERTIFICATE-----
';

try {
    $timeNow = new \DateTime();

    $bankCertPem = $sebTestBankCertPem;

    $link = new \BitWeb\BankLink\Seb\Seb();
    $link->setBankCertificate($bankCertPem);

    $link->createFromReturnRequest();

    switch ($link->getService()) {
        case '3012':
            //Return result for authentication service 4011

            break;
        case '3013':
            //Return result for authentication service 4012

            $messageDatetime = $link->getValue(\BitWeb\BankLink\Constants::DATETIME);
            $messageDatetime = \DateTime::createFromFormat(\DateTime::ISO8601, $messageDatetime);
            $diff = $timeNow->getTimestamp() - $messageDatetime->getTimestamp();
            if($diff > 300) throw new Exception('Authentication return request expired.');

            $userCountryCode = $link->getValue(\BitWeb\BankLink\Constants::COUNTRY);
            $userName = $link->getValue(\BitWeb\BankLink\Constants::USER_NAME);
            $userPersonalId = $link->getValue(\BitWeb\BankLink\Constants::USER_ID);
            $userOther = $link->getValue(\BitWeb\BankLink\Constants::OTHER);

            $userName = explode(',', $userName);

            $lastname = trim(array_pop($userName));

            $firstname = implode(' ', $userName);

            break;
        case '1111':
            // Payment completed.
            // Stamp is generally used for referencing the transaction on client application side.
            $txnId = $link->getValue(\BitWeb\BankLink\Constants::STAMP);
            $amount = $link->getValue(\BitWeb\BankLink\Constants::AMOUNT);

            if($link->getValue(\BitWeb\BankLink\Constants::AUTO) == 'N') {
                // User clicked the "Return to merchant" button and was redirected from the bank.
                // Capture the payment and render or rediret user to a success page.

            } else {
                /**
                 * Same return request may be sent several times by the bank with VK_AUTO = 'Y'
                 * For example in case the user didn't click the "Return to merchant" button in the bank.
                 * We should respond with status 200. Some banks will continue resending automatic return requests otherwise.
                 */

                die('OK');
            }

            break;
        case '1911':
            //Payment canceled by the user

            $txnId = $link->getValue(\BitWeb\BankLink\Constants::STAMP);

            if($link->getValue(\BitWeb\BankLink\Constants::AUTO) == 'N') {
                // User was redirected from bank
                // Mark the transaction as canceled and render or rediret user to a success page.

            } else {
                /**
                 * Same return request may be sent several times by the bank with VK_AUTO = 'Y'
                 * For example in case the user didn't click the "Return to merchant" button in the bank.
                 * We should respond with status 200. Some banks will continue resending automatic return requests otherwise.
                 */

                die('OK');
            }

            break;
    }
} catch(Exception $e) {
    print_r($link);
    print_r($e);
}

```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~618 days

Total

4

Last Release

2629d ago

Major Versions

1.0.0 → 2.0.02017-03-17

### Community

Maintainers

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

---

Top Contributors

[![Ivarpoiss](https://avatars.githubusercontent.com/u/13720671?v=4)](https://github.com/Ivarpoiss "Ivarpoiss (21 commits)")[![rammrain](https://avatars.githubusercontent.com/u/4268477?v=4)](https://github.com/rammrain "rammrain (18 commits)")[![tobre6](https://avatars.githubusercontent.com/u/1629750?v=4)](https://github.com/tobre6 "tobre6 (2 commits)")[![fredluhamaa](https://avatars.githubusercontent.com/u/5669774?v=4)](https://github.com/fredluhamaa "fredluhamaa (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bitweb-bank-link/health.svg)

```
[![Health](https://phpackages.com/badges/bitweb-bank-link/health.svg)](https://phpackages.com/packages/bitweb-bank-link)
```

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)

PHPackages © 2026

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