|
1.首先修改游戏充值跳转路径,找到根目录下main.min.js文件,搜索prototype._Pay,修改函数内容为:
- var _this = this;
- this.Rpc(C2sProtocol.cs_recharge_get_order_number, null, function (rsp) {
- var rspData = rsp;
- var uid = Main.Instance.UserName;
- var serverId = Main.Instance.mConnectServerData.id;
- var requestURL = "/pay/index.php?uid=" + uid + "&serverid=" + serverId + "&rechargeid=" + id;
- window.open(requestURL);
- });
复制代码 2.修改jsconfig.php里的配置
- <?php
- //www.lierenpay.com
- $uid='10xxx'; //***←这里修改为猎人支付平台uid
- $ukey='xxxxxxxxxxx'; //***←这里修改为猎人支付平台ukey
- $targetUrl='http://你的IP/pay/jspayapi.php'; //***←把这里改为你的域名或ip,有端口号的话加上
- //修改为你的数据库信息
- $dbconfig = array(
- 'db_host' => '127.0.0.1',
- 'db_user' => 'root',//***
- 'db_pass' => '123456',//***
- 1 => array(
- 'db_name' => 'xntg1'
- ),//一区的数据库
- 2 => array(
- 'db_name' => 'xntg2'
- ),//二区的数据库
- );
- //礼包请根据游戏实际礼包修改对应的金额跟奖励,否则充值对不上会导致充错或充不上。游戏的礼包配置在游戏目录/cz/config.php里,一定要把这里改为和它一样
- $libaoconfig = array(
- '1'=>array(98,'终身卡'), //***格式为 编号 售价 礼包说明,请按此格式添加修改
- '2'=>array(25,'月卡'),
- '3'=>array(10,'100000元宝'),
- '4'=>array(20,'200000元宝'),
- '5'=>array(30,'300000元宝'),
- '6'=>array(50,'500000元宝'),
- '7'=>array(100,'1000000元宝'),
- '8'=>array(200,'2000000元宝'),
- '9'=>array(300,'3000000元宝'),
- '10'=>array(500,'5000000元宝'),
- '11'=>array(1000,'10000000元宝'),
- '12'=>array(2000,'20000000元宝'),
- '13'=>array(3000,'30000000元宝'),
- '14'=>array(5000,'50000000元宝'),
- '15'=>array(10,'开服第1天:人民币礼包10元'),
- '16'=>array(10,'开服第2天:人民币礼包10元'),
- '17'=>array(10,'开服第3天:人民币礼包10元'),
- '18'=>array(20,'开服第4天:人民币礼包20元'),
- '19'=>array(20,'开服第5天:人民币礼包20元'),
- '20'=>array(20,'开服第6天:人民币礼包20元'),
- '21'=>array(50,'开服第7天:人民币礼包50元'),
- '22'=>array(50,'开服第8天:人民币礼包50元'),
- '23'=>array(10,'首充10元'),
- '24'=>array(50,'首充50元'),
- '25'=>array(100,'首充100元'),
- '26'=>array(500,'首充500元'),
- );
- //每个礼包的价格请不要相同,否则判断不出购买的是那个礼包
- ?>
复制代码 修改上述代码标记***位置即可。
3.修改jspayapi.php中的配置
- <?php
- require 'jsconfig.php';
- //下面代码基本不需要修改
- $data = $_POST;
- //file_put_contents("callback_log.txt", json_encode($_POST));
- $code = $_POST['code'];
- $orderId = $_POST['orderId'];
- $uOrderId = $_POST['uOrderId'];
- $payTime = $_POST['payTime'];
- $callUid = $_POST['uid'];
- $callUkey = $_POST['ukey'];
- $payNote = $_POST['payNote'];
- $types = $_POST['types'];
- $commission = $_POST['commission'];
- $amount = $_POST['amount'];
- $realityAmount = $_POST['realityAmount'];
- $userKey='你的ukey';//***这里修改为你的UID
- $key=hash("sha256", $payTime.$ukey.$orderId);
- if ($uid != $callUid || $callUkey != $key) return 'error:id or key';
复制代码 修改上述代码标记***位置即可。
4.附送弹窗支付代码
- RechargeModel.prototype.\_Pay = function (id) {
- var \_this = this;
- this.Rpc(C2sProtocol.cs\_recharge\_get\_order\_number, null, function (rsp) {
- var rspData = rsp;
- var uid = Main.Instance.UserName;
- var serverId = Main.Instance.mConnectServerData.id;
- //var requestURL = "http://www.xxxx.com/pay/index.php?uid=" + uid + "&serverid=" + serverId + "&rechargeid=" + id;
- //window.open(requestURL);
- $.post("/pay1/payFloat.php", {
- uid: uid,
- serverid: serverId,
- rechargeid: id,
- },
- function(e) {
- $("#payWrap").show(),
- $("#payWrap").html(e)
- })
- });
- };
复制代码本帖的付费内容 记录 http://www.lierenpay.com/download/雷霆H5内充.rar
|
|