1. Go to this page and download the library: Download paymint/paymint-php 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/ */
paymint / paymint-php example snippets
use PayMint\PayMintClient;
$paymint = new PayMintClient('sec_live_your_secret_key');
// Initialize Checkout
$checkout = $paymint->checkout()->initialize([
'amount' => 5000,
'email' => '[email protected]',
'reference' => 'ORDER_12345', // Optional unique reference
'redirect_url' => 'https://mywebsite.com/payment/callback',
'name' => 'John Doe', // Optional
'phone' => '08012345678', // Optional
]);
// Redirect customer to the payment page
header('Location: ' . $checkout['data']['authorization_url']);
exit;
// Verify Payment upon return
$payment = $paymint->checkout()->verify('ORDER_12345');
if ($payment['data']['status'] === 'successful') {
// Transaction is verified! Give value to customer
}