1. Go to this page and download the library: Download instapago/instapago library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
instapago / instapago example snippets
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
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.