public function jahanpayreturnback() { $Amount = $this->session->userdata('Amount'); $donate_jahanpay = $this->config->item('donate_jahanpay'); $Authority = $_GET["au"]; $api = $this->config->item('api'); $this->session->unset_userdata('Amount'); if (strlen($Authority) > 4) { $Client = new SoapClient("http://www.jahanpay.com/webservice?wsdl"); $Result = $Client->verification($api, $Amount, $Authority); if ($Result == 1) { $this->fields['message_id'] = $Authority; $this->fields['custom'] = $user_id = $this->user->getId(); $this->fields['points'] = $this->getDpAmount($Amount); $this->fields['timestamp'] = time(); $this->fields['converted_price'] = $Amount; $this->fields['currency'] = $this->config->item('donation_currency_sign'); $this->fields['price'] = $Amount; $this->fields['country'] = 'SE'; $this->db->query("UPDATE `account_data` SET `dp` = `dp` + ? WHERE `id` = ?", array($this->fields['points'], $this->fields['custom'])); $this->updateMonthlyIncome($Amount); $this->db->insert("paygol_logs", $this->fields); redirect($this->template->page_url . "ucp"); } else { echo 'خطای شماره : ' . $Result; exit; } } else { echo 'تراکنش بوسیله کاربر انصراف داده شد'; exit; } }
function ksso() { $soapUser = ''; $soapPassword = ''; $publicKeyStr = ''; $cookieValue = $_COOKIE['SATHTOKEN']; $soap = new SoapClient('https://iam.kaist.ac.kr/iamps/services/singlauth?wsdl'); $result = $soap->verification(array('cookieValue' => $cookieValue, 'publicKeyStr' => $publicKeyStr, 'adminVO' => array('adminId' => $soapUser, 'password' => $soapPassword))); setcookie("SATHTOKEN", "", time() - 3600, '/'); return sign($result->return); }
/** * Send API Request * * @param array $data The data to send * @return array */ public function api($data, $verify = FALSE) { $settings = json_decode($this->settings, TRUE); if (class_exists('SoapClient')) { $client = new \SoapClient(self::JAHANPAY_URL); if ($verify) { $result = $client->verification($settings['api'], $data['amount'], $data['au']); } else { $result = $client->requestpayment($settings['api'], $data['amount'], $data['callbackUrl'], $data['orderId'], $data['msg']); } } else { require_once \IPS\ROOT_PATH . "/system/3rd_party/nusoap/nusoap.php"; $client = new \nusoap_client(self::JAHANPAY_URL, TRUE); if ($verify) { $result = $client->call('verification', array($settings['api'], $data['amount'], $data['au'])); } else { $result = $client->call('requestpayment', array($settings['api'], $data['amount'], $data['callbackUrl'], $data['orderId'], $data['msg'])); } } return $result; }