1. Go to this page and download the library: Download samyan/omnipay-ecopayz 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/ */
// You code
// { . . . }
$request = $gateway->completePurchase();
$response = $request->send();
// Check if ok
if (!$response->isSuccessful()) {
return false;
}
// Get XML object
$xml = $response->getData();
$resultCode = (string)$xml->TransactionResult->Code;
// Check transaction status
switch ($resultCode) {
case '0':
$state = 'success';
break;
case '1':
$state = 'failed';
break;
case '2':
$state = 'cancelled';
break;
case '3':
$state = 'failed';
break;
case '4':
$state = 'pending';
break;
case '5':
$state = 'cancelled';
}
// You code
// { . . . }
// At the end print the response to Ecopayz (obligatory for completation of purchase)
echo $response->getXmlData();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.