⚠️ ⚠️ ANNOUNCEMENT⚠️ ⚠️
Please use the updated and composer compatible library: Midtrans PHP. For better more modern composer compatibility.
This repo still be here for archive and compatibility purpose. But it's always recommended to use the newer version Midtrans PHP.
🔈 END OF ANNOUNCEMENT 🔈
MIdtrans ❤️ CI 4!
The following plugin is tested under following environment:
- PHP v7.2+ or greater
- Codeigniter v4
- Download the library and extract the .zip
- Merge all the files to your codeigniter directory
Check to app/controllers/Payment.php
, change with your server key, in your dashboard midtrans
//set production to true for production environment
$params = array('server_key' => '<your server key>', 'production' => false);
$this->load->library('veritrans');
$this->veritrans->config($params);
Check to app/views/Payment/pay.php
, change data-client-key with your client key, in your dashboard midtrans
// Remove ".sandbox" from script src URL for production environment
<script src="https://app.sandbox.midtrans.com/snap/snap.js" data-client-key="<Set your ClientKey here>"></script>
For more info please open dan read snap docs
Or more clearly just click here