PHP code example of ilbronza / payments

1. Go to this page and download the library: Download ilbronza/payments library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ilbronza / payments example snippets


use IlBronza\Payments\Models\Traits\InteractsWithInvoicingData;

class Client extends Model
{
    use InteractsWithInvoicingData;
}

$dati = $cliente->invoicingData()->updateOrCreate([], [
    'vat' => '01234567890',
    'rea_number' => 'MI-1234567',
    'istat_code' => '015146',
    'ateco_code' => '62.10.00',
    'pubblica_amministrazione' => false,
    'sdi' => 'ABC1234',
    'split_payment' => false,
]);

$dati = $cliente->invoicingData;
$proprietario = $dati->invoicingDataable;

$dati->invoicingDataable()->associate($model);
$dati->save();

use IlBronza\Payments\Models\Traits\InteractsWithBankaccounts;

class Client extends Model
{
    use InteractsWithBankaccounts;
}

$conto = $cliente->bankaccounts()->create([
    'iban' => 'IT60X0542811101000000123456',
    'abi' => '05428',
    'cab' => '11101',
    'account_number' => '000000123456',
]);

$conti = $cliente->bankaccounts;
$intestatario = $conto->bankaccountable;

$conto->bankaccountable()->associate($cliente);
$conto->save();

$conto->bankaccountable()->dissociate();
$conto->save();

'bankaccounts' => [
    'controller' => config('payments.models.bankaccount.controllers.index'),
    'elementGetterMethod' => 'getRelatedBankaccountElements',
],