PHP code example of towoju5 / stpmex-php
1. Go to this page and download the library: Download towoju5/stpmex-php 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/ */
towoju5 / stpmex-php example snippets
use Towoju5\STP\Client;
$account = '646180123400000001';
$key = file_get_contents('key.pem');
$passphrase = '12345678';
$live = false;
$client = new Client($account, $key, $passphrase, $live);
use Towoju5\STP\Client;
$client = new Client(...);
$client->account()->balance();
use Towoju5\STP\Client;
$client = new Client(...);
$client->catalogue()->get();
use Towoju5\STP\Client;
use Towoju5\STP\Catalogue\{
AccountTypeCatalogue,
FinancialInstitutionCatalogue
};
$client = new Client(...);
$client->order()->create([
'claveRastreo' => '123456789000000000000000003',
'conceptoPago' => 'Towoju5 Payment',
'emailBeneficiario' => '[email protected] ',
'cuentaBeneficiario' => '012345678987654321',
'empresa' => 'KINEDU',
'institucionContraparte' => FinancialInstitutionCatalogue::BANORTE_IXE,
'institucionOperante' => FinancialInstitutionCatalogue::STP,
'iva' => 16.00,
'monto' => 1200.00,
'nombreBeneficiario' => 'John Doe',
'nombreOrdenante' => 'Towoju5 SAPI de CV',
'prioridad' => 1,
'referenciaNumerica' => '1234567',
'tipoCuentaBeneficiario' => AccountTypeCatalogue::CLABE,
'tipoPago' => PaymentTypeCatalogue::THIRD_PARTIES,
'medioEntrega' => 3,
]);
shell
composer