Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (28) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2023-05-30 (2 months ago) | Not enough user ratings | Total: 123 | All time: 9,396 This week: 257 |
Version | License | PHP version | Categories | |||
php-instapago 3.0.8 | MIT/X Consortium ... | 5.6 | PHP 5, E-Commerce, Web services |
Description | Author Angel Cruz Contributor | ||||||||
This class can process payments with the Instapago API. |
|
<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>
Primero, composer
Luego:
$ composer require instapago/instapago
$ composer dumpautoload -o // opcional
>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
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (2 files, 2 directories) | ||||
help (2 files) | ||||
src (2 files, 1 directory) | ||||
tests (2 files) | ||||
.editorconfig | Data | Auxiliary data | ||
.php-cs-fixer.dist.php | Example | Example script | ||
CHANGELOG.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE.md | Lic. | License text | ||
README.md | Doc. | Example script |
Files | / | .github |
File | Role | Description | ||
---|---|---|---|---|
ISSUE_TEMPLATE (2 files) | ||||
workflows (5 files) | ||||
dependabot.yml | Data | Auxiliary data | ||
FUNDING.yml | Data | Auxiliary data |
Files | / | .github | / | ISSUE_TEMPLATE |
File | Role | Description |
---|---|---|
bug.yml | Data | Auxiliary data |
config.yml | Data | Auxiliary data |
Files | / | .github | / | workflows |
File | Role | Description |
---|---|---|
dependabot-auto-merge.yml | Data | Auxiliary data |
fix-php-code-style-issues-cs-fixer.yml | Data | Auxiliary data |
fix-php-code-style-issues-pint.yml | Data | Auxiliary data |
run-tests-pest.yml | Data | Auxiliary data |
update-changelog.yml | Data | Auxiliary data |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Exceptions (7 files) | ||||
Api.php | Class | Class source | ||
Validator.php | Class | Class source |
Files | / | src | / | Exceptions |
File | Role | Description |
---|---|---|
AuthException.php | Class | Class source |
BankRejectException.php | Class | Class source |
GenericException.php | Class | Class source |
InstapagoException.php | Class | Class source |
InvalidInputException.php | Class | Class source |
TimeoutException.php | Class | Class source |
ValidationException.php | Class | Class source |
Files | / | tests |
File | Role | Description |
---|---|---|
ApiInstapagoTest.php | Class | Class source |
Pest.php | Aux. | Auxiliary script |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.