wxpay 异步通知处理:接收推送
parent
4ea5eb7147
commit
43e9c8a68e
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
$config["sign_type"] = "HMAC-SHA256";
|
||||||
|
$config["trade_type"] = "NATIVE";
|
||||||
|
$config["notify_url"] = "";
|
||||||
|
$config["currency"] = "CNY";
|
||||||
|
$config["currency_unit"] = 100;
|
||||||
|
$config["method_code"] = 15016;
|
||||||
|
/*!
|
||||||
|
* 各账号的设置
|
||||||
|
*/
|
||||||
|
// test
|
||||||
|
$config['test']["app_id"] = "wx426b3015555a46be";
|
||||||
|
$config['test']["mch_id"] = "1900009851";
|
||||||
|
$config['test']["key"] = "8934e7d15453e97507ef794cf7b0519d";
|
||||||
|
$config['test']["app_secret"] = "7813490da6f1265e4901ffb80afaa36f";
|
||||||
|
// Trippest
|
||||||
|
$config['trippest']["app_id"] = "";
|
||||||
|
$config['trippest']["mch_id"] = "";
|
||||||
|
$config['trippest']["key"] = "";
|
||||||
|
$config['trippest']["app_secret"] = "";
|
||||||
|
// ChinaHighlights = China train booking
|
||||||
|
$config['cht']["app_id"] = "";
|
||||||
|
$config['cht']["mch_id"] = "";
|
||||||
|
$config['cht']["key"] = "";
|
||||||
|
$config['cht']["app_secret"] = "";
|
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Online_payment_account_model extends CI_Model {
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
|
$this->HT = $this->load->database('HT', TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 调用数据库函数,生成实收金额
|
||||||
|
* @author LYT <lyt@hainatravel.com>
|
||||||
|
*/
|
||||||
|
public function get_ssje($amount, $currency='USD', $code)
|
||||||
|
{
|
||||||
|
$sql = "SELECT dbo.GetSSJEFromSQJE(?, ?, ?) as ssje";
|
||||||
|
$query = $this->HT->query($sql,array($code, $currency, $amount));
|
||||||
|
$result = $query->result();
|
||||||
|
if ( ! empty($result)) {
|
||||||
|
return $result[0]->ssje;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Online_payment_note_model extends CI_Model {
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
parent::__construct();
|
||||||
|
$this->info = $this->load->database('INFO', TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function insert_note($column)
|
||||||
|
{
|
||||||
|
if ($column === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$this->info->insert('OnlinePaymentNote', $column);
|
||||||
|
$ret = "SELECT TOP 1 * FROM OnlinePaymentNote WHERE OPN_transactionId=? ORDER BY OPN_SN DESC ";
|
||||||
|
return $this->info->query($ret, array($column['OPN_transactionId']))->row();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update_note($where, $column)
|
||||||
|
{
|
||||||
|
$update_str = $this->info->update_string('OnlinePaymentNote', $column, $where);
|
||||||
|
$this->info->query($update_str);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue