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 (214)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-07-25 (2 months ago) RSS 2.0 feedNot enough user ratingsTotal: 104 This week: 2All time: 8,752 This week: 368Up
Version License PHP version Categories
banklink 1.0.5MIT/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
Age: ???
All time rank: 385815 in Estonia Estonia
Week rank: 149 Up2 in Estonia Estonia Up

Details

Build Status Coverage Status Test Status Codacy Badge Latest Stable Version Total Downloads License SensioLabsInsight

PHP Payment library

> PHP payment library to easily integrate Baltic banklinks, E-commerce gateaway (Estcard, Nets Estonia) and Liizi Payment Link.

> View API documentation at http://renekorss.github.io/Banklink/

Composer

composer require renekorss/Banklink

Supported providers

Provider | Payment | Authentication ------------------| ------------------- | ------------------ Danskebank | :white_check_mark: | :white_check_mark: Krediidipank | :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: Nordea | :white_check_mark: | :white_check_mark: Estcard | :white_check_mark: | does not apply Liisi Payment Link| :white_check_mark: | does not apply

How to use?

> 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\SEB($protocol);

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

<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\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\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();

      // 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 tests - run tests - composer docs - build API documentation - composer phpmd - run PHP Mess Detector - composer phpcs - run PHP CodeSniffer

Testing your banklink

You can test your banklink with <a href="http://pangalink.net/" target="_blank">pangalink.net</a> application (Windows, Mac, Linux).

License

Licensed under MIT

  Files folder image Files  
File Role Description
Files folder image.github (2 files)
Files folder imagedocs (6 files, 6 directories)
Files folder imagesrc (10 files, 3 directories)
Files folder imagetests (8 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
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 imageclasses (24 files)
Files folder imagecss (7 files)
Files folder imageimg (7 files, 2 directories)
Files folder imagejs (18 files, 2 directories)
Files folder imagenamespaces (9 files)
Files folder imagepackages (2 files)
  Accessible without login Plain text file classes.svg Data Auxiliary data
  Accessible without login HTML file deprecated.html Doc. Documentation
  Accessible without login HTML file errors.html Doc. Documentation
  Accessible without login HTML file graph_class.html Doc. Documentation
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login HTML file markers.html Doc. Documentation

  Files folder image Files  /  docs  /  classes  
File Role Description
  Accessible without login HTML file RKD.Banklink.Banklink.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Danskebank.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Estcard.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Krediidipank.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.LHV.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Liisi.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Liizi.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Nordea.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Protocol.ECommerce.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Proto...ProtocolHelper.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Protocol.IPizza.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Proto...Pizza.Services.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Protocol.LiisiPayment.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Protocol.LiiziPayment.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Proto...tocolInterface.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Proto...it.NoAuthTrait.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Request.AuthRequest.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Request.PaymentRequest.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Request.Request.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Response.AuthResponse.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Respo...aymentResponse.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Response.Response.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.SEB.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Swedbank.html Doc. Documentation

  Files folder image Files  /  docs  /  css  
File Role Description
  Accessible without login Plain text file bootstrap-responsive.css Data Auxiliary data
  Accessible without login Plain text file bootstrap-responsive.min.css Data Auxiliary data
  Accessible without login Plain text file bootstrap.css Data Auxiliary data
  Accessible without login Plain text file bootstrap.min.css Data Auxiliary data
  Accessible without login Plain text file jquery.iviewer.css Data Auxiliary data
  Accessible without login Plain text file prettify.css Data Auxiliary data
  Accessible without login Plain text file template.css Data Auxiliary data

  Files folder image Files  /  docs  /  img  
File Role Description
Files folder imageicons (22 files)
Files folder imageiviewer (12 files)
  Accessible without login Image file apple-touch-icon-114x114.png Icon Icon image
  Accessible without login Image file apple-touch-icon-72x72.png Icon Icon image
  Accessible without login Image file apple-touch-icon.png Icon Icon image
  Accessible without login Image file favicon.ico Data Auxiliary data
  Accessible without login Image file glyphicons-halflings-white.png Icon Icon image
  Accessible without login Image file glyphicons-halflings.png Icon Icon image
  Accessible without login Image file loader.gif Icon Icon image

  Files folder image Files  /  docs  /  img  /  icons  
File Role Description
  Accessible without login Image file arrow_down.png Icon Icon image
  Accessible without login Image file arrow_right.png Icon Icon image
  Accessible without login Image file class.png Icon Icon image
  Accessible without login Image file constant.png Icon Icon image
  Accessible without login Image file favicon.ico Data Auxiliary data
  Accessible without login Image file file-php.png Icon Icon image
  Accessible without login Image file file.gif Icon Icon image
  Accessible without login Image file folder.gif Icon Icon image
  Accessible without login Image file function.png Icon Icon image
  Accessible without login Image file icon-folder-open-big.png Icon Icon image
  Accessible without login Image file icon-th-big.png Icon Icon image
  Accessible without login Plain text file icon_template.svg Data Auxiliary data
  Accessible without login Image file interface.png Icon Icon image
  Accessible without login Image file method.png Icon Icon image
  Accessible without login Image file ok.png Icon Icon image
  Accessible without login Image file property.png Icon Icon image
  Accessible without login Image file search.gif Icon Icon image
  Accessible without login Image file variable.png Icon Icon image
  Accessible without login Image file view_source.png Icon Icon image
  Accessible without login Image file visibility_private.png Icon Icon image
  Accessible without login Image file visibility_protected.png Icon Icon image
  Accessible without login Image file visibility_public.png Icon Icon image

  Files folder image Files  /  docs  /  img  /  iviewer  
File Role Description
  Accessible without login Image file grab.cur Data Auxiliary data
  Accessible without login Image file hand.cur Data Auxiliary data
  Accessible without login Image file iviewer.rotate_left.png Icon Icon image
  Accessible without login Image file iviewer.rotate_right.png Icon Icon image
  Accessible without login Image file iviewer.zoom_fit.png Icon Icon image
  Accessible without login Image file iviewer.zoom_fit2.gif Icon Icon image
  Accessible without login Image file iviewer.zoom_in.png Icon Icon image
  Accessible without login Image file iviewer.zoom_in2.gif Icon Icon image
  Accessible without login Image file iviewer.zoom_out.png Icon Icon image
  Accessible without login Image file iviewer.zoom_out2.gif Icon Icon image
  Accessible without login Image file iviewer.zoom_zero.png Icon Icon image
  Accessible without login Image file iviewer.zoom_zero2.gif Icon Icon image

  Files folder image Files  /  docs  /  js  
File Role Description
Files folder imagejqplot (8 files, 1 directory)
Files folder imageprettify (19 files)
  Accessible without login Plain text file bootstrap.js Data Auxiliary data
  Accessible without login Plain text file bootstrap.min.js Data Auxiliary data
  Accessible without login Plain text file jquery-1.4.2.min.js Data Auxiliary data
  Accessible without login Plain text file jquery-1.7.1.min.js Data Auxiliary data
  Accessible without login Plain text file jquery-ui-1.8.2.custom.min.js Data Auxiliary data
  Accessible without login Plain text file jquery.cookie.js Data Auxiliary data
  Accessible without login Plain text file jquery.iviewer.js Data Auxiliary data
  Accessible without login Plain text file jquery.iviewer.min.js Data Auxiliary data
  Accessible without login Plain text file jquery.mousewheel.min.js Data Auxiliary data
  Accessible without login Plain text file jquery.panzoom.js Data Auxiliary data
  Accessible without login Plain text file jquery.splitter.js Data Auxiliary data
  Accessible without login Plain text file jquery.tools.min.js Data Auxiliary data
  Accessible without login Plain text file jquery.treeview.js Data Auxiliary data
  Accessible without login Plain text file jquery.xml2json.js Data Auxiliary data
  Accessible without login Plain text file menu.js Data Auxiliary data
  Accessible without login Plain text file sidebar.js Data Auxiliary data
  Accessible without login Plain text file SVGPan.js Data Auxiliary data
  Accessible without login Plain text file template.js Data Auxiliary data

  Files folder image Files  /  docs  /  js  /  jqplot  
File Role Description
Files folder imageplugins (30 files)
  Accessible without login Plain text file changes.txt Doc. Documentation
  Accessible without login Plain text file copyright.txt Doc. Documentation
  Accessible without login Plain text file excanvas.min.js Data Auxiliary data
  Accessible without login Plain text file gpl-2.0.txt Doc. Documentation
  Accessible without login Plain text file jquery.jqplot.min.css Data Auxiliary data
  Accessible without login Plain text file jquery.jqplot.min.js Data Auxiliary data
  Accessible without login Plain text file MIT-LICENSE.txt Doc. Documentation
  Accessible without login Plain text file README.txt Doc. Documentation

  Files folder image Files  /  docs  /  js  /  jqplot  /  plugins  
File Role Description
  Accessible without login Plain text file jqplot.barRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.BezierCurveRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.blockRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.bubbleRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.canvasAxisLabelRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.canvasAxisTickRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.canvasOverlay.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.canvasTextRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.categoryAxisRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.ciParser.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.cursor.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.dateAxisRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.donutRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.dragable.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.enhancedLegendRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.funnelRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.highlighter.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.json2.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.logAxisRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.mekkoAxisRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.mekkoRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.meterGaugeRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.mobile.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.ohlcRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.pieRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.pointLabels.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.pyramidAxisRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.pyramidGridRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.pyramidRenderer.min.js Data Auxiliary data
  Accessible without login Plain text file jqplot.trendline.min.js Data Auxiliary data

  Files folder image Files  /  docs  /  js  /  prettify  
File Role Description
  Accessible without login Plain text file lang-apollo.js Data Auxiliary data
  Accessible without login Plain text file lang-clj.js Data Auxiliary data
  Accessible without login Plain text file lang-css.js Data Auxiliary data
  Accessible without login Plain text file lang-go.js Data Auxiliary data
  Accessible without login Plain text file lang-hs.js Data Auxiliary data
  Accessible without login Plain text file lang-lisp.js Data Auxiliary data
  Accessible without login Plain text file lang-lua.js Data Auxiliary data
  Accessible without login Plain text file lang-ml.js Data Auxiliary data
  Accessible without login Plain text file lang-n.js Data Auxiliary data
  Accessible without login Plain text file lang-proto.js Data Auxiliary data
  Accessible without login Plain text file lang-scala.js Data Auxiliary data
  Accessible without login Plain text file lang-sql.js Data Auxiliary data
  Accessible without login Plain text file lang-tex.js Data Auxiliary data
  Accessible without login Plain text file lang-vb.js Data Auxiliary data
  Accessible without login Plain text file lang-vhdl.js Data Auxiliary data
  Accessible without login Plain text file lang-wiki.js Data Auxiliary data
  Accessible without login Plain text file lang-xq.js Data Auxiliary data
  Accessible without login Plain text file lang-yaml.js Data Auxiliary data
  Accessible without login Plain text file prettify.min.js Data Auxiliary data

  Files folder image Files  /  docs  /  namespaces  
File Role Description
  Accessible without login HTML file default.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Protocol.Helper.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Protocol.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Protocol.IPizza.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Protocol.ProtocolTrait.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Request.html Doc. Documentation
  Accessible without login HTML file RKD.Banklink.Response.html Doc. Documentation
  Accessible without login HTML file RKD.html Doc. Documentation

  Files folder image Files  /  docs  /  packages  
File Role Description
  Accessible without login HTML file Default.html Doc. Documentation
  Accessible without login HTML file default.html Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageProtocol (5 files, 3 directories)
Files folder imageRequest (3 files)
Files folder imageResponse (3 files)
  Plain text file Banklink.php Class Class source
  Plain text file Danskebank.php Class Class source
  Plain text file Estcard.php Class Class source
  Plain text file Krediidipank.php Class Class source
  Plain text file LHV.php Class Class source
  Plain text file Liisi.php Class Class source
  Plain text file Liizi.php Class Class source
  Plain text file Nordea.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  /  Protocol  
File Role Description
Files folder imageHelper (1 file)
Files folder imageIPizza (1 file)
Files folder imageProtocolTrait (1 file)
  Plain text file ECommerce.php Class Class source
  Plain text file IPizza.php Class Class source
  Plain text file LiisiPayment.php Class Class source
  Plain text file LiiziPayment.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

  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

  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

  Files folder image Files  /  tests  
File Role Description
Files folder imagekeys (1 directory)
Files folder imageProtocol (3 files, 1 directory)
  Plain text file DanskebankTest.php Class Class source
  Plain text file EstcardTest.php Class Class source
  Plain text file KrediidipankTest.php Class Class source
  Plain text file LHVTest.php Class Class source
  Plain text file LiisiTest.php Class Class source
  Plain text file NordeaTest.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 (2 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 public_key.pem Data Auxiliary data

  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 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:104
This week:2
All time:8,752
This week:368Up