Code Monkey home page Code Monkey logo

codeigniter4-midtrans's Introduction

Software License Build Status StyleCI Quality Score

Midtrans for CodeIgniter 4 [UNOFFICIAL LIBRARY]

Midtrans ❤️ CodeIgniter 4!

Veritrans now is Midtrans

This is the all new Codeigniter client library for Veritrans 2.0. Visit https://www.midtrans.com for more information about the product and see documentation at http://docs.midtrans.com for more technical details.

What's new?

SNAP! for technical info Visit https://snap-docs.midtrans.com

Requirements

The following plugin is tested under following environment:

  • PHP v7.2.x or greater.
  • CodeIgniter v4.0.4.
  • Laminas JSON (Include).

Installation

  • Use Composer composer require codenom/midtrans (Recommended).

Configuration

After installation Module, please follow instruction:

  • Publish via CLI: php spark codenom:midtrans publish .
  • After publish, check file Midtrans.php on App/Config/Midtrans.php.
  • Setup Merchant Key, ID Merchant, Client Key and set Production public $isProduction = TRUE (Production) or FALSE (Sandbox) on Midtrans.php.

For more setup Merchant Key & Client Key Retrieve API Access Key.

For more setup Environments Environments.

Using Midtrans Library

Use Midtrans

//load services Midtrans
$services = new Config\Services::Midtrans();

OR

//load services Midtrans
$services = new services('Midtrans');

Available Function

  • Get Snap Token
/**
 * @param array $placeOrder
 * @return object response CURL
 */
$services->getSnapToken(array $placeOrder = []);

Use Veritrans

//load services Veritrans
$services = new Config\Services::veritrans();

OR

//load services Veritrans
$services = new services('Veritrans');

Available Function

  • Get Status transaction
/**
 * @param string $id
 *
 * @return object response CURL
 */
 $services->getStatus($id);
  • Appove challenge transaction
/**
 * @param $id ID transactions
 * @return status code from Midtrans
 */
$services->approve($id);
  • Cancel transaction before it's setteled
/**
 * @param string $id Order ID or transaction ID
 * @return string
*/
$services->cancel($id);
  • Expire transaction before it's setteled
/**
 * @param string $id Order ID or transaction ID
 * @return mixed[]
 */
$services->expire($id);

Documentation

For more COMINGSOON

Sample Data

You can visit the following repository: Midtrans Sample Data

codeigniter4-midtrans's People

Contributors

codenomdev avatar falachul14 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.