<?php
class ControllerModuleShopee extends Controller {

  public function install() {
    $this->load->model('setting/extension');
    $this->load->model('setting/setting');

    $this->model_setting_extension->install('payment',  'shopee_payment');
    $this->model_setting_extension->install('shipping', 'shopee_shipping');

    $shopeeAppInfo = [
      'shopee_app_id'  => ShopeeUtils::shopeeAppId,
      'shopee_app_key' => ShopeeUtils::shopeeAppKey,
      'shopee_environment' => Type_Environment::Tp_Production,
    ];

    $this->model_setting_setting->editSetting('shopee', $shopeeAppInfo);
  }

  public function uninstall() {
    $this->load->model('setting/extension');

    $this->model_setting_extension->uninstall('payment',  'shopee_payment');
    $this->model_setting_extension->uninstall('shipping', 'shopee_shipping');
  }

}
