1. Go to this page and download the library: Download ekoindia/eps-sdk 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/ */
ekoindia / eps-sdk example snippets
use Eko\Eps\EpsIndeterminateException;
try {
$client->call('bbps-pay-bill', [/* … */]);
} catch (EpsIndeterminateException $e) {
// $e->clientRefId — persist it; $e->statusCheck['data']['tx_status']:
// "0" success, "1" fail, "2" awaited. Inquire again later with
// $client->call('transaction-inquiry', ['client_ref_id' => $e->clientRefId]);
}
use Eko\Eps\EpsClient;
$client = new EpsClient(
developerKey: getenv('EPS_DEVELOPER_KEY'),
accessKey: getenv('EPS_ACCESS_KEY'), // server-side secret
initiatorId: '9962981729', // your registered mobile; injected into every call
environment: 'sandbox' // or 'production'
);
// Call an endpoint by its slug; params fill path tokens and the request body.
// initiator_id / user_code are supplied from the client config above.
$result = $client->call('dmt-get-sender', [
'customer_id' => '9123456789',
]);
print_r($result);
use Eko\Eps\EpsHttpException;
try {
$result = $client->call('pan-lite', [/* … */]);
} catch (EpsHttpException $e) {
error_log("HTTP {$e->status}");
print_r($e->body); // decoded envelope, or null when the body was not JSON
}