nxu/laravel-revolut

A Laravel wrapper for the Revolut Business API

Downloads

2

Stars

0

Version

v1.0

Laravel Revolut Build Status

Laravel wrapper for the revolut-php package developed by Simon Verraest

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this package:

$ composer require vdbelt/laravel-revolut

Laravel 5.5+ will use the auto-discovery function.

In Laravel 5.4 (or if you are not using auto-discovery) register the service provider by adding it to the providers key in config/app.php. Also register the facade by adding it to the aliases key in config/app.php.

'providers' => [
    ...
    Vdbelt\LaravelRevolut\LaravelRevolutServiceProvider::class,
],

'aliases' => [
    ...
    'Revolut' => Vdbelt\LaravelRevolut\Facades\Revolut::class,
]

Configuration

Add the following section to your config/services.php configuration file:

...
'revolut' => [
    'key' => 'XXXXXXXXX',
    'sandbox' => true
]
...

Usage

Here you can see a few examples of just how simple this package is to use.

Accounts API

$accounts = Revolut::accounts()->all();
$account = Revolut::accounts()->get('foo');
$accountDetails = Revolut::accounts()->getDetails('foo');

Payments API

$payment = [
  'request_id' => 'e0cbf84637264ee082a848b',
  'account_id' => 'bdab1c20-8d8c-430d-b967-87ac01af060c',
  'receiver' => [
    'counterparty_id' => '5138z40d1-05bb-49c0-b130-75e8cf2f7693',
    'account_id' => 'db7c73d3-b0df-4e0e-8a9a-f42aa99f52ab'
  ],
  'amount' => 123.11,
  'currency' => 'EUR',
  'reference' => 'Invoice payment #123'
];

$payment = Revolut::payments()->create($payment);

For more examples, check out the usage intructions for revolut-php