PHP微信支付JSAPI网页支付Native原生支付
资源下载路径:
楼主花了几天的时间对接完成,整理好文档后楼主会将源码及实现过程全程发表出来。谢谢大家!
服务环境描述:PHP CI3框架 mysql数据库
下面是代码实现了:
1.数据库mysql语句
application/controllers/Wxpay.php
application/models/Pay_log_model
<?php
class Pay_log_model extends MY_Model {
public $_table = pay_log;
public $primary_key = log_id;
function get_info($id, $select=null){
if(!empty($select)){
$this->db->select($select);
}
return $this->get($id);
}
function save(&$data, $id = 0) {
$data[last_time] = time();
if ($id > 0) {
$this->db->set ( $data );
$this->db->where ( $this->primary_key, $id );
$this->db->update ( $this->_table );
$err = $this->db->error();
$data[db_code] = $err[code];
$data [$this->primary_key] = $id;
return $this->db->affected_rows ();
}
$data[add_time] = time();
$this->db->insert ( $this->_table, $data );
$err = $this->db->error();
$data[db_code] = $err[code];
$data [$this->primary_key] = $this->db->insert_id ();
return $this->db->affected_rows ();
}
}
application/views/weixin_pay.php
application/views/wxpay_detail.php
application/libraries/wxpay/lib/WxPay.Config.php
上一篇:
通过多线程提高代码的执行效率例子
下一篇:
电商“进销存”系统——进
