Download the PHP package bitweb/bank-link without Composer

On this page you can find all versions of the php package bitweb/bank-link. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bank-link

bank-link

Classes for handling Banklink MAC consturction and verification.

Usage examples

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

$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);
}

All versions of bank-link with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bitweb/bank-link contains the following files

Loading the files please wait ....