Example #1
0
<?php

// Codeigniter PHP class for Omise payment
// GAE -> STORECENTER -> PAYMENT
// @DEV.KONG
// Dev Ref: http://www.codeigniter.com/user_guide/general/creating_libraries.html
require_once root_plugins_path() . "omise/config.php";
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
class Omise
{
    protected $CI;
    private $public_key;
    private $secret_key;
    // We'll use a constructor, as you can't directly call a function
    // from a property definition.
    public function __construct()
    {
        // Assign the CodeIgniter super-object
        $this->CI =& get_instance();
        // check if define global variable in config.php
        /*
        if (!OMISE_PUBLIC_KEY && !OMISE_SECRET_KEY) { // no variable define
            define('OMISE_PUBLIC_KEY', 'pkey_test_50p3ddbo39kypvbsoax');
            define('OMISE_SECRET_KEY', 'skey_test_50p2o28tscmb7m9f5l6');
        }
        */
        $this->public_key = OMISE_PUBLIC_KEY;
        $this->secret_key = OMISE_SECRET_KEY;
    }
Example #2
0
 public function getCurModuleObject($moduleData)
 {
     $module_id = $moduleData["module_id"];
     $module_path = $this->getModulePath($moduleData);
     $module_url = $this->getModuleUrl($moduleData);
     require_once root_plugins_path() . "modules/cur_module.php";
     $curModule = new cur_module();
     $curModule->id = $module_id;
     $curModule->bundle_id = $moduleData["module_bundle_id"];
     $curModule->version = $moduleData["module_version"];
     $curModule->path = $module_path;
     $curModule->url = $module_url;
     $curModule->init();
     return $curModule;
 }