i10digital/i10-sdk-php

Public SDK for i10 Banking Platform

2.4.1 2020-06-09 21:03 UTC

README

Public SDK for i10 Banking Platform. The instructions below are for use with Laravel.

Install

composer require i10digital/i10-sdk-php

Setup

  1. Open the file config/app.php and add:
'providers' => [

    ...

    iDez\iDezServiceProvider::class,
],
  1. Open the file config/services.php and add:
'idez' => [
    'base_uri' => env('IDEZ_BASE_URI', null),
    'client_id' => env('IDEZ_CLIENT_ID', null),
    'client_secret' => env('IDEZ_CLIENT_SECRET', null),
    'username' => env('IDEZ_USERNAME', null),
    'password' => env('IDEZ_PASSWORD', null),
    'account_id' => env('IDEZ_ACCOUNT_ID', null),
    'plexi_token' => env('IDEZ_PLEXI_TOKEN', null),
],

Usage

Account

Manage accounts.

use iDez\Facades\Account;

...

$account = Account::create([
    'holder' => [
        'is_pep': false,
        'type' => 'person',
        'name' => 'Roberto Carlos',
        'document' => '11111111111',
        'phone' => '31999999999',
        'email' => 'roberto@globo.com',
        'birth_date' => '2000-11-20',
        'mother_name' => 'Mãe do Roberto',
        'address' => [
            'postal_code' => '30130-011',
            'number' => '2880',
            'extra' => '',
            'street' => 'Afonso Pena',
            'district' => 'Savassi',
            'locality' => 'Belo Horizonte',
            'state' => 'MG',
        ],
    ],
});

$account = Account::create([
    'holder' => [
        'type' => 'company',
        'document' => '11111111111111',
        'phone' => '31999999999',
        'name' => 'Roberto Lanches',
        'email' => 'roberto@globo.com',
        'legal_name' => 'Roberto Carlos 11111111111',
        'legal_nature' => '2313',
        'establishment_date' => '2015-10-30',
        'establishment_type' => 'MEI',
        'main_cnae' => '00.00-0-00',
        'address' => [
            'postal_code' => '30130-011',
            'number' => '2880',
            'extra' => '',
            'street' => 'Afonso Pena',
            'district' => 'Savassi',
            'locality' => 'Belo Horizonte',
            'state' => 'MG',
        ],
        'partners' => [
            {
                'name': 'Roberto Carlos',
                'document': '11111111111',
                'birth_date': '2000-11-20',
                'phone': '31999999999',
            },
        ],
    ],
});

BankSlip

Deposit.

use iDez\Facades\BankSlip;

...

$bankSlip = BankSlip::create([
    'type' => 'deposit',
    'due_at' => '2020-03-30',
    'amount' => 25.15,
]);

Transfer

Sends money to another account.

use iDez\Facades\Transfer;

...

$transfer = Transfer::create([
    'pin' => '1234',
    'type' => 'ted',
    'amount' => 54.99,
    'description' => 'Test',
    'beneficiary' => [
        'name' => 'Mr. Blue Sky',
        'document' => '12345678900',
        'bank' => 123,
        'branch' => '1234',
        'account' => '98765',
    ],
]);