Skip to content

fdlrahman/midtrans-ci4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


⚠️⚠️ 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 Codeigniter library

MIdtrans ❤️ CI 4!

Requirements

The following plugin is tested under following environment:

  • PHP v7.2+ or greater
  • Codeigniter v4

Installation

  • Download the library and extract the .zip
  • Merge all the files to your codeigniter directory

load library

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>

DOCS

For more info please open dan read snap docs

Or more clearly just click here