PHP code example of datomatic / laravel-carta-del-docente

1. Go to this page and download the library: Download datomatic/laravel-carta-del-docente 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/ */

    

datomatic / laravel-carta-del-docente example snippets


return [
    'certificatePath' => env('CARTA_DEL_DOCENTE_CERTIFICATE'),
    'certificatePassword' => env('CARTA_DEL_DOCENTE_CERTIFICATE_PASSWORD'),
    'environment' => env('CARTA_DEL_DOCENTE_ENV', config('app.env')),
];

use Datomatic\LaravelCartaDelDocente\Facades\CartaDelDocente;

CartaDelDocente::merchantActivation();
CartaDelDocente::check(1, 'voucher');
CartaDelDocente::confirm(1, 'voucher', 52.5);


use Datomatic\CartaDelDocente\CartaDelDocenteClient;

//Resolve
$client = App::make(CartaDelDocenteClient::class);
$client = app(CartaDelDocenteClient::class);
$client = resolve(CartaDelDocenteClient::class);

//Automatic Injection
public function __construct(public CartaDelDocenteClient $client){}

$client->merchantActivation();
$client->check(1, 'voucher');
$client->confirm(1, 'voucher', 52.5);