1. Go to this page and download the library: Download haneul-chile/flow 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/ */
public function return(Request $request)
{
$token = $request->token;
$params = [
'token' => $token
];
$response = Flow::getFlow('/payment/getStatus', $params);
if ($response->status == 1) {
//Acá el cliente volvió a tu sitio web
return 'back';
}
if ($response->status == 2) {
//Acá el cliente realizo el pago exitosamente
return 'exito';
}
//Acá el pago del cliente fue rechazado
return 'fracaso';
}
public function confirmation(Request $request)
{
$token = $request->token;
$params = [
'token' => $token
];
$response = Flow::getFlow('/payment/getStatus', $params);
//Acá debes actualizar el pago en tu web como "pagado"
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.