PHP Instapago: Process payments with the Instapago API

Recommend this page to a friend!
  Info   View files Documentation   View files View files (28)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-12-20 (9 months ago) RSS 2.0 feedNot enough user ratingsTotal: 120 All time: 9,293 This week: 192Up
Version License PHP version Categories
php-instapago 3.0.2MIT/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: 33
All time rank: 39167 in Uruguay Uruguay
Week rank: 562 Up3 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 php7.4, 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 all

enlaces

licencia

Licencia MIT :copyright: 2016

  Files folder image Files  
File Role Description
Files folder image.github (2 files, 2 directories)
Files folder imagehelp (4 files)
Files folder imagesrc (2 files, 1 directory)
Files folder imagetests (1 file)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .php_cs.dist 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 contributors.txt Doc. Documentation
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file psalm.xml.dist Data Auxiliary data
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 (3 files)
  Accessible without login Plain text file CONTRIBUTING.md 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 php-cs-fixer.yml Data Auxiliary data
  Accessible without login Plain text file psalm.yml Data Auxiliary data
  Accessible without login Plain text file run-tests.yml Data Auxiliary data

  Files folder image Files  /  help  
File Role Description
  Accessible without login Plain text file AUTORES.md Data Auxiliary data
  Accessible without login Plain text file CONTRIBUCION.md Data Auxiliary data
  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

 Version Control Unique User Downloads Download Rankings  
 100%
Total:120
This week:0
All time:9,293
This week:192Up
For more information send a message to info at phpclasses dot org.