tepuilabs/laravel-instapago

Library for payments in VEF (Bsf.) in Venezuela.

v3.1.0 2024-03-03 22:12 UTC

This package is auto-updated.

Last update: 2024-11-08 01:47:39 UTC


README

Library for payments in VEF (Bsf.) in Venezuela.

Latest Version on Packagist Tests Total Downloads

Library for payments in VEF (Bsf.) in Venezuela.

Installation

You can install the package via composer:

composer require tepuilabs/laravel-instapago

You can publish the config file with:

php artisan vendor:publish --tag="laravel-instapago-config"

This is the contents of the published config file:

<?php

return [
    'key_id' => env('INSTAPAGO_KEY_ID'),
    'public_key_id' => env('INSTAPAGO_PUBLIC_KEY_ID'),
];

Usage

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{

    $response = LaravelInstapago::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

}

TODO: add more docs

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Credits

License

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