From 4f6f96f0c5baa1cf71d969d98a714009959bb239 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 28 Mar 2018 11:24:37 +0800 Subject: [PATCH] =?UTF-8?q?ipaylinks=20=E5=AF=B9=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD,=20=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Crypt/AES.php | 0 .../Crypt/Base.php | 0 .../Crypt/Blowfish.php | 0 .../Crypt/DES.php | 0 .../Crypt/Hash.php | 0 .../Crypt/RC2.php | 0 .../Crypt/RC4.php | 0 .../Crypt/RSA.php | 0 .../Crypt/Random.php | 0 .../Crypt/Rijndael.php | 0 .../Crypt/TripleDES.php | 0 .../Crypt/Twofish.php | 0 .../File/ANSI.php | 0 .../File/ASN1.php | 0 .../File/X509.php | 0 .../Math/BigInteger.php | 0 .../Net/SCP.php | 0 .../Net/SFTP.php | 0 .../Net/SFTP/Stream.php | 0 .../Net/SSH1.php | 0 .../Net/SSH2.php | 0 .../System/SSH/Agent.php | 0 .../System/SSH_Agent.php | 0 .../bootstrap.php | 0 .../download_files.php | 10 +- .../openssl.cnf | 0 webht/third_party/pay/config/paypal.php | 25 ++ .../pay/controllers/iPayLinksService.php | 14 +- webht/third_party/pay/controllers/report.php | 315 ++++++++++++++++++ webht/third_party/pay/models/Report_model.php | 61 ++++ 30 files changed, 418 insertions(+), 7 deletions(-) rename {ipaylinks_statement => download_statement}/Crypt/AES.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/Base.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/Blowfish.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/DES.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/Hash.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/RC2.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/RC4.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/RSA.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/Random.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/Rijndael.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/TripleDES.php (100%) rename {ipaylinks_statement => download_statement}/Crypt/Twofish.php (100%) rename {ipaylinks_statement => download_statement}/File/ANSI.php (100%) rename {ipaylinks_statement => download_statement}/File/ASN1.php (100%) rename {ipaylinks_statement => download_statement}/File/X509.php (100%) rename {ipaylinks_statement => download_statement}/Math/BigInteger.php (100%) rename {ipaylinks_statement => download_statement}/Net/SCP.php (100%) rename {ipaylinks_statement => download_statement}/Net/SFTP.php (100%) rename {ipaylinks_statement => download_statement}/Net/SFTP/Stream.php (100%) rename {ipaylinks_statement => download_statement}/Net/SSH1.php (100%) rename {ipaylinks_statement => download_statement}/Net/SSH2.php (100%) rename {ipaylinks_statement => download_statement}/System/SSH/Agent.php (100%) rename {ipaylinks_statement => download_statement}/System/SSH_Agent.php (100%) rename {ipaylinks_statement => download_statement}/bootstrap.php (100%) rename {ipaylinks_statement => download_statement}/download_files.php (59%) rename {ipaylinks_statement => download_statement}/openssl.cnf (100%) create mode 100644 webht/third_party/pay/config/paypal.php create mode 100644 webht/third_party/pay/controllers/report.php create mode 100644 webht/third_party/pay/models/Report_model.php diff --git a/ipaylinks_statement/Crypt/AES.php b/download_statement/Crypt/AES.php similarity index 100% rename from ipaylinks_statement/Crypt/AES.php rename to download_statement/Crypt/AES.php diff --git a/ipaylinks_statement/Crypt/Base.php b/download_statement/Crypt/Base.php similarity index 100% rename from ipaylinks_statement/Crypt/Base.php rename to download_statement/Crypt/Base.php diff --git a/ipaylinks_statement/Crypt/Blowfish.php b/download_statement/Crypt/Blowfish.php similarity index 100% rename from ipaylinks_statement/Crypt/Blowfish.php rename to download_statement/Crypt/Blowfish.php diff --git a/ipaylinks_statement/Crypt/DES.php b/download_statement/Crypt/DES.php similarity index 100% rename from ipaylinks_statement/Crypt/DES.php rename to download_statement/Crypt/DES.php diff --git a/ipaylinks_statement/Crypt/Hash.php b/download_statement/Crypt/Hash.php similarity index 100% rename from ipaylinks_statement/Crypt/Hash.php rename to download_statement/Crypt/Hash.php diff --git a/ipaylinks_statement/Crypt/RC2.php b/download_statement/Crypt/RC2.php similarity index 100% rename from ipaylinks_statement/Crypt/RC2.php rename to download_statement/Crypt/RC2.php diff --git a/ipaylinks_statement/Crypt/RC4.php b/download_statement/Crypt/RC4.php similarity index 100% rename from ipaylinks_statement/Crypt/RC4.php rename to download_statement/Crypt/RC4.php diff --git a/ipaylinks_statement/Crypt/RSA.php b/download_statement/Crypt/RSA.php similarity index 100% rename from ipaylinks_statement/Crypt/RSA.php rename to download_statement/Crypt/RSA.php diff --git a/ipaylinks_statement/Crypt/Random.php b/download_statement/Crypt/Random.php similarity index 100% rename from ipaylinks_statement/Crypt/Random.php rename to download_statement/Crypt/Random.php diff --git a/ipaylinks_statement/Crypt/Rijndael.php b/download_statement/Crypt/Rijndael.php similarity index 100% rename from ipaylinks_statement/Crypt/Rijndael.php rename to download_statement/Crypt/Rijndael.php diff --git a/ipaylinks_statement/Crypt/TripleDES.php b/download_statement/Crypt/TripleDES.php similarity index 100% rename from ipaylinks_statement/Crypt/TripleDES.php rename to download_statement/Crypt/TripleDES.php diff --git a/ipaylinks_statement/Crypt/Twofish.php b/download_statement/Crypt/Twofish.php similarity index 100% rename from ipaylinks_statement/Crypt/Twofish.php rename to download_statement/Crypt/Twofish.php diff --git a/ipaylinks_statement/File/ANSI.php b/download_statement/File/ANSI.php similarity index 100% rename from ipaylinks_statement/File/ANSI.php rename to download_statement/File/ANSI.php diff --git a/ipaylinks_statement/File/ASN1.php b/download_statement/File/ASN1.php similarity index 100% rename from ipaylinks_statement/File/ASN1.php rename to download_statement/File/ASN1.php diff --git a/ipaylinks_statement/File/X509.php b/download_statement/File/X509.php similarity index 100% rename from ipaylinks_statement/File/X509.php rename to download_statement/File/X509.php diff --git a/ipaylinks_statement/Math/BigInteger.php b/download_statement/Math/BigInteger.php similarity index 100% rename from ipaylinks_statement/Math/BigInteger.php rename to download_statement/Math/BigInteger.php diff --git a/ipaylinks_statement/Net/SCP.php b/download_statement/Net/SCP.php similarity index 100% rename from ipaylinks_statement/Net/SCP.php rename to download_statement/Net/SCP.php diff --git a/ipaylinks_statement/Net/SFTP.php b/download_statement/Net/SFTP.php similarity index 100% rename from ipaylinks_statement/Net/SFTP.php rename to download_statement/Net/SFTP.php diff --git a/ipaylinks_statement/Net/SFTP/Stream.php b/download_statement/Net/SFTP/Stream.php similarity index 100% rename from ipaylinks_statement/Net/SFTP/Stream.php rename to download_statement/Net/SFTP/Stream.php diff --git a/ipaylinks_statement/Net/SSH1.php b/download_statement/Net/SSH1.php similarity index 100% rename from ipaylinks_statement/Net/SSH1.php rename to download_statement/Net/SSH1.php diff --git a/ipaylinks_statement/Net/SSH2.php b/download_statement/Net/SSH2.php similarity index 100% rename from ipaylinks_statement/Net/SSH2.php rename to download_statement/Net/SSH2.php diff --git a/ipaylinks_statement/System/SSH/Agent.php b/download_statement/System/SSH/Agent.php similarity index 100% rename from ipaylinks_statement/System/SSH/Agent.php rename to download_statement/System/SSH/Agent.php diff --git a/ipaylinks_statement/System/SSH_Agent.php b/download_statement/System/SSH_Agent.php similarity index 100% rename from ipaylinks_statement/System/SSH_Agent.php rename to download_statement/System/SSH_Agent.php diff --git a/ipaylinks_statement/bootstrap.php b/download_statement/bootstrap.php similarity index 100% rename from ipaylinks_statement/bootstrap.php rename to download_statement/bootstrap.php diff --git a/ipaylinks_statement/download_files.php b/download_statement/download_files.php similarity index 59% rename from ipaylinks_statement/download_files.php rename to download_statement/download_files.php index f93850de..69a3f9ef 100644 --- a/ipaylinks_statement/download_files.php +++ b/download_statement/download_files.php @@ -1,16 +1,18 @@ login('10000004000', 'YRATF0OtDaYa2Uhv6cWO8BV9FPBup5')) { exit('Login Failed'); } // 获取前一天的对账单 // target remote -$target_folder = str_replace("-", "/", date("/Y-m", strtotime("-1 day")) ); +$target_folder = str_replace("-", "/", date("Y-m", strtotime("-1 day")) ); $file_list = array_values(array_diff($sftp->nlist($target_folder), array(".",".."))); // target local -$target_local = "statement_files" . $target_folder; +$target_local = "statement_files/" . $target_folder; if ( ! is_dir($target_local)) { mkdir($target_local, 0777, true); } @@ -26,3 +28,7 @@ foreach ($new_files as $key => $new) { $new_cnt++; } echo "Copied new statements count: " . $new_cnt; + +// header("Location: http://www.mycht.cn/webht.php/apps/pay/ipaylinksservice/auto_update_statement?f=$target_folder&fjson=" . json_encode($new_files)); +// header("Location: http://www.mycht.cn/webht.php/apps/pay/report/ipaylinks_excel?f=$target_folder&fjson=" . json_encode($new_files)); +// header("Location: http://202.103.68.79:8083/webht.php/apps/pay/report/ipaylinks_excel?f=$target_folder&fjson=" . json_encode($new_files)); diff --git a/ipaylinks_statement/openssl.cnf b/download_statement/openssl.cnf similarity index 100% rename from ipaylinks_statement/openssl.cnf rename to download_statement/openssl.cnf diff --git a/webht/third_party/pay/config/paypal.php b/webht/third_party/pay/config/paypal.php new file mode 100644 index 00000000..70dcceaa --- /dev/null +++ b/webht/third_party/pay/config/paypal.php @@ -0,0 +1,25 @@ +query_info_arr["orderId"] = $orderid; $this->query_info_arr["beginTime"] = date('YmdHis',strtotime("-$day_offset days")); $this->query_info_arr["endTime"] = date('YmdHis',strtotime("+$day_offset days")); - $this->query_info_arr["mode"] = 2; + $this->query_info_arr["mode"] = 1; $this->query_info_arr["signMsg"] = $this->generate_sign($this->query_info_arr); $resp = $this->curl($this->queryUrl,$this->query_info_arr); - echo $resp; + // echo $resp; + var_export($resp); return; } @@ -1056,11 +1057,14 @@ class IPayLinksService extends CI_Controller public function auto_update_statement() { - $target_folder = date("Y-m", strtotime("-1 day")); - $target_folder = str_replace("-", "\\", $target_folder); + set_time_limit(0); + // $target_folder = date("Y-m", strtotime("-1 day")); + // $target_folder = str_replace("-", "\\", $target_folder); $today_time = strtotime(date('Ymd000000')); // 解析excel - $statement_folder = FCPATH.'ipaylinks_statement\statement_files\\' . $target_folder; + $target_folder = $this->input->get_post("f"); + $files = json_decode($this->input->get_post("fjson")); + $statement_folder = FCPATH.'download_statement\statement_files\\' . $target_folder; if ( ! is_dir($statement_folder)) { return; } diff --git a/webht/third_party/pay/controllers/report.php b/webht/third_party/pay/controllers/report.php new file mode 100644 index 00000000..98ed7b3b --- /dev/null +++ b/webht/third_party/pay/controllers/report.php @@ -0,0 +1,315 @@ +config->load('paypal'); + $this->load->helper('payment_helper'); + $this->load->model('Report_model'); + } + + /*! + * 差集: 对账单 > HT收款记录 + * @author LYT + * @date 2018-03-26 + * @param POST 时间区间 + */ + public function unstore_statement($begin_m=NULL, $end_m=NULL) + { + } + + /*! + * 转换字符集编码 + * @param $data + * @param $targetCharset + * @return string + */ + protected function characet($data, $targetCharset) { + if (!empty($data)) { + $fileType = "UTF-8"; + if (strcasecmp($fileType, $targetCharset) != 0) { + $data = mb_convert_encoding($data, $targetCharset, $fileType); + // $data = iconv($fileType, $targetCharset.'//IGNORE', $data); + } + } + return $data; + } + + /*! + * 检验非空 + * @author LYT + * @date 2017-08-17 + * @param [type] $value [description] + * @return boolean true-空;false-非空 + */ + protected function checkEmpty($value) { + if (!isset($value)) + return true; + if ($value === null) + return true; + if (trim($value) === "") + return true; + + return false; + } + + protected function create_guid() { + return strtolower(md5(uniqid(mt_rand(), true))); + } + + /*! + * 解析ipaylinks对账单excel, 存入数据库 + * @author LYT + * @date 2018-03-26 + * @param POST f={target_folder}&fjson={files_list_JSON} + */ + public function ipaylinks_excel() + { + $this->load->model('IPayLinks_model'); + set_time_limit(0); + // 解析excel + $target_folder = $this->input->get_post("f"); + $files = json_decode($this->input->get_post("fjson")); + log_message('error','ipaylinks excel POST: ' . $target_folder . $this->input->get_post("fjson")); + $statement_folder = FCPATH.'download_statement\statement_files\\' . $target_folder; + if ( ! is_dir($statement_folder)) { + return; + } + $files = $files ? $files : array_values(array_diff(scandir($statement_folder), array('.', '..'))); + if (empty($files)) { + echo "none excel."; + return; + } + $settle_cnt = 0; + $update_cnt = 0; + $file_path_output = ""; + bcscale(4); + foreach ($files as $k => $fe) { + $file_path = $statement_folder . '\\' . $fe; + if ( ! file_exists($file_path)) { + continue; + } + $settlement_record = $this->read_ipaylinks_excel($file_path); + if (empty($settlement_record)) { + continue; + } + foreach ($settlement_record as $settle) { + $orderid_info = analysis_orderid(trim($settle['orderid'])); + $orderid_info = json_decode($orderid_info); + if ( ! empty($orderid_info)) { + if (strcasecmp($orderid_info->ordertype, "B") === 0) { + $old_info = $this->IPayLinks_model->get_money_b(trim($settle['pn_invoice'])); + } else if (strcasecmp($orderid_info->ordertype, "T") === 0){ + $old_info = $this->IPayLinks_model->get_money_t(trim($settle['pn_invoice'])); + } + } + $warrant["PR_AccreditNo"] = trim($settle['pn_invoice']); + $warrant["PR_payType"] = 15018; + $warrant["PR_entryCurrency"] = trim($settle['entry_currency']); + $warrant["PR_entryAmount"] = bcadd(floatval($settle['entry_security']), floatval($settle['entry_basic'])); + $warrant["PR_COLI_SN"] = !empty($old_info) ? $old_info[0]->GAI_COLI_SN : NULL; + $warrant["PR_currency"] = trim($settle['currency']); + $warrant["PR_amount"] = trim($settle['order_amount']); + $warrant["PR_orderType"] = $orderid_info ? $orderid_info->ordertype : NULL; + $warrant["PR_fee"] = bcadd(trim($settle['service_fee']), trim($settle['transaction_fee'])); + $warrant["PR_paymentTime"] = trim($settle['complete_date']); + $warrant["PR_dealType"] = trim($settle['data_type']); + $warrant["PR_orderId"] = trim($settle['orderid']); + $warrant["PR_rate"] = trim($settle['settlement_rate']); + $warrant["PR_status"] = ""; + $warrant["PR_buyerName"] = ""; + $warrant["PR_buyerEmail"] = ""; + $this->Report_model->new_report($warrant); + $warrant = NULL; + $update_cnt++; + } + $settlement_record = null; // reset + $settle_cnt++; + $file_path_output .= "\r\n" . $file_path; + } + $result = "read ipaylinks reports result: " . date('Y-m-d H:i:s') . " ------ \r\n"; + $result .= "Found $settle_cnt Excels; Store $update_cnt records;" . $file_path_output; + log_message('error', $result); + echo $result; + return; + } + + public function read_ipaylinks_excel($filePath) + { + $tarr1=array(); + $this->load->library('PHPExcel'); + $PHPExcel = new PHPExcel(); + /**默认用excel2007读取excel,若格式不对,则用之前的版本进行读取*/ + $PHPReader = new PHPExcel_Reader_Excel2007(); + if(!$PHPReader->canRead($filePath)){ + $PHPReader = new PHPExcel_Reader_Excel5(); + if(!$PHPReader->canRead($filePath)){ + echo 'no Excel'; + return ; + } + } + $PHPExcel = $PHPReader->load($filePath); + /**读取excel文件中的第一个工作表*/ + $currentSheet = $PHPExcel->getSheet(0); + + /**取得最大的列号*/ + $allColumn = $currentSheet->getHighestColumn(); + + /**取得一共有多少行*/ + $allRow = $currentSheet->getHighestRow(); + $col_titles = $this->ipaylinks_col_title(); + /**从第二行开始输出,因为excel表中第一行为列名*/ + for($currentRow = 2;$currentRow <= $allRow;$currentRow++){ + $row_tmp = array(); + /**从第A列开始输出*/ + for($currentColumn= 'A';$currentColumn<= "N"; $currentColumn++){ + /**ord()将字符转为十进制数*/ + $val = trim($currentSheet->getCellByColumnAndRow(ord($currentColumn) - 65,$currentRow)->getValue()); + $col_mean = $col_titles[$currentColumn]; + if($col_mean == 'data_type' && in_array($val, $this->noStore_dealType()) ) // strcasecmp('清算', $val) !== 0 + { + break; + } + if ($col_mean == 'orderid' && strcasecmp('-', $val) === 0) { + break; + } + $row_tmp[$col_mean] = $val; + } + if (isset($row_tmp['settlement_amount'])) { + $tarr1[] = $row_tmp; + } + } + return $tarr1; + } + public function ipaylinks_col_title() + { + return array( + "A" => "complete_date", + "B" => "pn_invoice", + "C" => "orderid", + "D" => "data_type", + "E" => "currency", + "F" => "order_amount", + "G" => "settlement_rate", + "H" => "settlement_amount", + "I" => "service_fee", + "J" => "transaction_fee", + "K" => "mark_memo", + "L" => "entry_currency", + "M" => "entry_security", + "N" => "entry_basic" + ); + } + public function noStore_dealType() + { + return array( + "归还保证金" + ,"记账" + ,"冻结" + ,"解冻" + ,"提现" + ,"提现手续费" + ); + } + + public function paypal_get_token() + { + $header = array( + "Accept: application/json", + "Accept-Language: en_US", + ); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_HTTPHEADER, $header); + curl_setopt($ch, CURLOPT_URL, $this->config->item('token_url')); + curl_setopt($ch, CURLOPT_FAILONERROR, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSLVERSION, 6); + + $clientId = $this->config->item('client_id'); + $secret = $this->config->item('secret'); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_USERPWD, $clientId . ":" . $secret); + curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials"); + + $reponse = curl_exec($ch); + + if (curl_errno($ch)) { + log_message('error', "paypal token curl error code: ".curl_error($ch)); + } else { + $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + if (200 !== $httpStatusCode) { + log_message('error', "paypal token Request html Status Code: ".$httpStatusCode); + } + } + curl_close($ch); + + return json_decode($reponse); + } + + public function paypal_get_payment($payment_id) + { + // $url = $this->config->item("payment_url") . "/" . $payment_id; + // $url = $this->config->item("sale_url") . "/" . $payment_id; + $url = $this->config->item("activities_url") . "?page_size=50&sort_by=create_time&sort_order=desc&start_time=2018-03-25T11:00:00Z&end_time=2018-03-28T11:00:00Z"; + $c = $this->call_paypal($url); + var_dump($c); + return $c; + } + + public function call_paypal($url, $body = false) + { + $token_info = $this->paypal_get_token();var_dump($token_info); + // todo if no token + $access_token = $token_info->access_token; + $token_type = $token_info->token_type; + $header = array( + "Content-Type:application/json", + "Authorization: $token_type $access_token" + ); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_HTTPHEADER, $header); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_FAILONERROR, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + // curl_setopt($ch, CURLOPT_SSLVERSION, 6); + // CURL_SSLVERSION_TLSv1_2 Available since PHP 5.5.19 and 5.6.3 + + $param_str = ""; + if (is_array($body) && 0 < count($body)) { + $param_str = $this->toJSON($body); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $param_str); + } + + $reponse = curl_exec($ch); + + if (curl_errno($ch)) { + log_message('error', "paypal curl REST API error code: " . curl_error($ch) . "; post: ".$param_str); + } else { + $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + if (200 !== $httpStatusCode) { + log_message('error', "paypal REST API Request html Status Code: ".$httpStatusCode); + } + } + curl_close($ch); + + return json_decode($reponse); + } + public function toJSON($arr, $options = 0) + { + if (version_compare(phpversion(), '5.4.0', '>=') === true) { + return json_encode($arr, $options | 64); + } + return str_replace('\\/', '/', json_encode($arr, $options)); // ~ php 5.3 + } + +} diff --git a/webht/third_party/pay/models/Report_model.php b/webht/third_party/pay/models/Report_model.php new file mode 100644 index 00000000..6f221bfa --- /dev/null +++ b/webht/third_party/pay/models/Report_model.php @@ -0,0 +1,61 @@ +INFO = $this->load->database('INFO', TRUE); + } + + /** 插入对账单记录 */ + public function new_report($warrant_arr = array()) + { + $sql = "INSERT INTO PaymentReports + ( + PR_payType + ,PR_orderType + ,PR_COLI_SN + ,PR_orderId + ,PR_dealType + ,PR_AccreditNo + ,PR_currency + ,PR_amount + ,PR_rate + ,PR_entryCurrency + ,PR_entryAmount + ,PR_fee + ,PR_status + ,PR_buyerName + ,PR_buyerEmail + ,PR_paymentTime + ,PR_time + ) + VALUES + (?,?,?,?,N?,?,?,?,?,?,?,?,N?,N?,N?,? + ,GETDATE() + )"; + $query = $this->INFO->query($sql,array( + $warrant_arr["PR_payType"] + ,$warrant_arr["PR_orderType"] + ,$warrant_arr["PR_COLI_SN"] + ,$warrant_arr["PR_orderId"] + ,$warrant_arr["PR_dealType"] + ,$warrant_arr["PR_AccreditNo"] + ,$warrant_arr["PR_currency"] + ,$warrant_arr["PR_amount"] + ,$warrant_arr["PR_rate"] + ,$warrant_arr["PR_entryCurrency"] + ,$warrant_arr["PR_entryAmount"] + ,$warrant_arr["PR_fee"] + ,$warrant_arr["PR_status"] + ,$warrant_arr["PR_buyerName"] + ,$warrant_arr["PR_buyerEmail"] + ,$warrant_arr["PR_paymentTime"] + )); + return $query; + } + +}