PHP Classes
elePHPant
Icontem

Banklink: Take payments with multiple payment gateways

Recommend this page to a friend!
  Info   View files Documentation   View files View files (162)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-04-04 (3 hours ago) RSS 2.0 feedStarStarStarStar 63%Total: 139 This week: 7All time: 8,790 This week: 60Up
Version License PHP version Categories
banklink 1.0.13MIT/X Consortium ...5PHP 5, E-Commerce, Libraries, Web ser...
Description Author

This package can take payments with multiple payment gateways.

It can generate arrays of parameters to be included in a HTML form for payment buttons that will be processed at each of the supported payment gateway sites.

It can also take request parameters to received from the payment site when a payment is processed and returns the payment parameters.

Currently it supports the payment gateways Baltic banklinks (2016 protocol), E-commerce gateaway (Estcard, Nets Estonia) and Liisi Payment Link.

  Performance   Level  
Name: Rene Korss <contact>
Classes: 2 packages by
Country: Estonia Estonia

Details

Build Status Coverage Status Codacy Badge Latest Stable Version Total Downloads License SymfonyInsight

PHP Payment library

> PHP payment library to easily integrate Baltic banklinks, E-commerce gateaway (Estcard, Nets Estonia), Liizi Payment Link and Pocopay. > > View API documentation at https://renekorss.github.io/Banklink/

Install

composer require renekorss/Banklink

Supported providers

Country / Provider| Payment | Authentication ------------------| ------------------- | ------------------ Estonia | | Danskebank | :white_check_mark: | :white_check_mark: Coop Pank | :white_check_mark: | :white_check_mark: LHV | :white_check_mark: | :white_check_mark: SEB | :white_check_mark: | :white_check_mark: Swedbank | :white_check_mark: | :white_check_mark: Luminor | :white_check_mark: | :white_check_mark: Nordea | :white_check_mark: | :white_check_mark: Pocopay | :white_check_mark: | does not apply Estcard | :white_check_mark: | does not apply Liisi Payment Link| :white_check_mark: | does not apply Lithuania | | SEB | :white_check_mark: | does not apply Swedbank | :white_check_mark: | does not apply Luminor | :white_check_mark: | does not apply ?iauli? | :white_check_mark: | does not apply Estcard | :white_check_mark: | does not apply

How to use?

For more information, please visit Wiki. Basic example is below.

> SECURITY WARNING > > Never keep your private and public keys in publicly accessible folder. Instead place keys under root folder (usually public_html or www). > > If you store keys as strings in database, then they should be accessible only over HTTPS protocol.

Payment

<?php
    require __DIR__ . '/vendor/autoload.php';

    use RKD\Banklink;

    // Init protocol
    $protocol = new Banklink\Protocol\IPizza(
        'uid100010', // seller ID (VK_SND_ID)
        __DIR__ . '/../keys/seb_user_key.pem', // private key
        '', // private key password, leave empty, if not needed
        __DIR__ . '/../keys/seb_bank_cert.pem', // public key
        'http://localhost/banklink/SEB.php' // return url
    );

    // Init banklink
    $seb = new Banklink\EE\SEB($protocol);

    // Set payment data and get payment request object
    // orderId, sum, message, language
    $request = $seb->getPaymentRequest(123453, 150, 'Test makse', 'EST');

    // You can also add custom request data and/or override request data
    // Optional
    $request = $seb->getPaymentRequest(123453, 150, 'Test makse', 'EST', 'EUR', [
        'VK_REF' => 'my_custom_reference_number', // Override reference number
        'INAPP' => true // Pocopay specific example
    ]);
?>

<form method="POST" action="<?php echo $request->getRequestUrl(); ?>">
  <?php echo $request->getRequestInputs(); ?>
  <input type="submit" value="Pay with SEB!" />
</form>

Authentication

<?php
    require __DIR__ . '/vendor/autoload.php';

    use RKD\Banklink;

    // Init protocol
    $protocol = new Banklink\Protocol\IPizza(
        'uid100010', // seller ID (SND ID)
        __DIR__ . '/../keys/seb_user_key.pem', // private key
        '', // private key password, leave empty, if not needed
        __DIR__ . '/../keys/seb_bank_cert.pem', // public key
        'http://localhost/banklink/SEB.php' // return url
    );

    // Init banklink
    $seb = new Banklink\EE\SEB($protocol);

    // Get auth request object
    $request = $seb->getAuthRequest();
?>

<form method="POST" action="<?php echo $request->getRequestUrl(); ?>">
  <?php echo $request->getRequestInputs(); ?>
  <input type="submit" value="Authenticate with SEB!" />
</form>

Response from provider

<?php
    require __DIR__ . '/vendor/autoload.php';

    use RKD\Banklink;

    // Init protocol
    $protocol = new Banklink\Protocol\IPizza(
        'uid100010', // seller ID (SND ID)
        __DIR__ . '/../keys/seb_user_key.pem', // private key
        '', // private key password, leave empty, if not needed
        __DIR__ . '/../keys/seb_bank_cert.pem', // public key
        'http://localhost/banklink/SEB.php' // return url
    );

    // Init banklink
    $seb = new Banklink\EE\SEB($protocol);

    // Get response object
    $response = $seb->handleResponse($_POST);

    // Successful
    if ($response->wasSuccessful()) {
        // Get whole array of response
        $responseData    = $response->getResponseData();

        // User prefered language
        $language        = $response->getLanguage();

        // Only for payment data
        $orderId         = $response->getOrderId();
        $sum             = $response->getSum();
        $currency        = $response->getCurrency();
        $sender          = $response->getSender();
        $transactionId   = $response->getTransactionId();
        $transactionDate = $response->getTransactionDate();
        $message         = $response->getMessage();
        $automatic       = $response->isAutomatic(); // true if response was sent automatically by bank

        // Only for auth data
        $userId          = $response->getUserId(); // Person ID
        $userName        = $response->getUserName(); // Person name
        $country         = $response->getUserCountry(); // Person country
        $authDate        = $response->getAuthDate(); // Authentication response datetime

        // Method used for authentication
        // Possible values: ID Card, Mobile ID, One-off code card, PIN-calculator, Code card or unknown
        $authMethod      = $response->getAuthMethod();

    // Failed
    } else {
        // Payment data
        $orderId         = $response->getOrderId(); // Order id to cancel order etc.
    }
?>

Tasks

  • composer build - build by running tests and all code checks
  • composer tests - run tests
  • composer format - format code against standards
  • composer docs - build API documentation
  • composer phpmd - run PHP Mess Detector
  • composer phpcs - run PHP CodeSniffer

License

Licensed under MIT

  Files folder image Files  
File Role Description
Files folder image.github (2 files)
Files folder imagedocs (86 files, 1 directory)
Files folder imagesrc (1 file, 5 directories)
Files folder imagetests (4 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .php_cs Example Example script
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file CODE_OF_CONDUCT.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpcs.xml Data Auxiliary data
Accessible without login Plain text file phpmd.xml Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  .github  
File Role Description
  Accessible without login Plain text file ISSUE_TEMPLATE.md Data Auxiliary data
  Accessible without login Plain text file PULL_REQUEST_TEMPLATE.md Data Auxiliary data

  Files folder image Files  /  docs  
File Role Description
Files folder imageresources (6 files)
  Accessible without login HTML file class-RKD.Banklink.Banklink.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.CoopPank.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.Danskebank.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.CoopPank.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.Danskebank.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.Estcard.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.LHV.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.Liisi.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.Luminor.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.Nordea.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.Pocopay.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.SEB.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.EE.Swedbank.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.Estcard.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.LHV.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.Liisi.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.Luminor.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.Nordea.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.Pocopay.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink...ocol.ECommerce.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink...ProtocolHelper.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.Protocol.IPizza.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink...Pizza.Services.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink...l.LiisiPayment.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink...st.AuthRequest.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink...PaymentRequest.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.Request.Request.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink...e.AuthResponse.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink...aymentResponse.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink...ponse.Response.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.SEB.html Doc. Documentation
  Accessible without login HTML file class-RKD.Banklink.Swedbank.html Doc. Documentation
  Accessible without login HTML file classes.html Doc. Documentation
  Accessible without login Plain text file elementlist.js Data Auxiliary data
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login HTML file interface-RKD.Bank...tocolInterface.html Doc. Documentation
  Accessible without login HTML file interface-RKD.Bank...questInterface.html Doc. Documentation
  Accessible without login HTML file interface-RKD.Bank...ponseInterface.html Doc. Documentation
  Accessible without login HTML file interfaces.html Doc. Documentation
  Accessible without login HTML file namespace-RKD.Banklink.EE.html Doc. Documentation
  Accessible without login HTML file namespace-RKD.Banklink.html Doc. Documentation
  Accessible without login HTML file namespace-RKD.Bank...rotocol.Helper.html Doc. Documentation
  Accessible without login HTML file namespace-RKD.Banklink.Protocol.html Doc. Documentation
  Accessible without login HTML file namespace-RKD.Bank...rotocol.IPizza.html Doc. Documentation
  Accessible without login HTML file namespace-RKD.Bank....ProtocolTrait.html Doc. Documentation
  Accessible without login HTML file namespace-RKD.Banklink.Request.html Doc. Documentation
  Accessible without login HTML file namespace-RKD.Banklink.Response.html Doc. Documentation
  Accessible without login HTML file namespace-RKD.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.Banklink.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.CoopPank.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...ink.Danskebank.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...nk.EE.CoopPank.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B....EE.Danskebank.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...ink.EE.Estcard.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.EE.LHV.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.EE.Liisi.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...ink.EE.Luminor.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.EE.Nordea.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...ink.EE.Pocopay.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.EE.SEB.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...nk.EE.Swedbank.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.Estcard.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.LHV.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.Liisi.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.Luminor.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.Nordea.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.Pocopay.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...ocol.ECommerce.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...ProtocolHelper.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...rotocol.IPizza.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...Pizza.Services.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...l.LiisiPayment.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...st.AuthRequest.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...PaymentRequest.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...equest.Request.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...e.AuthResponse.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...aymentResponse.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.B...ponse.Response.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.SEB.html Doc. Documentation
  Accessible without login HTML file source-class-RKD.Banklink.Swedbank.html Doc. Documentation
  Accessible without login HTML file source-interface-R...tocolInterface.html Doc. Documentation
  Accessible without login HTML file source-interface-R...questInterface.html Doc. Documentation
  Accessible without login HTML file source-interface-R...ponseInterface.html Doc. Documentation
  Accessible without login HTML file source-trait-RKD.B...it.NoAuthTrait.html Doc. Documentation
  Accessible without login HTML file trait-RKD.Banklink...it.NoAuthTrait.html Doc. Documentation
  Accessible without login HTML file traits.html Doc. Documentation

  Files folder image Files  /  docs  /  resources  
File Role Description
  Accessible without login Plain text file bootstrap.min.css Data Auxiliary data
  Accessible without login Image file footer.png Data Auxiliary data
  Accessible without login Plain text file jquery-3.2.1.min.js Data Auxiliary data
  Accessible without login Plain text file jquery-ui-1.12.1.min.js Data Auxiliary data
  Accessible without login Plain text file main.js Data Auxiliary data
  Accessible without login Plain text file style.css Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageEE (10 files)
Files folder imageLT (5 files)
Files folder imageProtocol (5 files, 3 directories)
Files folder imageRequest (4 files)
Files folder imageResponse (4 files)
  Plain text file Banklink.php Class Class source

  Files folder image Files  /  src  /  EE  
File Role Description
  Plain text file CoopPank.php Class Class source
  Plain text file Danskebank.php Class Class source
  Plain text file Estcard.php Class Class source
  Plain text file LHV.php Class Class source
  Plain text file Liisi.php Class Class source
  Plain text file Luminor.php Class Class source
  Plain text file Nordea.php Class Class source
  Plain text file Pocopay.php Class Class source
  Plain text file SEB.php Class Class source
  Plain text file Swedbank.php Class Class source

  Files folder image Files  /  src  /  LT  
File Role Description
  Plain text file Estcard.php Class Class source
  Plain text file Luminor.php Class Class source
  Plain text file SEB.php Class Class source
  Plain text file Siauliu.php Class Class source
  Plain text file Swedbank.php Class Class source

  Files folder image Files  /  src  /  Protocol  
File Role Description
Files folder imageHelper (1 file)
Files folder imageIPizza (2 files)
Files folder imageProtocolTrait (1 file)
  Plain text file ECommerce.php Class Class source
  Plain text file IPizza.php Class Class source
  Plain text file IPizza2015.php Class Class source
  Plain text file LiisiPayment.php Class Class source
  Plain text file ProtocolInterface.php Class Class source

  Files folder image Files  /  src  /  Protocol  /  Helper  
File Role Description
  Plain text file ProtocolHelper.php Class Class source

  Files folder image Files  /  src  /  Protocol  /  IPizza  
File Role Description
  Plain text file Services.php Class Class source
  Plain text file Services2015.php Class Class source

  Files folder image Files  /  src  /  Protocol  /  ProtocolTrait  
File Role Description
  Plain text file NoAuthTrait.php Class Class source

  Files folder image Files  /  src  /  Request  
File Role Description
  Plain text file AuthRequest.php Class Class source
  Plain text file PaymentRequest.php Class Class source
  Plain text file Request.php Class Class source
  Plain text file RequestInterface.php Class Class source

  Files folder image Files  /  src  /  Response  
File Role Description
  Plain text file AuthResponse.php Class Class source
  Plain text file PaymentResponse.php Class Class source
  Plain text file Response.php Class Class source
  Plain text file ResponseInterface.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageEE (10 files)
Files folder imagekeys (1 directory)
Files folder imageLT (5 files)
Files folder imageProtocol (4 files, 1 directory)

  Files folder image Files  /  tests  /  EE  
File Role Description
  Plain text file CoopPankTest.php Class Class source
  Plain text file DanskebankTest.php Class Class source
  Plain text file EstcardTest.php Class Class source
  Plain text file LHVTest.php Class Class source
  Plain text file LiisiTest.php Class Class source
  Plain text file LuminorTest.php Class Class source
  Plain text file NordeaTest.php Class Class source
  Plain text file PocopayTest.php Class Class source
  Plain text file SEBTest.php Class Class source
  Plain text file SwedbankTest.php Class Class source

  Files folder image Files  /  tests  /  keys  
File Role Description
Files folder imageIPizza (4 files)

  Files folder image Files  /  tests  /  keys  /  IPizza  
File Role Description
  Accessible without login Plain text file private_key.pem Data Auxiliary data
  Accessible without login Plain text file private_key_sha256.pem Data Auxiliary data
  Accessible without login Plain text file public_key.pem Data Auxiliary data
  Accessible without login Plain text file public_key_sha256.pem Data Auxiliary data

  Files folder image Files  /  tests  /  LT  
File Role Description
  Plain text file EstcardTest.php Class Class source
  Plain text file LuminorTest.php Class Class source
  Plain text file SEBTest.php Class Class source
  Plain text file SiauliuTest.php Class Class source
  Plain text file SwedbankTest.php Class Class source

  Files folder image Files  /  tests  /  Protocol  
File Role Description
Files folder imageHelper (1 file)
  Plain text file ECommerceTest.php Class Class source
  Plain text file IPizza2015Test.php Class Class source
  Plain text file IPizzaTest.php Class Class source
  Plain text file LiiziPaymentTest.php Class Class source

  Files folder image Files  /  tests  /  Protocol  /  Helper  
File Role Description
  Plain text file ProtocolHelperTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:139
This week:7
All time:8,790
This week:60Up
 User Ratings  
 
 All time
Utility:91%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:83%StarStarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:63%StarStarStarStar
Rank:1005