feat: 连连信用卡: 异步通知; 处理

webht/payment
Lei OT 3 months ago
parent 51972536ad
commit 102ce623d3

@ -0,0 +1,4 @@
<?php
// require 'lianlian_cht.php';
require 'lianlian_test.php';

@ -0,0 +1,28 @@
<?php
/**
*
*/
$config['test']["method_code"] = 15035;
$config['test']['merchant_id'] = "202503100003060003";
$config['test']['sub_merchant_id'] = "1020250310968002";
$config['test']['return_url'] = "https://secure.chinahighlights.com/lianlian/thankyou";
$config['test']['notify_url'] = "https://www.mycht.cn/webht.php/apps/pay/lianlianservice/notify";
$config['test']['notify_refund_url'] = "https://www.mycht.cn/webht.php/apps/pay/lianlianservice/notify_refund";
$config['test']['charset'] = "UTF-8";
$config['test']['sign_type'] = "RSA";
$config['test']['gatewayUrl'] = "https://celer-api.lianlianpay-inc.com";
$config['test']['timeout_express'] = "1m";
$config['test']['app_public_key'] = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwD1I8x3rMfeMAD2+sgpNkq7G9z38LmZlWXMUF98IkEpufKl1mV9FwY6FwhAXLnAnGhFbHMhRy/LkJ4vGrJb9FLhYEPGUMaO46umK6k+PW/B8KYdQdlhmrevTTRoNkneGyZ94ffqmiHtTTScbu/IjaIs6UX/ObYJnKrJ637HcZy+HahuBQsiiP2QFKRZX02sgEiGWcirMSlP6e4KxMROawz6VSW5GgufgxYH5M65emqFMOo64/tbqMn63pu32k7jE23JevKgCUWoTGZzZZBgJjZOe4M5hH4BYVF6MXYjiD3yXkKSxDmENIy26F3Dc29vDGlXe1yv9norIiIBHD5+eewIDAQAB";
$config['test']['lianlian_public_key'] = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAo3Vy+gy/w6ygPREJb4gRWMtA/PfaPMqiTdcHngeSDoGuCAN/9PqufDIc83F1PE2s+6nNXtj0uJT8mRVjwWoh96eDpVcxAC0Y3NIB+2Z/sx3EsTB0kRyLxE+ZBcl2ms8jXGf/IQSUb8FrEBBvS6WWaDcKjfDYsEM5AJP3npnIZXW2h/wlslmEh8FJJqi0Ne2wR+Q0zzZKCERcxSrwSXKL2sRusc7MOZxUVE+1EcmTkwAl1lxY2s/DQAVAZBT/DXo5plODIwyzIFyW9aNGm2YIVofITnFtWxNoXL0BlFFnfGVncvohmRwA5zCPCxtIYmM3zdE+n9he7n/jnVWEGoXTDQIDAQAB";
// PKCS1 #
//
// PKCS8
$config['test']['merchant_private_key'] = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAPUjzHesx94wAPb6yCk2Srsb3PfwuZmVZcxQX3wiQSm58qXWZX0XBjoXCEBcucCcaEVscyFHL8uQni8aslv0UuFgQ8ZQxo7jq6YrqT49b8Hwph1B2WGat69NNGg2Sd4bJn3h9+qaIe1NNJxu78iNoizpRf85tgmcqsnrfsdxnL4dqG4FCyKI/ZAUpFlfTayASIZZyKsxKU/p7grExE5rDPpVJbkaC5+DFgfkzrl6aoUw6jrj+1uoyfrem7faTuMTbcl68qAJRahMZnNlkGAmNk57gzmEfgFhUXoxdiOIPfJeQpLEOYQ0jLboXcNzb28MaVd7XK/2eisiIgEcPn557AgMBAAECggEAAqYVhjwITJTzmeE/6mYX8Yh0910kR2NjzBq40Sdij9JmuVMAas+UP3l+QFFGcH5dG4/XqIreDahYGm9jmmcuL4XmuL0LZK+z0ZDMODRGbmbe3xedNTQ8nfLc43gTbcw10DthRqMYflLsr+h1Cl7ou/0HHa5cIsgkMcNpzAFAXy+TS96aLLn06REFETm4p9vayaqh8TNE+Z29z3lBtCvRV36O/mWaf417hENNHoNHzle3W+Hbv9pK0Y07L//VMpMCAZ0kgvK621MFoSCX8I0Us3Hu0CVzMcEq0Ig1zikPOGFfGXeCOdan0M76gpP/FDb+LTerQVfnIE6yhYeFueVOIQKBgQD9y626XmNXM+m0foGcpxsYoFz32PZ9MFXCz0lwoI6bsTKMFRDljIWN2mFlYBqcdq21IT6SrUr+P54R4ACZnopnuO1ez9ykMacWcMGC7jorWix3dynidN1/knHZD0tYgLM3N2w7k1t20FvZQFzwouT3ycIvGnO03D27ZipS80pksQKBgQDB6LwCngzxvGa3OT27AjXDilA2UWtCF84vY+mJ3p4VGE/v/FiWyHZuxgpbLeZzJqNxynBKHxJkw4TeIMpv1jiwTrQGa3NBMRbqeSpqQ65zvUmYyj3Fe8GWOGuczdp89Yd37MBXnVvee/xQGP1XCru3IGz/HRCaWOOjUxXPa7Qw6wKBgC6BaRcyfo+XIqcBW2zCLjPoBsEfz6MG/WASLcnmkdszsCh9H7iAdGSW9Kvn3Vh4YsJDEj08ZfaK38M0wcdkhsYU2+I4wpyPwKdbCAqe7qfNAULu4gzuDzx2MEhvBgZ0puJiVIHiMatm6L25jo5FuyEwplWNSlCE3wb85JqInEQxAoGAIsfG6UVGFxnu5pBa1S85S4CEkKmb7nfsoK1wFy2Z9zisJeSCU1FThNz6wI4EFsVobaGc8H6QQwiazWjeRp8K/fyv57LgMmJGtPnUtMi9Ar+B8ujbmY9wEqy+CJsXxHAZw1XwzgZIkyh0Aj3pOvKO5vLm+f9Rmg21jvb5I4IzCM8CgYEA4WVlJPa7z68uzs8X9WnMc2Qs/PsvncFG0yk3Cj28qxnCpuhrqGWUBGMa+QvtUpdB+z7QIkU1yZznzvU157BYgHm3Vi+UQdM54d+q+1yY8BHdu04iirmRUllLyMekNhR8oh3sbBKwA72afGAB6u/ggNmCTVplpXyxNT3CPueZMrI=";

@ -1028,7 +1028,7 @@ class AlipayTradeService extends CI_Controller
$aop = new AopClient(); $aop = new AopClient();
$aop->alipayrsaPublicKey = $this->alipay_public_key; $aop->alipayrsaPublicKey = $this->alipay_public_key;
$ret->check = $result = $aop->rsaCheckV1($arr, $this->alipay_public_key, $this->signtype); $ret->check = $result = $aop->rsaCheckV2($arr, $this->alipay_public_key, $this->signtype);
if ($result === false) { if ($result === false) {
log_message('error','Alipay sign ERROR ! orderId:'.$arr_obj->out_trade_no.'; dealId:'.$arr_obj->trade_no . "; Original return:".json_encode($arr)."; "); log_message('error','Alipay sign ERROR ! orderId:'.$arr_obj->out_trade_no.'; dealId:'.$arr_obj->trade_no . "; Original return:".json_encode($arr)."; ");
return $ret; return $ret;

@ -0,0 +1,236 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class LianlianService extends CI_Controller
{
protected $merchant_config;
protected $private_key;
public function __construct()
{
parent::__construct();
bcscale(2);
$this->load->helper('payment');
$this->config->load('lianlian', true);
$this->load->model('Online_payment_note_model', 'note_model');
$this->load->model('Online_payment_account_model', 'account_model');
$this->merchant_config = $this->config->item('test', 'lianlian');
}
public function index() {}
public function query_status() {}
public function query_payment() {}
public function query_refund() {}
public function notify($site = 'cht')
{
// $this->merchant_config = $this->config->item($site, 'lianlian'); // test: 测试环境
error_reporting(0);
log_message('error', 'LianlianPay notify begin ----');
$response['code'] = 0;
$response['message'] = '';
$raw_post_data = file_get_contents('php://input');
if (empty($raw_post_data)) {
# 如果没有数据,直接返回失败
return $this->output->set_content_type('application/json')->set_output(json_encode($response));
}
log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' ' . PHP_EOL . var_export($raw_post_data, 1));
$signature = $this->input->server('HTTP_SIGNATURE');
$payment_result = json_decode($raw_post_data, true);
if ($this->check_sign($payment_result, $signature) !== true) {
$response['message'] = 'sign error';
// return $this->output->set_content_type('application/json')->set_output(json_encode($response));
}
$payment_data = $payment_result['payment_data'];
$payment_result['GAI_API'] = array(
'merchant' => $site,
'invoice' => $payment_result['merchant_transaction_id'],
'transaction_id' => $payment_result['ll_transaction_id'],
);
// todo: 计算手续费, 实收
$payment_fee = $payment_data['payment_amount'] - $payment_data['settlement_amount'];
$ssje = $this->account_model->get_ssje($payment_data['settlement_amount'], str_replace("CNY", "RMB", strtoupper($payment_data['settlement_currency_code'])), $this->merchant_config['method_code']);
$save_column = array();
$save_column['OPN_transactionId'] = $payment_result['ll_transaction_id'];
$save_column['OPN_orderId'] = $payment_result['merchant_transaction_id'];
$save_column['OPN_rawOrderId'] = $payment_result['merchant_transaction_id'];
$save_column['OPN_invoiceId'] = $payment_result['merchant_transaction_id'];
$save_column['OPN_subject'] = $payment_result['merchant_transaction_id'];
$save_column['OPN_currency'] = $payment_data['payment_currency_code'];
$save_column['OPN_orderAmount'] = $payment_data['payment_amount'];
$save_column['OPN_payAmount'] = $payment_data['payment_amount'];
// $save_column['OPN_payFee'] = $payment_fee; // todo: 计算手续费; 退款 1USD 原手续费不退
$save_column['OPN_netAmount'] = $payment_data['settlement_amount'];
$save_column['OPN_transactionResult'] = $payment_data['payment_status'] === 'PS' ? 'completed' : 'declined';
$save_column['OPN_resultCode'] = $payment_data['payment_status'];
// $save_column['OPN_resultMsg'] = isset($payment_result['return_msg']) ? $payment_result['return_msg'] : $payment_result['result_code'];
// $save_column['OPN_errCode'] = isset($payment_result['err_code']) ? $payment_result['err_code'] : NULL;
// $save_column['OPN_errMsg'] = isset($payment_result['err_code_des']) ? $payment_result['err_code_des'] : NULL;
$save_column['OPN_acquiringTime'] = date('Y-m-d H:i:s', strtotime($payment_data['payment_time']));
$save_column['OPN_completeTime'] = date('Y-m-d H:i:s', strtotime($payment_data['payment_time']));
// $save_column['OPN_remark'] = $payment_result['attach'] ? $payment_result['attach'] : $payment_result['out_trade_no'];
// $save_column['OPN_payerLogId'] = $payment_result['openid'];
// $save_column['OPN_payerStatus'] = $payment_result['is_subscribe']==='Y' ? "subscribed" : NULL;
$save_column['OPN_fundSource'] = $site;
$save_column['OPN_entryAmountCNY'] = floatval($ssje);
$save_column['OPN_rawContent'] = json_encode($payment_result);
$save_column['OPN_noticeTime'] = date('Y-m-d H:i:s');
// $save_column['OPN_noticeType'] = intval($payment_result['total_fee'])>0 ? 'pay' : 'refund';
$save_column['OPN_noticeType'] = 'pay';
$save_column['OPN_noticeSendStatus'] = $payment_data['payment_status'] === 'PS' ? 'unsend' : 'closed';
$save_column['OPN_noticeSendTime'] = NULL;
$save_column['OPN_accountMethod'] = $this->merchant_config['method_code'];
if ($this->note_model->insert_note($save_column)) {
$response['code'] = 200;
$response['message'] = 'success';
}
$this->output->set_content_type('application/json')->set_output(json_encode($response));
}
public function notify_refund($site = 'cht')
{
// $this->merchant_config = $this->config->item($site, 'lianlian'); // test: 测试环境
error_reporting(0);
log_message('error', 'LianlianPay notify refund begin ----');
$response['code'] = 0;
$response['message'] = '';
$raw_post_data = file_get_contents('php://input');
if (empty($raw_post_data)) {
# 如果没有数据,直接返回失败
return $this->output->set_content_type('application/json')->set_output(json_encode($response));
}
$signature = $this->input->server('HTTP_SIGNATURE');
$payment_result = json_decode($raw_post_data, true);
if ($this->check_sign($payment_result, $signature) !== true) {
log_message('error','debug: ' . __METHOD__ . ': ' . __LINE__ . ' signature' . PHP_EOL . var_export($signature, 1));
log_message('error','debug: ' . __METHOD__ . ': ' . __LINE__ . ' raw_post_data' . PHP_EOL . var_export($raw_post_data, 1));
$response['message'] = 'sign error';
// return $this->output->set_content_type('application/json')->set_output(json_encode($response)); // debug:
}
$payment_data = $payment_result['refund_data'];
$find_related = $this->note_model->get_note_where(['OPN_invoiceId' => ['=', $payment_result['original_transaction_id']], 'OPN_transactionResult' => ['=', 'completed']]);
// ! 退款手续费 1USD, 原交易手续费不退
// $payment_fee = $payment_data['payment_amount'] - $payment_data['settlement_amount'];
// $ssje = $this->account_model->get_ssje('-' . $payment_data['actual_refund_amount'], str_replace("CNY", "RMB", strtoupper($payment_data['actual_refund_currency_code'])), $this->merchant_config['method_code']);
$ssje = $this->account_model->get_ssje('-' . $payment_data['settlement_amount'], str_replace("CNY", "RMB", strtoupper($payment_data['settlement_currency_code'])), $this->merchant_config['method_code']);
$save_column = array();
$save_column['OPN_transactionId'] = $payment_result['ll_transaction_id'];
$save_column['OPN_orderId'] = $payment_result['original_transaction_id'];
$save_column['OPN_rawOrderId'] = $payment_result['merchant_transaction_id'];
$save_column['OPN_invoiceId'] = $payment_result['merchant_transaction_id'];
$save_column['OPN_relatedId'] = isset($find_related[0]->OPN_transactionId) ? $find_related[0]->OPN_transactionId : null;
$save_column['OPN_subject'] = $payment_result['merchant_transaction_id'] . ' ' . $payment_data['reason'];
$save_column['OPN_currency'] = $payment_data['refund_currency_code'];
$save_column['OPN_orderAmount'] = '-'.$payment_data['refund_amount'];
$save_column['OPN_payAmount'] = '-'.$payment_data['refund_amount'];
$save_column['OPN_payFee'] = null; // 1; // ! todo: 计算手续费; 退款 1 USD 原手续费不退
$save_column['OPN_netAmount'] = '-'.$payment_data['settlement_amount']; // todo:
$save_column['OPN_transactionResult'] = refund_status($payment_data['refund_status']);
$save_column['OPN_resultCode'] = $payment_data['refund_status'];
// $save_column['OPN_resultMsg'] = isset($payment_result['return_msg']) ? $payment_result['return_msg'] : $payment_result['result_code'];
// $save_column['OPN_errCode'] = isset($payment_result['err_code']) ? $payment_result['err_code'] : NULL;
// $save_column['OPN_errMsg'] = isset($payment_result['err_code_des']) ? $payment_result['err_code_des'] : NULL;
$save_column['OPN_acquiringTime'] = date('Y-m-d H:i:s', strtotime($payment_data['refund_time']));
$save_column['OPN_completeTime'] = date('Y-m-d H:i:s', strtotime($payment_data['refund_time']));
$save_column['OPN_remark'] = $payment_data['reason'] ? $payment_data['reason'] : '';
// $save_column['OPN_payerLogId'] = $payment_result['openid'];
// $save_column['OPN_payerStatus'] = $payment_result['is_subscribe']==='Y' ? "subscribed" : NULL;
$save_column['OPN_fundSource'] = $site;
$save_column['OPN_entryAmountCNY'] = floatval($ssje);
$save_column['OPN_rawContent'] = json_encode($payment_result);
$save_column['OPN_noticeTime'] = date('Y-m-d H:i:s');
$save_column['OPN_noticeType'] = 'refund';
$save_column['OPN_noticeSendStatus'] = refund_status_send($payment_data['refund_status']);
$save_column['OPN_noticeSendTime'] = NULL;
$save_column['OPN_accountMethod'] = $this->merchant_config['method_code'];
// log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' to in' . PHP_EOL . var_export($save_column, 1));
// die; // test:0
if ($this->note_model->insert_note($save_column)) {
$response['code'] = 200;
$response['message'] = 'success';
}
$this->output->set_content_type('application/json')->set_output(json_encode($response));
}
// protected function generateSignArray($params, $signType = "RSA")
// {
// return $this->sign(generateSignContent($params), $signType);
// }
// protected function sign($data, $signType = "RSA")
// {
// $this->private_key = $this->merchant_config['merchant_private_key'];
// $priKey = $this->private_key;
// $res = "-----BEGIN RSA PRIVATE KEY-----\n" .
// wordwrap($priKey, 64, "\n", true) .
// "\n-----END RSA PRIVATE KEY-----";
// ($res) or die('您使用的私钥格式错误请检查RSA私钥配置');
// if ("RSA2" == $signType) {
// openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA256);
// } else {
// openssl_sign($data, $sign, $res);
// }
// $sign = base64_encode($sign);
// return $sign;
// }
protected function check_sign($data, $signature)
{
if (empty($signature)) {
log_message('error', 'LianlianPay notify error: no sign.');
return false;
}
$verify_res = $this->verify_signature(generateSignContent($data), $signature);
if ( ! $verify_res) {
log_message('error', 'LianlianPay notify error: sign. ' . generateSignContent($data));
return false;
}
// return false; // test: 0
return true;
}
protected function verify_signature($data, $sign, $signType = "RSA")
{
// Load the public key
$pubKey = $this->merchant_config['lianlian_public_key'];
if (!$pubKey) {
return false; // Public key file not found or unreadable.
}
$res = "-----BEGIN PUBLIC KEY-----\n" .
wordwrap($pubKey, 64, "\n", true) .
"\n-----END PUBLIC KEY-----";
$res = openssl_get_publickey($res);
($res) or die('LianlianRSA公钥错误。请检查公钥文件格式是否正确');
//调用openssl内置方法验签返回bool值
if ("RSA2" == $signType) {
$result = (bool)openssl_verify($data, base64_decode($sign), $res, OPENSSL_ALGO_SHA256); // sha256 OPENSSL_ALGO_SHA256
} else {
$result = (bool)openssl_verify($data, base64_decode($sign), $res);
}
// log_message('error', 'test: ' . __METHOD__ . ': ' . __LINE__ . ' result' . PHP_EOL . var_export($result, 1));
//释放资源
openssl_free_key($res);
return $result;
}
}

@ -25,6 +25,7 @@ class PaymentService extends CI_Controller {
"15015" => "Alipay", "15015" => "Alipay",
"15016" => "WeChat", "15016" => "WeChat",
"15018" => "Credit Card-iPaylinks", "15018" => "Credit Card-iPaylinks",
"15035" => "Credit Card-Lianlian",
); );
public function index() public function index()
@ -36,8 +37,8 @@ class PaymentService extends CI_Controller {
$this->permission->is_admin(true); $this->permission->is_admin(true);
$data = array(); $data = array();
$method = $this->input->get_post("method"); $method = $this->input->get_post("method");
$method = $method===false ? null : $method; $method = $method===false ? null : $method; // explode(',', $method);
$data['method_code'] = ''; $data['method_code'] = $method ? $method : '';
// $data["paytext"] = $this->payment_status(); // $data["paytext"] = $this->payment_status();
if (isset($this->code_brandname[$method])) { if (isset($this->code_brandname[$method])) {
$data['method_code'] = $method; $data['method_code'] = $method;
@ -99,7 +100,7 @@ class PaymentService extends CI_Controller {
$wx_app = $wx_app!=='0' ? $wx_app : (isset($raw->appid) ? $raw->appid : '0'); $wx_app = $wx_app!=='0' ? $wx_app : (isset($raw->appid) ? $raw->appid : '0');
$ele->app_name = ""; $ele->app_name = "";
if ($this->wxpay_app[$wx_app]) { if ($ele->OPN_accountMethod===15016 && $this->wxpay_app[$wx_app]) {
$ele->app_name = $this->wxpay_app[$wx_app]; $ele->app_name = $this->wxpay_app[$wx_app];
} }
} }
@ -168,6 +169,11 @@ class PaymentService extends CI_Controller {
// continue; // continue;
} }
$GAI_API = null;
$_memo = json_decode($item->OPN_rawContent);
$GAI_API = property_exists($_memo, 'GAI_API') ? $_memo->GAI_API : null;
$GAI_API = json_encode($GAI_API, JSON_UNESCAPED_SLASHES);
// 开始查找订单和录入 // 开始查找订单和录入
$handpick = empty($opn_id) ? false : true; $handpick = empty($opn_id) ? false : true;
$advisor_info = $this->account_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype, $handpick); $advisor_info = $this->account_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype, $handpick);
@ -216,7 +222,7 @@ class PaymentService extends CI_Controller {
$item->OPN_payerName, $item->OPN_payerName,
$item->OPN_payerEmail, $item->OPN_payerEmail,
$item->OPN_transactionId, $item->OPN_transactionId,
$ht_memo $ht_memo, $GAI_API
); );
if ($is_refund === true && $insertID) { if ($is_refund === true && $insertID) {
$this->account_model->exec_BIZ_TrainCostAdd($COLI_SN, $ssje); $this->account_model->exec_BIZ_TrainCostAdd($COLI_SN, $ssje);
@ -254,7 +260,7 @@ class PaymentService extends CI_Controller {
$item->OPN_payerName, $item->OPN_payerName,
$item->OPN_payerEmail, $item->OPN_payerEmail,
$item->OPN_transactionId, $item->OPN_transactionId,
$ht_memo $ht_memo, $GAI_API
); );
// 更新订单主表付款方式,防止没访问thankyou-train.asp // 更新订单主表付款方式,防止没访问thankyou-train.asp
$this->account_model->update_paymanner($COLI_SN, $item->OPN_accountMethod); $this->account_model->update_paymanner($COLI_SN, $item->OPN_accountMethod);
@ -280,7 +286,7 @@ class PaymentService extends CI_Controller {
$item->OPN_payerName, $item->OPN_payerName,
$item->OPN_payerEmail, $item->OPN_payerEmail,
$item->OPN_transactionId, $item->OPN_transactionId,
$ht_memo $ht_memo, $GAI_API
); );
if ($is_refund === false) { if ($is_refund === false) {
//添加汉特的订单提醒 //添加汉特的订单提醒
@ -346,7 +352,7 @@ class PaymentService extends CI_Controller {
// todo:iPaylinks需要发收款, 退款发所有 // todo:iPaylinks需要发收款, 退款发所有
// 3. 更新是否发送财务 // 3. 更新是否发送财务
if($is_refund === true ) { if($is_refund === true ) {
$this->send_refund($send_email, $item, $orderid_info, $advisor_info); $this->send_refund_email($send_email, $item, $orderid_info, $advisor_info);
} }
//显示处理记录 //显示处理记录
@ -362,7 +368,7 @@ class PaymentService extends CI_Controller {
// return $this->output->set_content_type('application/json')->set_output(json_encode($data)); // return $this->output->set_content_type('application/json')->set_output(json_encode($data));
} }
public function send_refund($send_email, $item, $orderid_info, $advisor_info) public function send_refund_email($send_email, $item, $orderid_info, $advisor_info)
{ {
// 发送客人 // 发送客人
if ($send_email===true if ($send_email===true

@ -24,7 +24,7 @@ class WxpayService extends CI_Controller {
public function notify($site='cht') public function notify($site='cht')
{ {
error_reporting(0); error_reporting(0);
// log_message('error','notify begin ----'); // log_message('error','wxpay notify begin ----');
$response['return_code'] = 'FAIL'; $response['return_code'] = 'FAIL';
$response['return_msg'] = ''; $response['return_msg'] = '';
$GLOBALS['__WX_SITE_NAME__'] = $site; $GLOBALS['__WX_SITE_NAME__'] = $site;
@ -129,6 +129,8 @@ class WxpayService extends CI_Controller {
$save_column['OPN_transactionId'] = $row['refund_id']; $save_column['OPN_transactionId'] = $row['refund_id'];
$save_column['OPN_orderAmount'] = "-" . $row['settlement_refund_fee']; $save_column['OPN_orderAmount'] = "-" . $row['settlement_refund_fee'];
$save_column['OPN_payAmount'] = "-" . $row['settlement_refund_fee']; $save_column['OPN_payAmount'] = "-" . $row['settlement_refund_fee'];
// $save_column['OPN_payFee'] = bcsub(0, $row['wxpay_fee']);
// $save_column['OPN_netAmount'] = "-" . bcadd($row['call_refund_fee'], $row['wxpay_fee']);
$save_column['OPN_resultCode'] = $row['refund_status']; $save_column['OPN_resultCode'] = $row['refund_status'];
$save_column['OPN_resultMsg'] = $row['refund_status']; $save_column['OPN_resultMsg'] = $row['refund_status'];
$save_column['OPN_entryAmountCNY'] = floatval("-" . $ssje); $save_column['OPN_entryAmountCNY'] = floatval("-" . $ssje);
@ -136,7 +138,11 @@ class WxpayService extends CI_Controller {
$save_column['OPN_relatedId'] = $row['transaction_id']; $save_column['OPN_relatedId'] = $row['transaction_id'];
} else { } else {
// 收款 // 收款
$ssje = $this->account_model->get_ssje($row['settlement_total_fee'], str_replace("CNY", "RMB", strtoupper($row['currency_type'])), $save_column['OPN_accountMethod']); $save_column['OPN_payFee'] = bcsub(0, $row['wxpay_fee']);
$save_column['OPN_netAmount'] = bcsub($row['settlement_total_fee'], $row['wxpay_fee']);
$ssje = $this->account_model->get_ssje_exclude_fee($save_column['OPN_netAmount'], str_replace("CNY", "RMB", strtoupper($row['currency_type'])), $save_column['OPN_accountMethod']);
$save_column['OPN_transactionId'] = $row['transaction_id']; $save_column['OPN_transactionId'] = $row['transaction_id'];
$save_column['OPN_orderAmount'] = $row['settlement_total_fee']; $save_column['OPN_orderAmount'] = $row['settlement_total_fee'];
$save_column['OPN_payAmount'] = $row['settlement_total_fee']; $save_column['OPN_payAmount'] = $row['settlement_total_fee'];
@ -174,15 +180,22 @@ class WxpayService extends CI_Controller {
$transaction_id = $this->input->get_post("keywords"); $transaction_id = $this->input->get_post("keywords");
$this->load->model('WxpayQueryContentBuilder', 'query_builder'); $this->load->model('WxpayQueryContentBuilder', 'query_builder');
$this->query_builder->set_transaction_id($transaction_id); $this->query_builder->set_transaction_id($transaction_id);
// $this->query_builder->set_out_trade_no($transaction_id);
$this->load->library('Wxpay_call'); $this->load->library('Wxpay_call');
foreach ($all_account as $account) { foreach ($all_account as $account) {
// echo json_encode($this->query_builder);
// return;
$resultR = $this->wxpay_call->query_order_refund($this->query_builder, 0, $account); $resultR = $this->wxpay_call->query_order_refund($this->query_builder, 0, $account);
$result = $this->wxpay_call->query_order_refund($this->query_builder, 1, $account); $result = $this->wxpay_call->query_order_refund($this->query_builder, 1, $account);
if ($result['status'] === true) { if ($result['status'] === true) {
echo json_encode($result);
return;
$this->note_model->add_note_wxpay($result['data'], $account, 'pay'); $this->note_model->add_note_wxpay($result['data'], $account, 'pay');
} }
if ($resultR['status'] === true) { if ($resultR['status'] === true) {
echo json_encode($result);
return;
$this->note_model->add_note_wxpay($resultR['data'], $account, 'refund'); $this->note_model->add_note_wxpay($resultR['data'], $account, 'refund');
} }
// log_message('error',"query wxpay failed. $account $transaction_id"); // log_message('error',"query wxpay failed. $account $transaction_id");
@ -191,7 +204,8 @@ class WxpayService extends CI_Controller {
$data["method_name"] = 'WeChat'; $data["method_name"] = 'WeChat';
$data['date'] = date('Y-m-d'); $data['date'] = date('Y-m-d');
$data['notelist'] = $this->note_model->search_key($transaction_id); $data['notelist'] = $this->note_model->search_key($transaction_id);
$this->load->view("payment_list",$data); echo json_encode($data);
// $this->load->view("payment_list",$data);
return; return;
} }

@ -316,3 +316,93 @@ function zero_to_one($value)
{ {
return $value==0 ? 1 : $value; return $value==0 ? 1 : $value;
} }
function to_json($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
}
/**
* 校验$value是否非空
* if not set ,return true;
* if is null , return true;
**/
function checkEmpty($value)
{
if (!isset($value))
return true;
if ($value === null)
return true;
if (trim($value) === "")
return true;
return false;
}
/**
* 连连支付
* @uses LianlianService
*/
/**
* 递归地将数组转为key=value形式, 仅拼接叶子节点
* @uses LianlianService
*/
function generateKeyValueParts($key, $value, &$parts) {
if (is_array($value)) {
ksort($value); // Sort inner array keys
foreach ($value as $innerKey => $innerValue) {
generateKeyValueParts($innerKey, $innerValue, $parts); //recursive call and build the key
}
} else {
$parts[] = $key . '=' . $value;
}
}
/**
* 生成待加签字符串
* @uses LianlianService
*/
function generateSignContent($data) {
ksort($data); // Sort keys alphabetically
$parts = [];
foreach ($data as $key => $value) {
generateKeyValueParts($key, $value, $parts);
}
return implode('&', $parts);
}
/**
* 连连
* 退款状态, 结果码
*/
function refund_status($code) {
$lianlian_refund_code = [
'PC' => 'pending',
'RS' => 'completed',
'RF' => 'failed',
];
return $code ? $lianlian_refund_code[$code] : '';
}
/**
* 连连
* 退款状态, 发送码
* @param string $code
*/
function refund_status_send($code) {
$lianlian_refund_code = [
'PC' => 'closed',
'RS' => 'unsend',
'RF' => 'closed',
];
return $code ? $lianlian_refund_code[$code] : '';
}
/**
* End 连连支付
*/

@ -23,6 +23,16 @@ class Online_payment_account_model extends CI_Model {
} }
return NULL; return NULL;
} }
public function get_ssje_exclude_fee($amount, $currency='USD', $pay_type='15002')
{
$sql = "SELECT dbo.ConvertToRMB(?, ?) as ssje";
$query = $this->HT->query($sql,array($currency, $amount));
$result = $query->result();
if ( ! empty($result)) {
return $result[0]->ssje;
}
return 0;
}
//根据订单号获取外联邮箱 //根据订单号获取外联邮箱
public function get_order($COLI_ID, $orderinfo = false, $ordertype = 'N', $handpick=false) { public function get_order($COLI_ID, $orderinfo = false, $ordertype = 'N', $handpick=false) {
@ -248,7 +258,7 @@ class Online_payment_account_model extends CI_Model {
} }
//添加收款记录(商务订单) //添加收款记录(商务订单)
public function add_account_info($GAI_COLI_SN, $payment_method, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo) { public function add_account_info($GAI_COLI_SN, $payment_method, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo, $GAI_API = null) {
//先判断是否有这条数据 //先判断是否有这条数据
$sql = " $sql = "
@ -272,17 +282,18 @@ class Online_payment_account_model extends CI_Model {
,GAI_CusEmail ,GAI_CusEmail
,GAI_AccreditNo ,GAI_AccreditNo
,GAI_Memo ,GAI_Memo
,GAI_API
,GAI_State ,GAI_State
,DeleteFlag,LastEditTime ,DeleteFlag,LastEditTime
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())"; ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())";
$query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_COLI_ID, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); $query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_COLI_ID, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo, $GAI_API));
$insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('BIZ_GroupAccountInfo') : false; $insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('BIZ_GroupAccountInfo') : false;
return $insertid; return $insertid;
} }
//添加收款记录(商务订单),APP会自动增加记录所以添加前根据金额来判断是否有重复记录 //添加收款记录(商务订单),APP会自动增加记录所以添加前根据金额来判断是否有重复记录
public function add_account_info_forAPP($GAI_COLI_SN, $payment_method, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo) { public function add_account_info_forAPP($GAI_COLI_SN, $payment_method, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo, $GAI_API = null) {
//先判断是否有这条数据 //先判断是否有这条数据
$sql = " $sql = "
IF NOT EXISTS( IF NOT EXISTS(
@ -305,10 +316,11 @@ class Online_payment_account_model extends CI_Model {
,GAI_CusEmail ,GAI_CusEmail
,GAI_AccreditNo ,GAI_AccreditNo
,GAI_Memo ,GAI_Memo
,GAI_API
,GAI_State ,GAI_State
,DeleteFlag,LastEditTime ,DeleteFlag,LastEditTime
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())"; ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())";
$query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $payment_method, $GAI_COLI_SN, $GAI_COLI_ID, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); $query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $payment_method, $GAI_COLI_SN, $GAI_COLI_ID, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo, $GAI_API));
$insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('BIZ_GroupAccountInfo') : false; $insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('BIZ_GroupAccountInfo') : false;
return $insertid; return $insertid;
// return $query->num_rows() > 0; // return $query->num_rows() > 0;
@ -321,10 +333,9 @@ class Online_payment_account_model extends CI_Model {
} }
//添加收款记录(传统订单) //添加收款记录(传统订单)
public function add_tour_account_info($GAI_COLI_SN, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo) { public function add_tour_account_info($GAI_COLI_SN, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo, $GAI_API = null) {
//先判断是否有这条数据 //先判断是否有这条数据
$sql = " $sql = "
IF NOT EXISTS( IF NOT EXISTS(
SELECT TOP 1 1 SELECT TOP 1 1
FROM GroupAccountInfo FROM GroupAccountInfo
@ -344,10 +355,11 @@ class Online_payment_account_model extends CI_Model {
,GAI_CusEmail ,GAI_CusEmail
,GAI_AccreditNo ,GAI_AccreditNo
,GAI_Memo ,GAI_Memo
,GAI_API
,GAI_State ,GAI_State
,DeleteFlag,LastEditTime ,DeleteFlag,LastEditTime
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())"; ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())";
$query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); $query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo, $GAI_API));
$insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('GroupAccountInfo') : false; $insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('GroupAccountInfo') : false;
return $insertid; return $insertid;
} }

@ -64,7 +64,7 @@ class Online_payment_note_model extends CI_Model {
$this->init_query(); $this->init_query();
$this->topnum = $num; $this->topnum = $num;
// $this->send = " AND (OPN_noticeSendStatus='unsend' OR OPN_noticeSendStatus='' OR OPN_noticeSendStatus IS NULL) "; // $this->send = " AND (OPN_noticeSendStatus='unsend' OR OPN_noticeSendStatus='' OR OPN_noticeSendStatus IS NULL) ";
$this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; $this->search = $method===null ? "" : " AND OPN_accountMethod IN ($method) ";
$this->send = " AND ISNULL(OPN_noticeSendStatus,'') in ('', 'unsend') "; $this->send = " AND ISNULL(OPN_noticeSendStatus,'') in ('', 'unsend') ";
return $this->query_note(); return $this->query_note();
@ -75,7 +75,7 @@ class Online_payment_note_model extends CI_Model {
$this->init_query(); $this->init_query();
$this->topnum = $num; $this->topnum = $num;
$this->send = " AND (OPN_noticeSendStatus) = 'closed' "; $this->send = " AND (OPN_noticeSendStatus) = 'closed' ";
$this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; $this->search = $method===null ? "" : " AND OPN_accountMethod IN ($method) ";
$this->search .= " AND OPN_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59' "; $this->search .= " AND OPN_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59' ";
return $this->query_note(); return $this->query_note();
} }
@ -84,7 +84,7 @@ class Online_payment_note_model extends CI_Model {
{ {
$this->init_query(); $this->init_query();
$this->topnum = $num; $this->topnum = $num;
$this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; $this->search = $method===null ? "" : " AND OPN_accountMethod IN ($method) ";
// 1小时前 // 1小时前
$date = date("Y-m-d H:i:s", time() - 3600); $date = date("Y-m-d H:i:s", time() - 3600);
$this->search .= $num !== false ? " AND OPN_noticeSendTime < '$date' " : ''; $this->search .= $num !== false ? " AND OPN_noticeSendTime < '$date' " : '';
@ -119,6 +119,7 @@ class Online_payment_note_model extends CI_Model {
"15015" => "Alipay", "15015" => "Alipay",
"15016" => "WeChat", "15016" => "WeChat",
"15018" => "Credit Card-iPaylinks", "15018" => "Credit Card-iPaylinks",
"15035" => "Credit Card-Lianlian",
); );
private $wxpay_app = array( private $wxpay_app = array(
"wx749246dd935ca07b" => "APP", "wx749246dd935ca07b" => "APP",
@ -172,6 +173,32 @@ class Online_payment_note_model extends CI_Model {
return $this->query_note(); return $this->query_note();
} }
/**
* @param mixed $where ['OPN_SN' => ['=', {val}] ]
*/
public function get_note_where($where) {
$this->init_query();
$this->topnum=1;
$this->search = '';
foreach ($where as $key => $value) {
$where_val = '';
switch (strtolower($value[0])) {
case '=':
$where_val = " = {$this->info->escape($value[1])}";
break;
case 'in':
$where_val = " IN ({$this->info->escape($value[1])})";
break;
default:
$where_val = " = {$this->info->escape($value[1])}";
break;
}
$this->search .= " AND {$key} {$where_val} ";
}
return $this->query_note();
}
public function search_key($keyword) public function search_key($keyword)
{ {
$this->init_query(); $this->init_query();
@ -191,7 +218,7 @@ class Online_payment_note_model extends CI_Model {
public function search_date($date, $method=null) public function search_date($date, $method=null)
{ {
$this->init_query(); $this->init_query();
$this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; $this->search = $method===null ? "" : " AND OPN_accountMethod IN ($method) ";
$this->search .= " AND OPN_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59' "; $this->search .= " AND OPN_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59' ";
$this->send = " AND isnull(OPN_noticeSendStatus,'') NOT IN ('', 'sendfail', 'unsend', 'closed' )"; $this->send = " AND isnull(OPN_noticeSendStatus,'') NOT IN ('', 'sendfail', 'unsend', 'closed' )";
return $this->query_note(); return $this->query_note();

@ -30,12 +30,19 @@
.paypal-color {background-color: #002D89;} .paypal-color {background-color: #002D89;}
.alipay-color {background-color: #00AAEE;} .alipay-color {background-color: #00AAEE;}
.ipaylinks-color,.creditcard-color,.creditcard-ipaylinks-color {background-color: #A31022;} .ipaylinks-color,.creditcard-color,.creditcard-ipaylinks-color {background-color: #A31022;}
.creditcard-lianlian-color {background-color: #1985ff;}
.modal {background-color: rgba(0,0,0,0.075);} .modal {background-color: rgba(0,0,0,0.075);}
.cht-color {background-color: #A31022;} .cht-color {background-color: #A31022;}
.trippest-color {background-color: #E83201;} .trippest-color {background-color: #E83201;}
.app-color {background-color: #EC3A4F;} .app-color {background-color: #EC3A4F;}
.hly-color {background-color: #009fe9;} .hly-color {background-color: #009fe9;}
.unknown-color{ background-color: #999999;}
.flex {display: flex;}
.items-center {align-items: center;}
.justify-center {justify-content: center;}
.ml-auto {margin-left: auto;}
</style> </style>
<style type="text/css" media="screen and (max-width:767px)"> <style type="text/css" media="screen and (max-width:767px)">
.navbar-header h1 {display: block; font-size: 20px;} .navbar-header h1 {display: block; font-size: 20px;}
@ -151,17 +158,17 @@
<a <?php if($method_code==='15016') { ?> class="text-muted"<?php } ?> <a <?php if($method_code==='15016') { ?> class="text-muted"<?php } ?>
href="<?php echo set_url_param(array('method'=>15016)) ?>">微信&raquo;</a> href="<?php echo set_url_param(array('method'=>15016)) ?>">微信&raquo;</a>
&NonBreakingSpace; &NonBreakingSpace;
<a <?php if($method_code==='15002') { ?> class="text-muted"<?php } ?> <!-- <a <?php if($method_code==='15002') { ?> class="text-muted"<?php } ?>
href="<?php echo set_url_param(array('method'=>15002)) ?>">PayPal&raquo;</a> href="<?php //echo set_url_param(array('method'=>15002)) ?>">PayPal&raquo;</a>
&NonBreakingSpace; &NonBreakingSpace; -->
<a <?php if($method_code==='15018') { ?> class="text-muted"<?php } ?> <a <?php if($method_code==='15018,15035') { ?> class="text-muted"<?php } ?>
href="<?php echo set_url_param(array('method'=>15018)) ?>">信用卡&raquo;</a> href="<?php echo set_url_param(array('method'=>'15018,15035')) ?>">信用卡&raquo;</a>
&NonBreakingSpace;
<a <?php if($method_code==='15015') { ?> class="text-muted"<?php } ?>
href="<?php echo set_url_param(array('method'=>15015)) ?>">支付宝&raquo;</a>
&NonBreakingSpace; &NonBreakingSpace;
<!-- <a <?php if($method_code==='15015') { ?> class="text-muted"<?php } ?>
href="<?php //echo set_url_param(array('method'=>15015)) ?>">支付宝&raquo;</a>
&NonBreakingSpace; -->
&boxv;&NonBreakingSpace; &boxv;&NonBreakingSpace;
<a target="_blank" href="/webht.php/apps/pay/paymentservice/income_statistics">汇总统计&raquo;</a> <!-- <a target="_blank" href="/webht.php/apps/pay/paymentservice/income_statistics">汇总统计&raquo;</a> -->
<ul class="nav navbar-nav navbar-right pull-right" style="margin:7.5px 0;"> <ul class="nav navbar-nav navbar-right pull-right" style="margin:7.5px 0;">
<li class="dropdown"> <li class="dropdown">
@ -211,6 +218,9 @@
<p>3.sendfail 状态的需要手工设置正确的订单号</p> <p>3.sendfail 状态的需要手工设置正确的订单号</p>
<p>4.Pending 还未到账,需要人工检查,确认支付或者取消,需要手工关闭此通知</p> <p>4.Pending 还未到账,需要人工检查,确认支付或者取消,需要手工关闭此通知</p>
<p>5.Denied 银行拒付,需要手工关闭此通知</p> <p>5.Denied 银行拒付,需要手工关闭此通知</p>
<p>6.closed 已经关闭此通知</p>
<h4>记录状态:</h4>
<p>1.recorded 表示已经录入HT订单收款</p>
</div> </div>
</div> </div>
<!-- left end --> <!-- left end -->
@ -218,13 +228,14 @@
<table class="table table-bordered table-hover"> <table class="table table-bordered table-hover">
<thead> <thead>
<tr> <tr>
<th >#</th> <th width="20">#</th>
<th >主题</th> <th width="360">主题</th>
<th width="260" class="hidden-xs">subject</th> <th width="280" class="hidden-xs">subject</th>
<th width="280" class="hidden-xs">交易号</th> <th width="280" class="hidden-xs">交易号</th>
<th width="150">收单时间</th> <th width="150">收单时间</th>
<th width="150" class="hidden-xs">通知时间</th> <!-- <th width="150" class="hidden-xs">通知时间</th> -->
<th>状态[通知/记录]</th> <th width="150" class="hidden-xs">账单&nbsp;/&nbsp;录入</th>
<th width="150">状态[通知/记录]</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -247,12 +258,19 @@
</td> </td>
<td class="hidden-xs"><?php echo $item->OPN_transactionId; ?></td> <td class="hidden-xs"><?php echo $item->OPN_transactionId; ?></td>
<td><?php echo $item->OPN_acquiringTime; ?></td> <td><?php echo $item->OPN_acquiringTime; ?></td>
<td class="hidden-xs"><?php echo $item->OPN_noticeTime; ?></td> <!-- <td class="hidden-xs"><?php // echo $item->OPN_noticeTime; ?></td> -->
<td class="hidden-xs">
<div><?php echo $item->OPN_noticeTime ? $item->OPN_noticeTime : '--'; ?></div>
<div><?php echo $item->OPN_accountTime ? $item->OPN_accountTime : '--'; ?></div>
</td>
<td> <td>
<?php <?php
$send_text = '';$send_class=''; $send_text = '';$send_class='';
$recored_text = '';
if ($item->OPN_accountStatus !== 'recorded') { if ($item->OPN_accountStatus !== 'recorded') {
$send_class = 'btn-danger'; $send_class = 'btn-danger';
} else {
$recored_text = '✅';// // ✅☑️✔️
} }
if ($item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-') { if ($item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-') {
$send_class = 'btn-danger'; $send_class = 'btn-danger';
@ -261,12 +279,18 @@
$send_class = ''; $send_class = '';
} }
?> ?>
<?php if ($item->OPN_noticeType !== 'pay') { <?php
if ($item->OPN_transactionResult !== 'completed') {
echo '<span class=text-muted >' . strtoupper($item->OPN_transactionResult) . '</span><br>';
} elseif ($item->OPN_noticeType !== 'pay') {
echo '<span class=text-danger >' . strtoupper($item->OPN_noticeType) . '</span><br>'; echo '<span class=text-danger >' . strtoupper($item->OPN_noticeType) . '</span><br>';
} ?> } ?>
<div class="flex items-center">
<a href="javascript:void(0);" class="btn btn-sm <?php echo $send_class; ?>" onclick="show_gai_modal('<?php echo $item->OPN_SN; ?>')"> <a href="javascript:void(0);" class="btn btn-sm <?php echo $send_class; ?>" onclick="show_gai_modal('<?php echo $item->OPN_SN; ?>')">
<?php echo $item->OPN_noticeSendStatus .' / ' . $item->OPN_accountStatus; ?> <?php echo $item->OPN_noticeSendStatus ; ?>
</a> </a>
<span class="ml-auto"><?php echo ($recored_text); ?></span>
</div>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>

Loading…
Cancel
Save