Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Latest commit

 

History

History
87 lines (52 loc) · 2.21 KB

README.md

File metadata and controls

87 lines (52 loc) · 2.21 KB

Twikey PHP Client

Latest Version on Packagist Total Downloads Software License Build Status

PHP Client for the Twikey API

Installation

You can install the package via composer:

composer require appstract/Twikey-php-client

Usage

Setup the connection.

use Appstract\Twikey\Connection;
use Appstract\Twikey\Twikey;

$connection = new Connection();

$connection->setApiToken('yourapitoken');

$twikey = new Twikey($connection);

Create an invitation:

$invite = $twikey::invite();

$invite->ct = 1234;
$invite->l = 'nl';
$invite->iban = 'GB33BUKB20201555555555';
$invite->bic = 'BUKBGB22';
$invite->email = '[email protected]';
$invite->reminderDays = 14;

$invite->save();

var_dump($invite->toArray());

Find a mandate:

$mandate = $twikey::mandate()->find('ABC5');

var_dump($mandate->toArray());

Create a transaction:

$transaction = $twikey::transaction();
$transaction->mndtId = 'ABC5';
$transaction->message = 'Invoice 1234';
$transaction->amount = '84.32';

$transaction->save();

var_dump($transaction->toArray());

Contributing

Contributions are welcome, thanks to y'all :)

About Appstract

Appstract is a small team from The Netherlands. We create (open source) tools for Web Developers and write about related subjects on Medium. You can follow us on Twitter, buy us a beer or support us on Patreon.

License

The MIT License (MIT). Please see License File for more information.