Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/renekorss/banklink

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.
https://github.com/renekorss/banklink

banklink cooppank danskebank gateway lhv liisi luminor nets-estonia nordea payment php-payment-library pocopay seb swedbank

Last synced: 4 days ago
JSON representation

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.

Awesome Lists containing this project

README

        

[![Actions Status](https://github.com/renekorss/Banklink/workflows/build/badge.svg)](https://github.com/renekorss/Banklink/actions)
[![Coverage Status](https://coveralls.io/repos/renekorss/Banklink/badge.svg?branch=master&service=github)](https://coveralls.io/github/renekorss/Banklink?branch=master)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ca9c1ac49f60430ca93758324c42f91f)](https://www.codacy.com/gh/renekorss/Banklink/dashboard?utm_source=github.com&utm_medium=referral&utm_content=renekorss/Banklink&utm_campaign=Badge_Grade)
[![Latest Stable Version](https://poser.pugx.org/renekorss/banklink/v/stable)](https://packagist.org/packages/renekorss/banklink)
[![Total Downloads](https://poser.pugx.org/renekorss/banklink/downloads)](https://packagist.org/packages/renekorss/banklink)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

# 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

````bash
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](https://github.com/renekorss/Banklink/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
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
]);
?>

getRequestInputs(); ?>

````

### Authentication

````php
getAuthRequest();
?>

getRequestInputs(); ?>

````

### Response from provider

````php
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](LICENSE)