socialgest / laravel-instapago
Simple library for Instapago API in Laravel 5.*
Installs: 52 074
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
Requires (Dev)
- guzzlehttp/guzzle: ^6.2
- phpunit/phpunit: ~4.0||~5.0
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2025-01-24 19:46:43 UTC
README
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 ©️ 2016