2017 © Pedro Peláez
 

library php-tikkie

Implementation of the Tikkie API interface.

image

jarnovanleeuwen/php-tikkie

Implementation of the Tikkie API interface.

  • Wednesday, June 20, 2018
  • by jarnovanleeuwen
  • Repository
  • 3 Watchers
  • 10 Stars
  • 342 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 356 % Grown

The README.md

Build Status, (*1)

⚠️ Tikkie has announced that on 01-01-2021 it will stop supporting the Tikkie Payment Request API (the API that this library implements) in favor of the new Tikkie API. See https://medium.com/abn-amro-developer/abn-amro-introduces-the-new-tikkie-api-87c8bb54720a for more information, including a roadmap., (*2)

Currently, I am not planning to update this library. This might change in the future, but meanwhile PRs are welcome., (*3)


Easily create payment requests through Tikkie.

Unofficial PHP implementation of the Tikkie Payment Request API (deprecated, available until 01-01-2021)., (*4)

Installation

PHPTikkie requires PHP 7.1+, (*5)

Add this package to your project using Composer:, (*6)

composer require jarnovanleeuwen/php-tikkie, (*7)

Usage

Initialise PHPTikkie

use PHPTikkie\Environment;
use PHPTikkie\PHPTikkie;

$apiKey = "abc123";
$testMode = true;

$environment = new Environment($apiKey, $testMode);
$environment->loadPrivateKey('private_rsa.pem');

$tikkie = new PHPTikkie($environment);

Create platform

use PHPTikkie\Entities\Platform;

$platform = $tikkie->newPlatform([
    // Mandatory attributes
    'name' => 'YourPlatform',
    'phoneNumber' => '06123456789',
    'platformUsage' => Platform::USAGE_TYPE_MYSELF,

    // Optional attributes
    'email' => 'tikkie@yourcompany.com',
    'notificationUrl' => ''
])->save();

$platformToken = $platform->platformToken;

Create user

$user = $tikkie->newUser($platformToken, [
    'name' => 'ExamplePlatform',
    'phoneNumber' => '06123456789',
    'iban' => 'NL00BANK123456789',
    'bankAccountLabel' => 'YourLabel'
])->save();

$userToken = $user->userToken;
$bankAccountToken = $user->bankAccounts[0]->bankAccountToken;

Create payment request

$paymentRequest = $tikkie->newPaymentRequest($platformToken, $userToken, $bankAccountToken, [
    // Mandatory attributes
    'amountInCents' => '1250',
    'currency' => 'EUR',
    'description' => 'Thank you',
    'externalId' => 'Order 1234'
])->save();

$tikkieUrl = $paymentRequest->paymentRequestUrl;
$paymentRequestToken = $paymentRequest->paymentRequestToken;

Get payment request

function paymentRequest(string $platformToken, string $userToken, string $paymentRequestToken): PaymentRequest

List platforms

function platforms(): Platform[]

List users

function users(string $platformToken): User[]

List payment requests

function paymentRequests(string $platformToken, string $userToken, int $offset, int $limit, DateTimeInterface $fromDate = null, DateTimeInterface $toDate = null): PaymentRequest[]

Process payments

$paymentRequest = $tikkie->paymentRequest($platformToken, $userToken, $paymentRequestToken);

foreach ($paymentRequest->payments as $payment) {
    if ($payment->isPaid()) {
        // Payment successful
    }
}

Exception handling

All methods may return a PHPTikkieException containing an error code and description., (*8)

```php use PHPTikkie\Exceptions\PHPTikkieException;, (*9)

try { var_dump($tikkie->platforms()); } catch (PHPTikkieException $exception) { print $exception->getMessage(); // [ERR_2005_002] The API Key is invalid for the requested resource | traceId: 6fda2ce8-225d-4ca2-920a-b687c7aeb2f3 | (see https://developer.abnamro.com/get-started#obtaining-an-api-key) }, (*10)

The Versions

20/06 2018

dev-master

9999999-dev https://github.com/jarnovanleeuwen/php-tikkie

Implementation of the Tikkie API interface.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jarno van Leeuwen

api payment pay abnamro tikkie

20/06 2018

v0.2.0

0.2.0.0 https://github.com/jarnovanleeuwen/php-tikkie

Implementation of the Tikkie API interface.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jarno van Leeuwen

api payment pay abnamro tikkie

19/06 2018

v0.1.2

0.1.2.0 https://github.com/jarnovanleeuwen/php-tikkie

Implementation of the Tikkie API interface.

  Sources   Download

MIT

The Requires

 

by Jarno van Leeuwen

api payment pay abnamro tikkie

05/03 2018

v0.1.1

0.1.1.0 https://github.com/jarnovanleeuwen/php-tikkie

Implementation of the Tikkie API interface.

  Sources   Download

MIT

The Requires

 

by Jarno van Leeuwen

api payment pay abnamro tikkie

12/12 2017

v0.1

0.1.0.0 https://github.com/jarnovanleeuwen/php-tikkie

Implementation of the Tikkie API interface.

  Sources   Download

MIT

The Requires

 

by Jarno van Leeuwen

api payment pay abnamro tikkie