Exemple #1
0
 private function paynow_check($params)
 {
     $soap = "https://www.paysbuy.com/api_paynow/api_paynow.asmx?WSDL";
     $method = 'api_paynow_authentication_new';
     $merchant = $this->pay_model->get_merchant_data_by_pay_type($params['pay_type'], $params['method_id']);
     $psbID = $merchant['merchant_key'];
     $username = $merchant['merchant_name'];
     $secureCode = $merchant['merchant_key2'];
     // var_dump($psbID);var_dump($username);var_dump($secureCode);die();
     $soap_param = array(array('psbID' => $psbID, 'username' => $username, 'secureCode' => $secureCode, 'inv' => $params['order_sn'], 'itm' => 'Buy Gold', 'amt' => $params['pay_amount'], 'paypal_amt' => 1, 'curr_type' => 'TH', 'com' => '', 'method' => 5, 'language' => 'T', 'resp_front_url' => base_url() . 'paysbuy/return_status', 'resp_back_url' => base_url() . 'paysbuy/return_status', 'opt_fix_redirect' => '1', 'opt_fix_method' => '', 'opt_name' => '', 'opt_email' => '', 'opt_mobile' => '', 'opt_address' => '', 'opt_detial' => ''));
     $client = new soapclient($soap);
     $client->soap_defencoding = 'UTF-8';
     $client->decode_utf8 = false;
     $result = $client->__call($method, $soap_param);
     $string = $result->api_paynow_authentication_newResult;
     //	var_dump($string);
     return $string;
 }
Exemple #2
0
 private function query_tran_detail($params)
 {
     $MerchantID = $this->merchantID;
     $ReferenceID = $params['order_sn'];
     $SecretPIN = $this->secret_pin;
     $this->getHeartBeat();
     $HeartBeat = $this->heartbeat;
     $Signature = sha1(strtolower($MerchantID . $ReferenceID . $SecretPIN . $HeartBeat));
     log_message('GASH', 'MOL_WALLET_RETURN_SIGN' . $Signature);
     $soap_param = array();
     //Sandbox
     //     	$soap = 'http://molv3.molsolutions.com/api/login/s_module/querytrxstatus.asmx?WSDL';
     //Live
     $soap = 'https://global.mol.com/api/login/s_module/querytrxstatus.asmx?WSDL';
     $method = 'queryTrxStatus';
     $soap_param = array(array('MerchantID' => $MerchantID, 'MRef_ID' => $ReferenceID, 'HeartBeat' => $HeartBeat, 'Signature' => $Signature));
     $client = new soapclient($soap);
     $client->soap_defencoding = 'UTF-8';
     $client->decode_utf8 = false;
     log_message('GASH', 'MOL_WALLET_SOPA_PARAM' . $soap_param);
     $result = $client->__call($method, $soap_param);
     $result = $result->queryTrxStatusResult;
     log_message("GASH", "MOL_WALLET_QUERY_RESULT" . json_encode($result));
     $msg = "儲值失敗,請聯繫遊戲客服" . $result->ResCode . "Status:" . $result->Status;
     if ($result->ResCode == 100 && $result->Status == 1) {
         $sign = sha1(strtolower($result->ResCode . $MerchantID . $ReferenceID . $SecretPIN . $result->Amount . $result->Currency));
         //     		$msg=$msg."22";
         log_message("GASH", "MOL_WALLET_SUCCESS" . json_encode($result));
         if ($sign == $result->Signature) {
             //     			$msg=$msg."33";
             log_message("GASH", "MOL_WALLET_TRUE_SUCCESS" . json_encode($params));
             if ($this->_complete_order($params)) {
                 $order_info = $this->CI->pay_order->get_recharge_order($params['order_sn']);
                 log_message("GASH", "MOL_WALLET_TRUE_GAME_SUCCESS" . json_encode($params));
                 $msg = "儲值成功";
                 $this->CI->payorder->over($msg, $order_info->order_sn);
                 return;
             }
         }
     }
     $this->CI->payorder->over($msg);
 }
Exemple #3
0
 private function query_tran_detail($params)
 {
     $MerchantID = $this->merchantID;
     $ReferenceID = $params['order_sn'];
     $SecretPIN = $this->secret_pin;
     $this->getHeartBeat();
     $HeartBeat = $this->heartbeat;
     $Signature = strtolower(sha1($MerchantID . $SecretPIN . $ReferenceID));
     $soap_param = array();
     //Sandbox
     //      $soap = 'http://molv3.molsolutions.com/merchant/Pin/Webservice/MOLPointsTrans.asmx?WSDL';
     //Live
     $soap = 'https://global.mol.com/api/molpoints_v2/MOL.Utilities.WebServices/MOLPointsTrans.asmx?WSDL';
     $method = 'GetMOLPointsTransactionDetails';
     $soap_param = array(array('MerchantID' => $MerchantID, 'ReferenceID' => $ReferenceID, 'HeartBeat' => $HeartBeat, 'Signature' => $Signature));
     $client = new soapclient($soap);
     $client->soap_defencoding = 'UTF-8';
     $client->decode_utf8 = false;
     $result = $client->__call($method, $soap_param);
     $result = $result->GetMOLPointsTransactionDetailsResult;
     log_message("GASH", "MOL_TRANS_MESSAGE_RESULT" . json_encode($result));
     $msg = "儲值失敗,請聯繫遊戲客服" . $result->ResponseCode . "Status:" . $result->Status;
     if ($result->ResponseCode == 809 && $result->Status == 1) {
         $sign = strtolower(sha1($result->MerchantID . $SecretPIN . $result->MReferenceID . $result->ProductQty));
         //                  $msg=$msg."22";
         if ($sign == $result->Signature) {
             //                      $msg=$msg."33";
             if ($this->_complete_order($params)) {
                 $msg = "儲值成功";
                 $order_info = $this->pay_order->get_recharge_order($params['order_sn']);
                 $this->CI->payorder->over($msg, $order_info->order_sn);
                 return;
             }
         }
     }
     $this->CI->payorder->over($msg);
 }