1. Go to this page and download the library: Download fm-labs/cakephp-mpay24 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/ */
fm-labs / cakephp-mpay24 example snippets
// src/Application.php
class Application extends \Cake\Application {
public bootstrap($configDir) {
// ... your bootstrap code ...
$this->addPlugin('FmLabs/Mpay24')
}
}
try {
$mpay24 = new \FmLabs\Mpay24\Lib\Mpay24Client('testing');
$mdxi = new \FmLabs\Mpay24\Lib\Mpay24Order()
// ... setup mdxi order ...
if (!$mdxi->validate()) {
throw new \RuntimeException('Failed to validate MDXI.');
}
$mpay24Response = $mpay24->paymentPage($mdxi);
$paymentPageURL = $mpay24Response->getLocation(); // get redirect location to the payment page
if ($paymentPageURL) {
// ... redirect user to payment page ...
}
} catch (\Exception $ex) {
debug("Something went wrong: " . $ex->getMessage());
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.