kinedu / stpmex-php
This package's canonical repository appears to be gone and the package has been frozen as a result.
v1.3.0
2022-10-20 18:57 UTC
Requires
- php: ^7.1|^8.0
- guzzlehttp/guzzle: ^7.0
This package is auto-updated.
Last update: 2023-08-24 15:36:51 UTC
README
Installation
composer require kinedu/stpmex-php
Usage
Client
Example:
<?php use Kinedu\STP\Client; $account = '646180123400000001'; $key = file_get_contents('key.pem'); $passphrase = '12345678'; $live = false; $client = new Client($account, $key, $passphrase, $live);
Account Service
Example:
<?php use Kinedu\STP\Client; $client = new Client(...); $client->account()->balance();
Catalogue Service
Example:
<?php use Kinedu\STP\Client; $client = new Client(...); $client->catalogue()->get();
Order Service
Example - Create new transfer dispersal:
<?php use Kinedu\STP\Client; use Kinedu\STP\Catalogue\{ AccountTypeCatalogue, FinancialInstitutionCatalogue }; $client = new Client(...); $client->order()->create([ 'claveRastreo' => '123456789000000000000000003', 'conceptoPago' => 'Kinedu Payment', 'emailBeneficiario' => 'john.doe@example.com', 'cuentaBeneficiario' => '012345678987654321', 'empresa' => 'KINEDU', 'institucionContraparte' => FinancialInstitutionCatalogue::BANORTE_IXE, 'institucionOperante' => FinancialInstitutionCatalogue::STP, 'iva' => 16.00, 'monto' => 1200.00, 'nombreBeneficiario' => 'John Doe', 'nombreOrdenante' => 'Kinedu SAPI de CV', 'prioridad' => 1, 'referenciaNumerica' => '1234567', 'tipoCuentaBeneficiario' => AccountTypeCatalogue::CLABE, 'tipoPago' => PaymentTypeCatalogue::THIRD_PARTIES, 'medioEntrega' => 3, ]);
Example - Consult historical orders:
<?php use Kinedu\STP\Client; $client = new Client(...); $client->order()->get([ 'empresa' => 'KINEDU', 'fechaOperacion' => '20220110', 'tipo' => 'E', ]);
CoDi Service
Example - Create QR Code: (STP Documentation: RegistraCobroQR)
<?php use Kinedu\STP\Client; $client = new Client(...); $client->codi()->createQrCode([ 'numeroReferenciaComercio' => '1234567', 'concepto' => '45elconceptopagodebesoportar40caracteres', 'minutosLimite' => '500', 'monto' => '160.00', 'nombreBeneficiario' => 'SISTEMA DE TRANSFERENCIAS Y PAGOS STP SA', 'bancoBeneficiario' => '90646', 'tipoCuentaBeneficiario' => '40', 'cuentaBeneficiario' => '646180263401100002', 'empresa' => 'EMPRESA', 'tipoPagoDeSpei' => '20', ]);
Example - Check CoDi status: (STP Documentation: ConsultaEstado)
<?php use Kinedu\STP\Client; $client = new Client(...); $client->codi()->getStatus([ 'folioCodi' => '270688d1c9', 'empresa' => 'EMPRESA', ]);
License
The STP Mexico PHP library is open-sourced software licensed under the MIT license.