1. Go to this page and download the library: Download mehdirochdi/cmi-payment-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/ */
title="example/process.php"
// REQUIRED PARAMS
$client = new Mehdirochdi\CMI\CmiClient([
'storekey' => '', // STOREKEY
'clientid' => '', // CLIENTID
'oid' => '135ABC', // COMMAND ID IT MUST BE UNIQUE
'shopurl' => 'YOUR_DOMAIN_HERE', // SHOP URL FOR REDIRECTION
'okUrl' => 'YOUR_DOMAIN_HERE/okFail.php', // REDIRECTION AFTER SUCCEFFUL PAYMENT
'failUrl' => 'YOUR_DOMAIN_HERE/okFail.php', // REDIRECTION AFTER FAILED PAYMENT
'email' => '[email protected]', // YOUR EMAIL APPEAR IN CMI PLATEFORM
'BillToName' => 'mehdi rochdi', // YOUR NAME APPEAR IN CMI PLATEFORM
'BillToCompany' => 'company name', // YOUR COMPANY NAME APPEAR IN CMI PLATEFORM
'amount' => $_POST['amount'], // RETRIEVE AMOUNT WITH METHOD POST
'CallbackURL' => 'YOUR_DOMAIN_HERE/callback.php', // CALLBACK
]);
$client->redirect_post(); // CREATE INPUTS HIDDEN, GENERATE A VALID HASH AND MAKE REDIRECT POST TO CMI
title="example/process.php"
// REQUIRED PARAMS
$client = new Mehdirochdi\CMI\CmiClient([
...
'AutoRedirect' => 'true',
]);
OR
$client->AutoRedirect = 'true'; // REDIRECT THE CUSTOMER AUTOMATICALY BACK TO THE MERCHANT's WEB SITE WHEN TRANSACION IS ACCEPTED
$client->redirect_post(); // CREATE INPUTS HIDDEN, GENERATE A VALID HASH AND MAKE REDIRECT POST TO CMI
shell
composer
shell
shell
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.