PHP Classes

PHP Instapago: Process payments with the Instapago API

Recommend this page to a friend!
  Info   View files Documentation   View files View files (26)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2022-10-21 (1 month ago) RSS 2.0 feedNot enough user ratingsTotal: 121 This week: 1All time: 9,373 This week: 491Up
Version License PHP version Categories
php-instapago 3.0.4MIT/X Consortium ...5.6PHP 5, E-Commerce, Web services
Description Author

This class can process payments with the Instapago API.

It can send HTTP requests to the Instapago API Web server to process several types of payment operations.

Currently it can submit a payment request, process pre-authorized payments, cancel a payment, and get information about a payment.

The code comments are in Spanish.

Picture of ángel cruz
  Performance   Level  
Name: ángel cruz <contact>
Classes: 4 packages by
Country: Uruguay Uruguay
Age: 35
All time rank: 39227 in Uruguay Uruguay
Week rank: 587 Up1 in Uruguay Uruguay Up

Details

<p align="center"> <img src="help/hYNsH6B.png">

</p> <p align="center">

Librería Instapago para PHP

</p> <p align="center">

<sup style="color: #d0d0d0;"><b>NOTA</b> Los logos son propiedad de Instapago y Banesco, respectivamente.</sup>

</p>

Latest Version on Packagist GitHub Workflow Status Total Downloads

instalación

Primero, composer

Luego:

$ composer require instapago/instapago
$ composer dumpautoload -o // opcional

como usar

>NOTA: Tomar en cuenta que esta nueva versión fue probada usando php8.X, no aseguro que funcione en algo menor a eso, en teoría debería pero no estoy seguro.

<?php

require 'vendor/autoload.php';

use \Instapago\Instapago\Api;
use \Instapago\Instapago\Exceptions\{
	InstapagoException,
	AuthException,
	BankRejectException,
	InvalidInputException,
	TimeoutException,
	ValidationException,
	GenericException,
};


$paymentData = [
  'amount' => '200',
  'description' => 'test',
  'card_holder' => 'jon doe',
  'card_holder_id' => '11111111',
  'card_number' => '4111111111111111',
  'cvc' => '123',
  'expiration' => '12/2020',
  'ip' => '127.0.0.1',
];

try{

  $api = new Api('<keyId>','<publicKeyId>');

  $respuesta = $api->directPayment($paymentData);
  // hacer algo con $respuesta
}catch(InstapagoException $e){

  echo $e->getMessage(); // manejar el error

}catch(AuthException $e){

  echo $e->getMessage(); // manejar el error

}catch(BankRejectException $e){

  echo $e->getMessage(); // manejar el error

}catch(InvalidInputException $e){

  echo $e->getMessage(); // manejar el error

}catch(TimeoutException $e){

  echo $e->getMessage(); // manejar el error

}catch(ValidationException $e){

  echo $e->getMessage(); // manejar el error

}catch(GenericException $e){

  echo $e->getMessage(); // manejar el error

}

Podemos revisar rápidamente si todo funciona correctamente escribiendo:

$ php -S localhost:8000

tests

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

  Files folder image Files  
File Role Description
Files folder image.github (2 files, 2 directories)
Files folder imagehelp (2 files)
Files folder imagesrc (2 files, 1 directory)
Files folder imagetests (2 files)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .php-cs-fixer.dist.php Example Example script
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file README.md Doc. Example script

  Files folder image Files  /  .github  
File Role Description
Files folder imageISSUE_TEMPLATE (1 file)
Files folder imageworkflows (4 files)
  Accessible without login Plain text file dependabot.yml Data Auxiliary data
  Accessible without login Plain text file FUNDING.yml Data Auxiliary data

  Files folder image Files  /  .github  /  ISSUE_TEMPLATE  
File Role Description
  Accessible without login Plain text file config.yml Data Auxiliary data

  Files folder image Files  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file dependabot-auto-merge.yml Data Auxiliary data
  Accessible without login Plain text file php-cs-fixer.yml Data Auxiliary data
  Accessible without login Plain text file run-tests.yml Data Auxiliary data
  Accessible without login Plain text file update-changelog.yml Data Auxiliary data

  Files folder image Files  /  help  
File Role Description
  Accessible without login Plain text file DOCUMENTACION.md Doc. Documentation
  Accessible without login Image file hYNsH6B.png Icon Icon image

  Files folder image Files  /  src  
File Role Description
Files folder imageExceptions (7 files)
  Plain text file Api.php Class Class source
  Plain text file Validator.php Class Class source

  Files folder image Files  /  src  /  Exceptions  
File Role Description
  Plain text file AuthException.php Class Class source
  Plain text file BankRejectException.php Class Class source
  Plain text file GenericException.php Class Class source
  Plain text file InstapagoException.php Class Class source
  Plain text file InvalidInputException.php Class Class source
  Plain text file TimeoutException.php Class Class source
  Plain text file ValidationException.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file ApiInstapagoTest.php Class Class source
  Accessible without login Plain text file Pest.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:121
This week:1
All time:9,373
This week:491Up