1. Go to this page and download the library: Download armezit/omnipay-nextpay 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/ */
armezit / omnipay-nextpay example snippets
use Omnipay\Omnipay;
$gateway = Omnipay::create('Nextpay');
$gateway->setApiKey('API_KEY');
$gateway->setReturnUrl('https://www.example.com/return');
// Send purchase request
$response = $gateway->purchase([
'amount' => $amount,
'currency' => $currency,
'transactionId' => $orderId, // order_id on merchant side
])->send();
// Process response
if ($response->isSuccessful() && $response->isRedirect()) {
// store the transaction reference to use in completePurchase()
$transactionReference = $response->getTransactionReference();
// Redirect to offsite payment gateway
$response->redirect();
} else {
// Payment failed: display message to customer
echo $response->getMessage();
}