1. Go to this page and download the library: Download andrei930/omnipay-mobilpay 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/ */
$gateway = Omnipay::create('MobilPay');
$gateway->privateKeyPath('/path/to/private.key');
$response = $gateway->completePurchase($_POST)->send();
$response->sendResponse();
switch($response->getMessage())
{
case 'confirmed_pending': // transaction is pending review. After this is done, a new IPN request will be sent with either confirmation or cancellation
//update DB, SET status = "pending"
break;
case 'paid_pending': // transaction is pending review. After this is done, a new IPN request will be sent with either confirmation or cancellation
//update DB, SET status = "pending"
break;
case 'paid': // transaction is pending authorization. After this is done, a new IPN request will be sent with either confirmation or cancellation
//update DB, SET status = "open/preauthorized"
break;
case 'confirmed': // transaction is finalized, the money have been captured from the customer's account
//update DB, SET status = "confirmed/captured"
break;
case 'canceled': // transaction is canceled
//update DB, SET status = "canceled"
break;
case 'credit': // transaction has been refunded
//update DB, SET status = "refunded"
break;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.