Skip to content

andisis/raja-ongkir-codeigniter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Raja Ongkir Library for CodeIgniter 3.x

CodeIgniter library for consuming RajaOngkir API. This library is an update from hok00age which is not updated. This library can be used for all types of accounts (starter, basic and pro).

NOTE: This repo is no longer being maintained. If you would like to take it over please email me at andisis92@gmail.com.

Installation

Place the file in the right place

  1. application/controllers/Rajaongkir.php to application/controllers
  2. config/rajaongkir.php to config
  3. libraries/RajaOngkir to libraries
  4. libraries/rajaongkir.php to libraries

Configuration

Open "application/config/rajaongkir.php", enter the API key and change the account type.

Usage

First, load the RajaOngkir library or autoload it in config/autoload.php.

$this->load->library('rajaongkir');

Make a request

# Get all province
$provinces = $this->rajaongkir->province();

# Get all cities
$cities = $this->rajaongkir->city();

# Get districts based on cities
$subdistrict = $this->rajaongkir->subdistrict(151); // city_id = 151

# Get shipping costs
$cost = $this->rajaongkir->cost(501, 114, 1000, "jne");

Response

The resulting response is a JSON string reply from RajaOngkir.

Reference

RajaOngkir Official Documentation

About

Raja Ongkir Library for CodeIgniter 3.x

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages