1. Go to this page and download the library: Download codevirtus/pesepay 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/ */
codevirtus / pesepay example snippets
use Codevirtus\Payments\Pesepay
$pesepay = new Pesepay("INTEGRATION KEY", "ENCRYPTION KEY");
$response = $pesepay->initiateTransaction($transaction);
if ($response->success()) {
# Save the reference number and/or poll url (used to check the status of a transaction)
$referenceNumber = $response->referenceNumber();
$pollUrl = $response->pollUrl();
# Get the redirect url and redirect user to complete transaction
$redirectUrl = $response->redirectUrl();
} else {
# Get error message
$errorMessage = $response->message();
}
$response = $pesepay->checkPayment($referenceNumber);
if ($response->success()) {
if ($response->paid()) {
# Payment was successfull
}
} else {
# Get error message
$errorMessage = $response->message();
}
$response = $pesepay->pollTransaction($pollUrl);
if ($response->success()) {
if ($response->paid()) {
# Payment was successfull
}
} else {
# Get error message
$errorMessage = $response->message();
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.