Merge branch 'feature/pay'

hotfix/远程访问多媒体中心
lyt 6 years ago
commit 606f8fce0f

@ -4,6 +4,7 @@ $config["trade_type"] = "NATIVE";
$config["currency"] = "CNY";
$config["currency_unit"] = 100;
$config["method_code"] = 15016;
$config["send_notify_url"] = "https://www.mycht.cn/webht.php/apps/pay/paymentservice/send_notify";
/*!
* 各账号的设置
*/

@ -32,6 +32,27 @@ class PaymentService extends CI_Controller {
} else {
$data['notelist'] = $this->note_model->search_date($data['date']);
}
array_walk($data["notelist"], function(&$ele, $key)
{
$ele->brand_name = "none";
switch ($ele->OPN_accountMethod) {
case '15016':
$ele->brand_name = "WeChat";
break;
case '15010':
case '15002':
$ele->brand_name = "PayPal";
break;
case '15018':
$ele->brand_name = "Credit Card";
break;
case '15015':
$ele->brand_name = "Alipay";
break;
default:
break;
}
});
/**
* 导出记录用的记录节点
@ -56,6 +77,7 @@ class PaymentService extends CI_Controller {
public function send_notify($opn_id=NULL, $old_ssje=NULL)
{
ignore_user_abort(true);
$output = "处理交易记录:<br>";
$data = array();
$show_index = 0;
//优先处理指定的交易号,用于修正交易号直接发送通知
@ -254,11 +276,12 @@ class PaymentService extends CI_Controller {
//显示处理记录
if (empty($opn_id)) {
echo ++$show_index . ' ' . $item->OPN_transactionId . '<br/>';
$output .= (++$show_index) . ' ' . $item->OPN_transactionId . '<br/>';
}
}
return;
echo $output;
return $output;
// return $this->output->set_content_type('application/json')->set_output(json_encode($data));
}

@ -91,6 +91,7 @@ class WxpayService extends CI_Controller {
foreach ($all_account as $account) {
$this->download_bill($account);
}
async_curl($this->config->item('send_notify_url', 'wxpay'));
return;
}

@ -63,6 +63,45 @@ function getaqiMonth($url){
return false;
}
}
/*!
* @Author: LYT
* @Date: 2019-06-27 10:32:11
* @Desc: 异步的curl,1秒超时,被请求的地址需要设置: ignore_user_abort(true);
*/
function async_curl($url, $second = 1)
{
$ch = curl_init();
$curlVersion = curl_version();
$ua = "Webht (".PHP_OS.") PHP/".PHP_VERSION." CURL/".$curlVersion['version']." " . "AsyncJob";
//设置超时
curl_setopt($ch, CURLOPT_TIMEOUT, $second);
curl_setopt($ch,CURLOPT_URL, $url);
if(stripos($url,"https://")!==FALSE){
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
} else {
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,2);//严格校验
}
curl_setopt($ch,CURLOPT_USERAGENT, $ua);
//设置header
curl_setopt($ch, CURLOPT_HEADER, FALSE);
//要求结果为字符串且输出到屏幕上
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
//运行curl
$data = curl_exec($ch);
if (curl_errno($ch) && !in_array(curl_errno($ch),array(0,28)) ) {
log_message('error',"Webht Async Curl Call 出错,错误码:" . curl_errno($ch) . ": " . curl_error($ch) . ", url: " . $url);
}
if (!in_array(curl_getinfo($ch, CURLINFO_HTTP_CODE),array(0,200)) ) {
log_message('error', "Webht Async Curl Call Request html Status Code: ".curl_getinfo($ch, CURLINFO_HTTP_CODE)."; curl url: ".$url);
}
curl_close($ch);
return $data;
}
/*
* 把数组元素组合为字符串
* $container:用来包含元素的符号

@ -164,6 +164,7 @@ class Wxpay_call
log_message('error',"curl出错错误码:$error " . curl_error($ch));
curl_close($ch);
}
return;
}

@ -21,6 +21,12 @@
.search-btn{cursor: pointer; background: url(//data.chinahighlights.com/css/images/global/site-search-button.png) no-repeat center center;}
.input-check{width: 20px;height: 20px;}
label span{vertical-align: super;}
.brand_text {color: #fff; padding: 2px 3px; border-radius: 4px;font-style: italic;}
/* .wechat-color {background-color: #00C800;} */
.wechat-color {background-color: #62B900;}
.paypal-color {background-color: #002D89;}
.alipay-color {background-color: #00AAEE;}
.ipaylinks-color,.creditcard-color {background-color: #A31022;}
</style>
</head>
<body>
@ -192,7 +198,8 @@
?>
<tr>
<td><?php echo $key+1; ?></td>
<td><?php echo $item->OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?></td>
<td><span class="brand_text <?php echo strtolower(str_replace(" ","",$item->brand_name))."-color"; ?>"><?php echo $item->brand_name; ?></span>
<?php echo $item->OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?></td>
<td>
<?php
echo $item->OPN_payerEmail;

Loading…
Cancel
Save