All Projects → renekorss → Banklink

renekorss / Banklink

Licence: MIT license
PHP payment library to easily integrate Baltic banklinks (supports old and new iPizza protocol), E-commerce gateaway (Estcard, Nets Estonia), Liisi Payment Link and Pocopay.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Banklink

Commerce billing
A payment processing library for Elixir
Stars: ✭ 170 (+400%)
Mutual labels:  payment, gateway
cashier
Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP
Stars: ✭ 43 (+26.47%)
Mutual labels:  payment, gateway
omise-magento
Omise Magento Plugin
Stars: ✭ 32 (-5.88%)
Mutual labels:  payment, gateway
laravel-viva-payments
A Laravel package for integrating the Viva Payments gateway
Stars: ✭ 29 (-14.71%)
Mutual labels:  payment, gateway
Gringotts
A complete payment library for Elixir and Phoenix Framework
Stars: ✭ 396 (+1064.71%)
Mutual labels:  payment, gateway
laravel-multi-payment
Laravel online gateway payment package with multi driver support
Stars: ✭ 22 (-35.29%)
Mutual labels:  payment, gateway
laravel-hyperpay
Laravel package for Hyperpay payment gateway in MENA.
Stars: ✭ 14 (-58.82%)
Mutual labels:  payment, gateway
Moyasar Php
Moyasar PHP client library
Stars: ✭ 5 (-85.29%)
Mutual labels:  payment, gateway
Parbad
A free, open-source, integrated and extensible library which connects your web applications to online payment gateways. Gateways can be added or developed by you.
Stars: ✭ 194 (+470.59%)
Mutual labels:  payment, gateway
go-zero
A cloud-native Go microservices framework with cli tool for productivity.
Stars: ✭ 23,294 (+68411.76%)
Mutual labels:  gateway
credit-card-prompt
Credit card prompt with validation and address lookup
Stars: ✭ 13 (-61.76%)
Mutual labels:  payment
node-lumi-aqara
Control your Xiaomi Smart Home devices with this Lumi Aqara library
Stars: ✭ 45 (+32.35%)
Mutual labels:  gateway
api-gateway
Node.js API gateway that works as single entry point for all clients in a MicroService architecture pattern.
Stars: ✭ 26 (-23.53%)
Mutual labels:  gateway
adyen-hybris
Adyen Payment plugin for Hybris
Stars: ✭ 23 (-32.35%)
Mutual labels:  payment
consul-api-gateway
The Consul API Gateway is a dedicated ingress solution for intelligently routing traffic to applications running on a Consul Service Mesh.
Stars: ✭ 88 (+158.82%)
Mutual labels:  gateway
GatewayService
GatewayService (Ocelot).
Stars: ✭ 19 (-44.12%)
Mutual labels:  gateway
react-stripe-script-loader
A React Component that loads Stripe script if necessary and shows React Stripe Elements
Stars: ✭ 22 (-35.29%)
Mutual labels:  payment
QUaModbusClient
Modbus to OPC UA Gateway
Stars: ✭ 38 (+11.76%)
Mutual labels:  gateway
GateWay
🥗OpenIoTHub Gateway for mobile(网关移动应用)
Stars: ✭ 25 (-26.47%)
Mutual labels:  gateway
LogiEM
面向Elasticsearch研发与运维人员,围绕集群、索引构建的零侵入、多租户的Elasticsearch GUI管控平台
Stars: ✭ 209 (+514.71%)
Mutual labels:  gateway

Actions 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
Coop Pank
LHV
SEB
Swedbank
Luminor
Nordea
Pocopay does not apply
Estcard does not apply
Liisi Payment Link does not apply
Lithuania
SEB does not apply
Swedbank does not apply
Luminor does not apply
Šiaulių does not apply
Estcard 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 test - 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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].