socialgest/laravel-instapago
Simple library for Instapago API in Laravel 5.*
52,080
8
| Install | |
|---|---|
composer require socialgest/laravel-instapago |
|
| Latest Version: | 2.1.0 |
| PHP: | ~5.6|~7.0 |
| License: | MIT |
| Last Updated: | Sep 12, 2017 |
| Links: | GitHub · Packagist |
Maintainer: SocialGest

Library for Instapago in Laravel 5.* (Version 1.0.0)
Note The logos are owned by Instapago and Banesco, respectively..
Installation
To install, run the following command in your project directory
$ composer require socialgest/laravel-instapago
Then in config/app.php add the following to the providers array:
Socialgest\Instapago\InstapagoServiceProvider::class
Also, if you must (recommend you don't), add the Facade class to the aliases array in config/app.php as well:
'Instapago' => Socialgest\Instapago\Facades\Instapago::class
But it'd be best to just inject the class, like so (this should be familiar):
use Socialgest\Instapago\Instapago;
Configuration
Set in .env
INSTAPAGO_KEY_ID = 74D4A278-C3F8-4D7A-9894-FA0571D7E023
INSTAPAGO_PUBLIC_KEY_ID = e9a5893e047b645fed12c82db877e05a
Example Usage
use Socialgest\Instapago\Instapago;
...
public function pay()
{
$paymentData = [
'amount' => '200',
'description' => 'test',
'cardHolder' => 'jon doe',
'cardHolderId' => '11111111',
'cardNumber' => '4111111111111111',
'cvc' => '123',
'expirationDate' => '12/2019',
'IP' => '127.0.0.1',
];
try{
$instapago = new Instapago();
$respuesta = $instapago->directPayment($paymentData);
// hacer algo con la respuesta
} catch(\Socialgest\Instapago\Instapago\Exceptions\InstapagoException $e){
// manejar el error
} catch(\Socialgest\Instapago\Instapago\Exceptions\TimeoutException $e){
// manejar el error
}
}
Documentation
Key for test
* keyId = 74D4A278-C3F8-4D7A-9894-FA0571D7E023
* publicKeyId = e9a5893e047b645fed12c82db877e05a
License MIT :copyright: 2016