44 次代码提交 3143fdbc56 ... 19d2189eef

作者 SHA1 备注 提交日期
  lowkeyman 19d2189eef 椰林普充 德欣分省 1 周之前
  lowkeyman 8ecd96df5c 椰林普充 本宇高价2号 1 周之前
  lowkeyman c7e426ed54 Merge branch 'raccount' of 39.97.239.116:gyfl/xyzshop into raccount 2 周之前
  lowkeyman 70d15c303a 灿彬分省 山东电信 2 周之前
  lowkeyman 8d506a1c2d 栎辉分省 新增青海&海南电信 2 周之前
  lowkeyman fa5aec542a 国创分省 广东移动调价 2 周之前
  lowkeyman 865b98a65c 国创分省 广东移动调价 2 周之前
  lowkeyman 31155c940b Merge branch 'raccount' of 39.97.239.116:gyfl/xyzshop into raccount 2 周之前
  lowkeyman 759f0c5bcc 国创分省 河南电信调价 2 周之前
  lowkeyman 0d5c68b259 国创分省 广东移动调价 2 周之前
  lowkeyman 8a470e3811 新韩晶分省 云南电信 3 周之前
  lowkeyman 7952906c8d 国创分省 联通配置 3 周之前
  lowkeyman 5b3da687ea 国创分省 广东移动调价 3 周之前
  lowkeyman 98d1ead63b 国创分省 北京电信调价 3 周之前
  lowkeyman e17ece09ac 国创分省 北京电信调价 3 周之前
  lowkeyman ca79f2d9cb 国创分省 安徽电信调价 3 周之前
  lowkeyman 03d0885b39 国创分省 山东移动调价 3 周之前
  lowkeyman d254e19f9a 新翰晶分省 甘肃移动&福建电信配置 3 周之前
  lowkeyman 6d58b73b1a 国创分省 广东移动调价 3 周之前
  stanley-king af01439973 Merge branch 'raccount' of 39.97.239.116:gyfl/xyzshop into raccount 3 周之前
  stanley-king 6d815542dd remove nrui.php 3 周之前
  lowkeyman f3a1b915f2 椰林普充 风生分省 3 周之前
  stanley-king 0d27d270c4 Merge branch 'raccount' of 39.97.239.116:gyfl/xyzshop into raccount 3 周之前
  stanley-king 128df89035 dev 3 周之前
  lowkeyman c02d1cf6ac 国创分省 广东移动调价 4 周之前
  lowkeyman 0a4d343601 灿彬分省 江苏电信配置 4 周之前
  stanley-king b56e9a0590 try fix application/json 4 周之前
  stanley-king 21999578c5 dev 4 周之前
  stanley-king fc297c8d69 Merge branch 'raccount' of 39.97.239.116:gyfl/xyzshop into raccount 4 周之前
  stanley-king f991e461cc dev 4 周之前
  lowkeyman d30c7634d2 国创分省 广东移动调价 4 周之前
  lowkeyman 88b6b6cd77 国创分省 广东移动调价 4 周之前
  lowkeyman c76536a875 栎辉分省 江苏移动&电信配置 1 月之前
  lowkeyman b46bf07969 机构 订单拦截 1 月之前
  lowkeyman 24c5c16098 灿彬分省 云南电信配置 1 月之前
  lowkeyman a74b3502fd 国创分省 广东移动调价 1 月之前
  lowkeyman f77cdc4086 灿彬分省广西电信 1 月之前
  lowkeyman dfff0f3cd3 dev 1 月之前
  lowkeyman b9c8617ecf 带票额度统计 1 月之前
  lowkeyman 8c5f959324 椰林 N迎阳km 改成快充 1 月之前
  lowkeyman 43002e06b0 国创分省 广东移动调价 1 月之前
  lowkeyman 970946368c 灿彬分省 四川&湖北 电信配置 1 月之前
  lowkeyman eb01bffc40 新翰晶分省 配置湖北电信 1 月之前
  lowkeyman 909a8eae3d 带票额度统计 调整 1 月之前
共有 54 个文件被更改,包括 1537 次插入48 次删除
  1. 30 1
      admin/templates/default/js/stats-quota.js
  2. 68 14
      admin/templates/default/refill_quota_stats.index.php
  3. 115 9
      data/config/yl/phone.ini.php
  4. 1 0
      helper/fcgisrv/MobileServer.php
  5. 1 0
      helper/fcgisrv/RAccServer.php
  6. 二进制
      helper/refill/api/xyz/guochuang/20250321_yd_guangdong.jpg
  7. 二进制
      helper/refill/api/xyz/guochuang/20250324_yd_guangdong.jpg
  8. 二进制
      helper/refill/api/xyz/guochuang/20250327_yd_guangdong.jpg
  9. 二进制
      helper/refill/api/xyz/guochuang/20250327_yd_guangdong2.jpg
  10. 二进制
      helper/refill/api/xyz/guochuang/20250328_yd_guangdong.png
  11. 二进制
      helper/refill/api/xyz/guochuang/20250401_dx_anhui.jpg
  12. 二进制
      helper/refill/api/xyz/guochuang/20250401_yd_guangdong.jpg
  13. 二进制
      helper/refill/api/xyz/guochuang/20250401_yd_shandong.png
  14. 二进制
      helper/refill/api/xyz/guochuang/202504021_dx_beijing.jpg
  15. 二进制
      helper/refill/api/xyz/guochuang/202504021_dx_beijing2.jpg
  16. 二进制
      helper/refill/api/xyz/guochuang/20250403_lt.jpg
  17. 二进制
      helper/refill/api/xyz/guochuang/20250403_yd_guangdong.jpg
  18. 二进制
      helper/refill/api/xyz/guochuang/20250404_yd_guangdong.jpg
  19. 二进制
      helper/refill/api/xyz/guochuang/20250407_dx_henan.png
  20. 二进制
      helper/refill/api/xyz/guochuang/20250409_yd_guangdong.jpg
  21. 二进制
      helper/refill/api/xyz/guochuang/20250409_yd_guangdong2.jpg
  22. 10 8
      helper/refill/api/xyz/guochuang/config.php
  23. 29 0
      helper/refill/api/yl/benyu_sec/API.MD
  24. 46 0
      helper/refill/api/yl/benyu_sec/RefillCallBack.php
  25. 155 0
      helper/refill/api/yl/benyu_sec/RefillPhone.php
  26. 42 0
      helper/refill/api/yl/benyu_sec/config.php
  27. 二进制
      helper/refill/api/yl/benyu_sec/话费API文档.docx
  28. 25 0
      helper/refill/api/yl/canbin_fs/API.MD
  29. 42 0
      helper/refill/api/yl/canbin_fs/config.php
  30. 二进制
      helper/refill/api/yl/dexin_fs/20250414_price.png
  31. 19 0
      helper/refill/api/yl/dexin_fs/API.MD
  32. 52 0
      helper/refill/api/yl/dexin_fs/RefillCallBack.php
  33. 165 0
      helper/refill/api/yl/dexin_fs/RefillPhone.php
  34. 二进制
      helper/refill/api/yl/dexin_fs/code.xlsx
  35. 164 0
      helper/refill/api/yl/dexin_fs/config.php
  36. 54 0
      helper/refill/api/yl/fengsheng_fs/API.MD
  37. 52 0
      helper/refill/api/yl/fengsheng_fs/RefillCallBack.php
  38. 165 0
      helper/refill/api/yl/fengsheng_fs/RefillPhone.php
  39. 86 0
      helper/refill/api/yl/fengsheng_fs/config.php
  40. 10 8
      helper/refill/api/yl/guochuang/config.php
  41. 26 0
      helper/refill/api/yl/lihui_fs/API.MD
  42. 42 0
      helper/refill/api/yl/lihui_fs/config.php
  43. 1 1
      helper/refill/api/yl/nrui/config.php
  44. 二进制
      helper/refill/api/yl/xinbao_fs/20250320_dx_hb_sc.jpg
  45. 二进制
      helper/refill/api/yl/xinbao_fs/20250403_dx_yunnan.png
  46. 24 1
      helper/refill/api/yl/xinbao_fs/API.MD
  47. 28 0
      helper/refill/api/yl/xinbao_fs/config.php
  48. 24 6
      helper/request_helper.php
  49. 31 0
      mchsrv/control/merchant_order.php
  50. 4 0
      mobile/callback/refill_benyu_sec.php
  51. 4 0
      mobile/callback/refill_dexin_fs.php
  52. 4 0
      mobile/callback/refill_fengsheng_fs.php
  53. 0 0
      mobile/callback/refill_nruiex.php
  54. 18 0
      test/TestRefill.php

+ 30 - 1
admin/templates/default/js/stats-quota.js

@@ -13,7 +13,7 @@ class DataHandler {
             // channel结构: 对应主体(subject), 通道id(store_id), 已开票总金额(total_invoiced), 上次开票日期(last_invoice_date)
             [CONSTANTS.KEY_QUOTA_CHANNEL]: ['sort', 'subject', 'store_id', 'total_invoiced', 'last_invoice_date', 'remark', 'month_opened'],
             //summary结构: 主体(subject)
-            [CONSTANTS.KEY_QUOTA_SUMMARY]: ['sort', 'subject', 'invoice_remaining_amount'],
+            [CONSTANTS.KEY_QUOTA_SUMMARY]: ['sort', 'subject', 'invoice_remaining_amount', 'remaining_tickets', 'invoice_needed_amount', 'ticket_difference', 'adjustment_value'],
             //condition结构: 月份(month)
             [CONSTANTS.KEY_QUOTA_CONDITION]: ['month']
         };
@@ -1222,4 +1222,33 @@ class SummaryComponent extends Component {
 
 function filterSubjectPrefix(str) {
     return str.replace(/^\d+-/, '');
+}
+
+function sortBySubjectContinuity(data) {
+    const groups = {};
+    const ordered = [];
+
+    data.forEach(item => {
+        if (!groups[item.subject]) {
+            groups[item.subject] = [];
+        }
+        groups[item.subject].push(item);
+    });
+
+    const added = new Set();
+
+    data.forEach(item => {
+        if (!added.has(item)) {
+            ordered.push(item);
+            added.add(item);
+            groups[item.subject].forEach(other => {
+                if (!added.has(other)) {
+                    ordered.push(other);
+                    added.add(other);
+                }
+            });
+        }
+    });
+
+    return ordered;
 }

+ 68 - 14
admin/templates/default/refill_quota_stats.index.php

@@ -631,7 +631,7 @@
                     sysMchData = sysData.list;
                 }
 
-                const tableData = deepCloneData(merchantList);
+                let tableData = deepCloneData(merchantList);
                 tableData.forEach(item => {
                     const amountsItem = sysMchData.find(aItem => aItem.mch_id === item.mch_id);
                     if (amountsItem !== undefined) {
@@ -654,6 +654,8 @@
                     });
                 });
 
+                tableData = sortBySubjectContinuity(tableData);
+
                 layui.table.render({
                     elem: '#' + this.tableId,
                     data: tableData,
@@ -927,7 +929,7 @@
 
                 let item = merchantData[index];
                 item.total_invoiced = total_invoiced || "0";
-                item.last_invoice_date = last_invoice_date || "0";
+                item.last_invoice_date = last_invoice_date || "";
                 item.month_opened = month_opened || "0";
                 item.remark = remark;
 
@@ -973,7 +975,7 @@
                     sysChanData = sysData.list;
                 }
 
-                const tableData = deepCloneData(channelList);
+                let tableData = deepCloneData(channelList);
                 tableData.forEach(item => {
                     const amountsItem = sysChanData.find(aItem => aItem.store_id === item.store_id);
                     if (amountsItem !== undefined) {
@@ -996,6 +998,8 @@
                     });
                 });
 
+                tableData = sortBySubjectContinuity(tableData);
+
                 layui.table.render({
                     elem: '#' + this.tableId,
                     data: tableData,
@@ -1256,7 +1260,7 @@
                 let item = channelData[index];
                 item.total_invoiced = total_invoiced || "0";
                 item.month_opened = month_opened || "0";
-                item.last_invoice_date = last_invoice_date || "0";
+                item.last_invoice_date = last_invoice_date || "";
                 item.remark = remark;
 
                 await dataHelper.addOrUpdateData(CONSTANTS.KEY_QUOTA_CHANNEL, item, 2);
@@ -1292,6 +1296,10 @@
 
                 const summaryData = dataHelper.getSummaryList().find(item => item.subject === that.subject);
                 const invoice_remaining_amount = summaryData === undefined || summaryData.invoice_remaining_amount === '' ? '0' : summaryData.invoice_remaining_amount;
+                const remaining_tickets = summaryData === undefined || summaryData.remaining_tickets === '' ? '0' : summaryData.remaining_tickets;
+                const invoice_needed_amount = summaryData === undefined || summaryData.invoice_needed_amount === '' ? '0' : summaryData.invoice_needed_amount;
+                const ticket_difference = summaryData === undefined || summaryData.ticket_difference === '' ? '0' : summaryData.ticket_difference;
+                const adjustment_value = summaryData === undefined || summaryData.adjustment_value === '' ? '0' : summaryData.adjustment_value;
 
                 const receivable_ticket = channelData.reduce((total, item) => {
                     return total + parseFloat(item.total_amounts);
@@ -1305,7 +1313,6 @@
                 const total_issued_tickets = merchantData.reduce((total, item) => {
                     return total + parseFloat(item.total_invoiced);
                 }, 0);
-                const remaining_tickets = total_received_tickets - total_issued_tickets;
                 const pending_tickets = merchantData.reduce((total, item) => {
                     const estimated_invoice_amount = parseFloat(item.estimated_invoice_amount);
                     if (estimated_invoice_amount > 0) {
@@ -1313,12 +1320,7 @@
                     }
                     return total;
                 }, 0);
-                const ticket_difference = remaining_tickets - pending_tickets;
-                const ch_estimated_invoice_amount = channelData.reduce((total, item) => {
-                    return total + parseFloat(item.estimated_invoice_amount);
-                }, 0);
-                let invoice_needed_amount = pending_tickets - ch_estimated_invoice_amount - parseFloat(invoice_remaining_amount);
-                for (const chan of channelData) {
+                for (const chan of channelData) { //合并的单元格属性,合并项的数值保持一致
                     chan.invoice_remaining_amount = formatDecimals(invoice_remaining_amount);
                     chan.invoice_needed_amount = formatDecimals(invoice_needed_amount);
                     chan.receivable_ticket = formatDecimals(receivable_ticket);
@@ -1328,6 +1330,7 @@
                     chan.remaining_tickets = formatDecimals(remaining_tickets);
                     chan.pending_tickets = formatDecimals(pending_tickets);
                     chan.ticket_difference = formatDecimals(ticket_difference);
+                    chan.adjustment_value = formatDecimals(adjustment_value);
                 }
 
                 layui.table.render({
@@ -1340,6 +1343,7 @@
                         {field: 'receivable_ticket', title: '应该收票', width: 200},
                         {field: 'total_invoiced', title: '已开', width: 150},
                         {field: 'total_received_tickets', title: '总计收票', width: 150},
+                        {field: 'adjustment_value', title: '矫正值(含跨年)', width: 150},
                         {field: 'issuable_ticket', title: '应出票', width: 150},
                         {field: 'total_issued_tickets', title: '总计出票', width: 150},
                         {field: 'remaining_tickets', title: '剩余票', width: 150},
@@ -1357,6 +1361,36 @@
                 });
             }
 
+            calcTicketDifference() {
+                const tbRoot = $('#' + this.tableId);
+                const trs = tbRoot.next('.layui-table-view').find('.layui-table-body tbody tr');
+                trs.each(function(i, tr) {
+                    const pending_tickets = $(tr).find('td[data-field="pending_tickets"]').not('.layui-hide').find('.layui-table-cell').text().trim();
+                    const remaining_tickets = $(tr).find('td[data-field="remaining_tickets"]').not('.layui-hide').find('.layui-table-cell').text().trim();
+
+                    const $ticketDifferenceEl = $(tr).find('td[data-field="ticket_difference"]').not('.layui-hide').find('.layui-table-cell');
+                    if ($ticketDifferenceEl.length > 0) {
+                        const ticket_difference = parseFloat(remaining_tickets) - parseFloat(pending_tickets);
+                        $ticketDifferenceEl.html(formatDecimals(ticket_difference));
+                    }
+                });
+            }
+
+            calcInvoiceNeededAmount() {
+                const tbRoot = $('#' + this.tableId);
+                const trs = tbRoot.next('.layui-table-view').find('.layui-table-body tbody tr');
+                trs.each(function(i, tr) {
+                    const pending_tickets = $(tr).find('td[data-field="pending_tickets"]').not('.layui-hide').find('.layui-table-cell').text().trim();
+                    const invoice_remaining_amount = $(tr).find('td[data-field="invoice_remaining_amount"]').not('.layui-hide').find('.layui-table-cell').text().trim();
+
+                    const $invoiceNeededAmountEl = $(tr).find('td[data-field="invoice_needed_amount"]').not('.layui-hide').find('.layui-table-cell');
+                    if ($invoiceNeededAmountEl.length > 0) {
+                        const invoice_needed_amount = parseFloat(invoice_remaining_amount) - parseFloat(pending_tickets);
+                        $invoiceNeededAmountEl.html(formatDecimals(invoice_needed_amount));
+                    }
+                });
+            }
+
             updateTable() {
                 this.setValueClass(['total_amounts', 'receivable_ticket', 'total_invoiced', 'total_received_tickets', 'issuable_ticket', 'total_issued_tickets', 'remaining_tickets', 'pending_tickets', 'ticket_difference', 'invoice_needed_amount']);
             }
@@ -1365,7 +1399,7 @@
                 const tbRoot = $('#' + this.tableId);
                 const trs = tbRoot.next('.layui-table-view').find('.layui-table-body tbody tr');
 
-                const mergeColumns = ['receivable_ticket', 'total_received_tickets', 'issuable_ticket', 'total_issued_tickets', 'remaining_tickets', 'pending_tickets', 'ticket_difference', 'invoice_remaining_amount', 'invoice_needed_amount'];
+                const mergeColumns = ['receivable_ticket', 'total_received_tickets', 'issuable_ticket', 'total_issued_tickets', 'remaining_tickets', 'pending_tickets', 'ticket_difference', 'invoice_remaining_amount', 'adjustment_value', 'invoice_needed_amount'];
                 for (let col of mergeColumns) {
                     trs.eq(0).find('td[data-field="' + col + '"]').attr('rowspan', this.lines);
                     for (let j = 1; j < this.lines; j++) {
@@ -1379,7 +1413,7 @@
                 const tbRoot = $('#' + this.tableId);
                 const trs = tbRoot.next('.layui-table-view').find('.layui-table-body tbody tr');
                 trs.each(function (i, tr) {
-                    const editNumberColumns = ['invoice_remaining_amount'];
+                    const editNumberColumns = ['remaining_tickets', 'ticket_difference', 'invoice_remaining_amount', 'adjustment_value', 'invoice_needed_amount'];
 
                     for (let col of editNumberColumns) {
                         const td = $(tr).find('td[data-field="' + col + '"]').not('.layui-hide');
@@ -1402,6 +1436,14 @@
                                 }
                                 val = normalizeAmount(val);//过滤,比如前导 0
                                 valDiv.html(formatDecimals(val));
+                                
+                                if (col === 'invoice_remaining_amount') {
+                                    that.calcInvoiceNeededAmount();
+                                }
+
+                                if (col === 'remaining_tickets') {
+                                    that.calcTicketDifference();
+                                }
 
                                 const index = $(this).parent().parent().data('index');
                                 await that.saveEdit(index);
@@ -1421,16 +1463,28 @@
 
                 const tr = $('#' + this.tableId).next('.layui-table-view').find('.layui-table-body tbody tr[data-index="' + index + '"]');
                 const invoice_remaining_amount = tr.find('td[data-field="invoice_remaining_amount"]').find('div').not('.layui-hide').text().trim();
+                const remaining_tickets = tr.find('td[data-field="remaining_tickets"]').find('div').not('.layui-hide').text().trim();
+                const invoice_needed_amount = tr.find('td[data-field="invoice_needed_amount"]').find('div').not('.layui-hide').text().trim();
+                const ticket_difference = tr.find('td[data-field="ticket_difference"]').find('div').not('.layui-hide').text().trim();
+                const adjustment_value = tr.find('td[data-field="adjustment_value"]').find('div').not('.layui-hide').text().trim();
 
                 let item = dataHelper.getSummaryList().find(item => item.subject === this.subject);
                 if (item === undefined) {
                     item = {
                         sort: 0,
                         subject: this.subject,
-                        invoice_remaining_amount: invoice_remaining_amount
+                        invoice_remaining_amount: invoice_remaining_amount,
+                        remaining_tickets: remaining_tickets,
+                        invoice_needed_amount: invoice_needed_amount,
+                        ticket_difference: ticket_difference,
+                        adjustment_value: adjustment_value
                     };
                 } else {
                     item.invoice_remaining_amount = invoice_remaining_amount;
+                    item.remaining_tickets = remaining_tickets;
+                    item.invoice_needed_amount = invoice_needed_amount;
+                    item.ticket_difference = ticket_difference;
+                    item.adjustment_value = adjustment_value;
                 }
 
                 await dataHelper.addOrUpdateData(CONSTANTS.KEY_QUOTA_SUMMARY, item, 1);

+ 115 - 9
data/config/yl/phone.ini.php

@@ -3198,31 +3198,31 @@ $nruifeng_jd_phone = [
     ]
 ];
 $nyingyang_km_phone = [
-    'name' => 'nyingyang_km', 'store_id' => 376, 'qualitys' => '1', 'official_sn' => true, 'refill_type' => 'api',
+    'name' => 'nyingyang_km', 'store_id' => 376, 'qualitys' => '2', 'official_sn' => true, 'refill_type' => 'api',
     'amount' => [
 //        10 => [
-//            ['goods_id' => 9026, 'price' => 10, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 9026, 'price' => 10, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //        ],
 //        20 => [
-//            ['goods_id' => 9027, 'price' => 20, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 9027, 'price' => 20, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //        ],
 //        30 => [
-//            ['goods_id' => 9028, 'price' => 30, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 9028, 'price' => 30, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //        ],
         50 => [
-            ['goods_id' => 9029, 'price' => 49.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 9029, 'price' => 49.25, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         100 => [
-            ['goods_id' => 9030, 'price' => 98.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 9030, 'price' => 98.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         200 => [
-            ['goods_id' => 9031, 'price' => 197, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 9031, 'price' => 197, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
 //        300 => [
-//            ['goods_id' => 9032, 'price' => 300, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 9032, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //        ],
 //        500 => [
-//            ['goods_id' => 9033, 'price' => 500, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 9033, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //        ]
     ]
 ];
@@ -3255,6 +3255,109 @@ $xinguande_sec_phone = [
 //        ]
     ]
 ];
+$fengsheng_fs_phone = [
+    'name' => 'fengsheng_fs', 'store_id' => 378, 'qualitys' => '1', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 9042, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9042, 'price' => 10, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 9043, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9043, 'price' => 20, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 9044, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9044, 'price' => 30, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 9045, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9045, 'price' => 47.1, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 9046, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9046, 'price' => 94.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 9047, 'price' => 189, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9047, 'price' => 188.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 9048, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9048, 'price' => 300, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 9049, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9049, 'price' => 500, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ]
+];
+$benyu_sec_phone = [
+    'name' => 'benyu_sec', 'store_id' => 379, 'qualitys' => '1', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 9050, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//        ],
+//        20 => [
+//            ['goods_id' => 9051, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//        ],
+//        30 => [
+//            ['goods_id' => 9052, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+//        ],
+        50 => [
+            ['goods_id' => 9053, 'price' => 48.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
+        100 => [
+            ['goods_id' => 9054, 'price' => 97, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
+        200 => [
+            ['goods_id' => 9055, 'price' => 194, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
+//        300 => [
+//            ['goods_id' => 9056, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//        ],
+//        500 => [
+//            ['goods_id' => 9057, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//        ]
+    ]
+];
+$dexin_fs_phone = [
+    'name' => 'dexin_fs', 'store_id' => 380, 'qualitys' => '1', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 9058, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9058, 'price' => 10, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 9059, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9059, 'price' => 20, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 9060, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9060, 'price' => 30, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 9061, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9061, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 9062, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9062, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 9063, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9063, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 9064, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9064, 'price' => 300, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 9065, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9065, 'price' => 500, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ]
+];
 
 $phone_providers = [
 	[ 'name' => 'zhongst', 'cfg' => $zhongst_phone ],
@@ -3357,4 +3460,7 @@ $phone_providers = [
     [ 'name' => 'nruifeng_jd', 'cfg' => $nruifeng_jd_phone ],
     [ 'name' => 'nyingyang_km', 'cfg' => $nyingyang_km_phone ],
     [ 'name' => 'xinguande_sec', 'cfg' => $xinguande_sec_phone ],
+    [ 'name' => 'fengsheng_fs', 'cfg' => $fengsheng_fs_phone ],
+    [ 'name' => 'benyu_sec', 'cfg' => $benyu_sec_phone ],
+    [ 'name' => 'dexin_fs', 'cfg' => $dexin_fs_phone ],
 	];

+ 1 - 0
helper/fcgisrv/MobileServer.php

@@ -85,6 +85,7 @@ class MobileServer extends BaseServer
                     Base::mobile_control();
                 }
                 elseif ($this->is_exclude($file)) {
+                    Log::record("call-file = $file", Log::DEBUG);
                     include $file;
                 }
                 else {

+ 1 - 0
helper/fcgisrv/RAccServer.php

@@ -76,6 +76,7 @@ class RAccServer extends BaseServer
                 if ($this->isIndex($file)) {
                     Base::mobile_control();
                 } elseif ($this->is_exclude($file)) {
+                    Log::record("call-file = $file", Log::DEBUG);
                     include $file;
                 } else {
                     echo "You cannot access this file.";

二进制
helper/refill/api/xyz/guochuang/20250321_yd_guangdong.jpg


二进制
helper/refill/api/xyz/guochuang/20250324_yd_guangdong.jpg


二进制
helper/refill/api/xyz/guochuang/20250327_yd_guangdong.jpg


二进制
helper/refill/api/xyz/guochuang/20250327_yd_guangdong2.jpg


二进制
helper/refill/api/xyz/guochuang/20250328_yd_guangdong.png


二进制
helper/refill/api/xyz/guochuang/20250401_dx_anhui.jpg


二进制
helper/refill/api/xyz/guochuang/20250401_yd_guangdong.jpg


二进制
helper/refill/api/xyz/guochuang/20250401_yd_shandong.png


二进制
helper/refill/api/xyz/guochuang/202504021_dx_beijing.jpg


二进制
helper/refill/api/xyz/guochuang/202504021_dx_beijing2.jpg


二进制
helper/refill/api/xyz/guochuang/20250403_lt.jpg


二进制
helper/refill/api/xyz/guochuang/20250403_yd_guangdong.jpg


二进制
helper/refill/api/xyz/guochuang/20250404_yd_guangdong.jpg


二进制
helper/refill/api/xyz/guochuang/20250407_dx_henan.png


二进制
helper/refill/api/xyz/guochuang/20250409_yd_guangdong.jpg


二进制
helper/refill/api/xyz/guochuang/20250409_yd_guangdong2.jpg


+ 10 - 8
helper/refill/api/xyz/guochuang/config.php

@@ -72,11 +72,11 @@ class config
         "4-10-13" => 9.965, "4-20-13" => 19.93, "4-30-13" => 29.895, "4-50-13" => 49.825, "4-100-13" => 99.65, "4-200-13" => 199.3, "4-300-13" => 298.95, "4-500-13" => 498.25,//福建 13
         "4-10-5" => 10.26, "4-20-5" => 20.52, "4-30-5" => 30.78, "4-50-5" => 50.8, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
-        "4-10-19" => 10.37, "4-20-19" => 20.74, "4-30-19" => 31.11, "4-50-19" => 50.55, "4-100-19" => 101.1, "4-200-19" => 202.2, "4-300-19" => 303.3, "4-500-19" => 505.5,//广东 19
+        "4-10-19" => 10.37, "4-20-19" => 20.74, "4-30-19" => 31.11, "4-50-19" => 50.5, "4-100-19" => 101, "4-200-19" => 202, "4-300-19" => 303, "4-500-19" => 505,//广东 19
         "4-10-7" => 9.93, "4-20-7" => 19.86, "4-30-7" => 29.52, "4-50-7" => 49.2, "4-100-7" => 98.4, "4-200-7" => 196.8, "4-300-7" => 295.2, "4-500-7" => 492,//吉林 7
         "4-10-1" => 10.31, "4-20-1" => 20.32, "4-30-1" => 30.33, "4-50-1" => 50.6, "4-100-1" => 100.4, "4-200-1" => 200.3, "4-300-1" => 300.45, "4-500-1" => 500.75,//北京 1
         "4-10-22" => 10.015, "4-20-22" => 20.03, "4-30-22" => 30.045, "4-50-22" => 50.075, "4-100-22" => 100.15, "4-200-22" => 200.3, "4-300-22" => 300.45, "4-500-22" => 500.75,//重庆 22
-        "4-1-15" => 1.04, "4-2-15" => 2.08, "4-3-15" => 3.12, "4-4-15" => 4.16, "4-5-15" => 5.61, "4-6-15" => 6.24, "4-7-15" => 7.28, "4-8-15" => 8.32, "4-9-15" => 9.36, "4-10-15" => 10.62, "4-20-15" => 20.64, "4-30-15" => 30.66, "4-50-15" => 50.7, "4-100-15" => 99.3, "4-200-15" => 198.6, "4-300-15" => 297.9,//山东 15
+        "4-1-15" => 1.04, "4-2-15" => 2.08, "4-3-15" => 3.12, "4-4-15" => 4.16, "4-5-15" => 5.61, "4-6-15" => 6.24, "4-7-15" => 7.28, "4-8-15" => 8.32, "4-9-15" => 9.36, "4-10-15" => 10.33, "4-20-15" => 20.56, "4-30-15" => 30.66, "4-50-15" => 50.7, "4-100-15" => 99.3, "4-200-15" => 198.6, "4-300-15" => 297.9,//山东 15
         "4-10-10" => 9.945, "4-20-10" => 19.89, "4-30-10" => 30.18, "4-50-10" => 50.4, "4-100-10" => 100.48, "4-200-10" => 200.56, "4-300-10" => 300.84, "4-500-10" => 501.4,//江苏 10
         "4-10-11" => 9.945, "4-20-11" => 19.89, "4-30-11" => 29.835, "4-50-11" => 49.725, "4-100-11" => 99.45, "4-200-11" => 198.9, "4-300-11" => 298.35, "4-500-11" => 497.25,//浙江 11
         "4-10-17" => 9.945, "4-20-17" => 19.89, "4-30-17" => 29.835, "4-50-17" => 49.725, "4-100-17" => 99.45, "4-200-17" => 198.9, "4-300-17" => 298.35, "4-500-17" => 497.25,//湖北 17
@@ -94,20 +94,22 @@ class config
         "5-10-19" => 10.04, "5-20-19" => 20.08, "5-30-19" => 30.06, "5-50-19" => 50.1, "5-100-19" => 100.2, "5-200-19" => 200.4, "5-300-19" => 300.6, "5-500-19" => 501,//广东 19
         "5-10-1" => 9.99, "5-20-1" => 19.98, "5-30-1" => 29.97, "5-50-1" => 49.95, "5-100-1" => 99.9, "5-200-1" => 199.8, "5-300-1" => 299.7, "5-500-1" => 499.5,//北京 1
         "5-10-22" => 10.04, "5-20-22" => 20.08, "5-30-22" => 30.12, "5-50-22" => 50.2, "5-100-22" => 100.4, "5-200-22" => 200.8, "5-300-22" => 301.2, "5-500-22" => 502,//重庆 22
-        "5-10-14" => 10.03, "5-20-14" => 20.06, "5-30-14" => 30.09, "5-50-14" => 50.1, "5-100-14" => 100.2, "5-200-14" => 200.4, "5-300-14" => 300.6, "5-500-14" => 501,//江西 14
-        "5-20-23" => 20.08, "5-30-23" => 30.12, "5-50-23" => 50.2, "5-100-23" => 100.4, "5-200-23" => 200.8, "5-300-23" => 301.2, "5-500-23" => 502,//四川 23
-        "5-10-31" => 10.22, "5-20-31" => 20.22, "5-30-31" => 30.24, "5-50-31" => 50.25, "5-100-31" => 100.3, "5-200-31" => 200.4, "5-300-31" => 300.6, "5-500-31" => 501,//新疆 31
+        "5-10-14" => 10.15, "5-20-14" => 20.3, "5-30-14" => 30.45, "5-50-14" => 50.2, "5-100-14" => 100.4, "5-200-14" => 200.8, "5-300-14" => 301.2, "5-500-14" => 502,//江西 14
+        "5-10-23" => 10.11, "5-20-23" => 20.22, "5-30-23" => 30.33, "5-50-23" => 50.2, "5-100-23" => 100.4, "5-200-23" => 200.8, "5-300-23" => 301.2, "5-500-23" => 502,//四川 23
+        "5-10-31" => 10.17, "5-20-31" => 20.19, "5-30-31" => 30.24, "5-50-31" => 50.25, "5-100-31" => 100.3, "5-200-31" => 200.4, "5-300-31" => 300.6, "5-500-31" => 501,//新疆 31
+        "5-10-20" => 10.13, "5-20-20" => 20.14, "5-30-20" => 30.18,//广西 20
+
         //电信
         "6-10-27" => 10.12, "6-20-27" => 20.24, "6-30-27" => 30.36, "6-50-27" => 50.1, "6-100-27" => 100.2, "6-200-27" => 199.94, "6-300-27" => 299.91, "6-500-27" => 501,//陕西 27
         "6-10-4" => 10.37, "6-20-4" => 20.39, "6-30-4" => 30.42, "6-50-4" => 50.45, "6-100-4" => 100.6, "6-200-4" => 201.2, "6-300-4" => 301.8, "6-500-4" => 503,//山西 4
         "6-10-18" => 10.09, "6-20-18" => 20.1, "6-30-18" => 30.12, "6-50-18" => 50.1, "6-100-18" => 100.2, "6-200-18" => 200.3, "6-300-18" => 300.45, "6-500-18" => 500.75,//湖南 18
         "6-10-15" => 10.37, "6-20-15" => 20.38, "6-30-15" => 30.42, "6-50-15" => 50.8, "6-100-15" => 101, "6-200-15" => 200.4, "6-300-15" => 300.6, "6-500-15" => 501,//山东 15
-        "6-10-12" => 10.2, "6-20-12" => 20.24, "6-30-12" => 30.21, "6-50-12" => 50.4, "6-100-12" => 100.7, "6-200-12" => 200.6, "6-300-12" => 300.9, "6-500-12" => 501.5,//安徽 12
+        "6-10-12" => 10.2, "6-20-12" => 20.24, "6-30-12" => 30.21, "6-50-12" => 50.4, "6-100-12" => 100.8, "6-200-12" => 201.2, "6-300-12" => 300.9, "6-500-12" => 501.5,//安徽 12
         "6-10-2" => 10.12, "6-20-2" => 20.16, "6-30-2" => 30.21, "6-50-2" => 50.2, "6-100-2" => 100.4, "6-200-2" => 200.8, "6-300-2" => 301.2, "6-500-2" => 502,//天津 2
         "6-10-20" => 10.15, "6-20-20" => 20.18, "6-30-20" => 30.21, "6-50-20" => 50.3, "6-100-20" => 100.45, "6-200-20" => 200.6, "6-300-20" => 300.9, "6-500-20" => 501.5,//广西 20
         "6-10-29" => 10.13, "6-20-29" => 20.14, "6-30-29" => 30.18, "6-50-29" => 50.25, "6-100-29" => 100.35, "6-200-29" => 200.6, "6-300-29" => 300.9, "6-500-29" => 501.5,//青海 29
-        "6-100-1" => 100.2, "6-200-1" => 200.2, "6-300-1" => 300.3, "6-500-1" => 500.5,//北京 1
-        "6-10-16" => 10.13, "6-20-16" => 20.24, "6-30-16" => 30.36, "6-50-16" => 50.3, "6-100-16" => 100.4, "6-200-16" => 200.8, "6-300-16" => 301.2, "6-500-16" => 502,//河南 16
+        "6-10-1" => 10.3,  "6-20-1" => 20.34,  "6-30-1" => 30.36,  "6-50-1" => 50.45, "6-100-1" => 100.55, "6-200-1" => 200.9, "6-300-1" => 300.3, "6-500-1" => 500.5,//北京 1
+        "6-10-16" => 10.13, "6-20-16" => 20.24, "6-30-16" => 30.36, "6-50-16" => 50.25, "6-100-16" => 100.4, "6-200-16" => 200.8, "6-300-16" => 301.2, "6-500-16" => 502,//河南 16
         "6-10-13" => 10.17, "6-20-13" => 20.16, "6-30-13" => 30.18, "6-50-13" => 50.3, "6-100-13" => 100.55, "6-200-13" => 200.8, "6-300-13" => 301.2, "6-500-13" => 502,//福建 13
         "6-10-6" => 10.21, "6-20-6" => 20.24, "6-30-6" => 30.27, "6-50-6" => 50.2, "6-100-6" => 100.4, "6-200-6" => 200.8, "6-300-6" => 301.2, "6-500-6" => 502,//辽宁 6
         "6-10-17" => 10.23, "6-20-17" => 20.46, "6-30-17" => 30.69, "6-50-17" => 51.1,//湖北 17

+ 29 - 0
helper/refill/api/yl/benyu_sec/API.MD

@@ -0,0 +1,29 @@
+
+## 本宇高价2号
+
+### 账号信息
+- 后台登录地址:http://8.137.108.195/flow-consumer/login.html
+- 登录名:bygc
+- 初始密码:bygc1231
+
+### 接口信息
+- 密钥:c36920214280408aa7f7bbe4d4d81d82
+
+## 接口地址
+- 下单地址:http://8.137.108.195/flow-receiver/api/recharge/feecbk
+- 查询地址:http://8.137.108.195/flow-receiver/api/query/feecbk
+- 余额查询地址:http://8.137.108.195/flow-receiver/api/balance/feecbk
+
+## 店铺账号
+- 账号:benyu_sec
+- 密码:benyu_sec67890
+
+请务必绑定我们回调IP:8.137.108.195
+
+## 产品编码
+```angular2html
+移动
+50 CMCCALLn50r 折扣97
+100 CMCCALLn100r 折扣97
+200 CMCCALLn200r 折扣97
+```

+ 46 - 0
helper/refill/api/yl/benyu_sec/RefillCallBack.php

@@ -0,0 +1,46 @@
+<?php
+namespace refill\benyu_sec;
+require_once(BASE_HELPER_RAPI_PATH . '/benyu_sec/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $signature = [config::KEY, $params['timestamp'], config::ACCOUNT];
+        sort($signature, SORT_STRING);
+        $signature = implode($signature);
+        return sha1($signature);
+    }
+
+    public function notify($params)
+    {
+        $status = $params['status'];
+        $order_sn = $params['consumerNo'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === '001') {
+            $data['official_sn'] = strtolower($params['voucherNo']) == 'null' ? '' : $params['voucherNo'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true];
+        } elseif (in_array($status,config::NotifyErrCodes, true)) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
+}

+ 155 - 0
helper/refill/api/yl/benyu_sec/RefillPhone.php

@@ -0,0 +1,155 @@
+<?php
+
+namespace refill\benyu_sec;
+
+require_once(BASE_HELPER_RAPI_PATH . '/benyu_sec/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $card_type, string $order_sn)
+    {
+        $params['account'] = config::ACCOUNT;
+        $params['consumerNo'] = $order_sn;
+        $params['mobile'] = $phone;
+        $params['ispCode'] = config::operator[$card_type];
+        $params['cbkUrl'] = config::NOTIFY_URL;
+        $params['timestamp'] = $this->get_millisecond();
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $params = $this->req_params($card_no, $card_type, $params['order_sn']);
+        $params['flowCode'] = config::ProductIDS[$card_type][$amount];
+        if (empty($params['flowCode'])) {
+            return [false, '产品编号错误', false];
+        }
+
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'GET', false, [], $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp ,true);
+
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['status'] === '001') {
+                return [true, $resp['orderNo'], false];
+            } else {
+                return [false, $resp['status'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['account'] = config::ACCOUNT;
+        $params['consumerNo'] = $refill_info['order_sn'];
+        $params['timestamp'] = $this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::QUERY_URL, $params);
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+
+            $status = $resp['status'];
+            if ($status === '001')
+            {
+                $order_state = ORDER_STATE_SUCCESS;
+                $save['official_sn'] = strtolower($resp['voucherNo']) == 'null' ? '' : $resp['voucherNo'];
+                Model('refill_order')->edit($refill_info['order_id'], $save);
+            }
+            elseif (in_array($status,config::QueryErrCodes, true))
+            {
+                if ($status === '026')
+                {
+                    //订单不存在状态,三小时内查询可失败,超过则返回充值中.不可以在下单后的同时立马发起查询,否则返回该状态处理为充值中,至少隔30秒以上再发起查询
+                    $commit_secs = time() - $refill_info['commit_time'];
+                    if ($commit_secs > 0 && $commit_secs <= 180) {
+                        return [false, '时长不足'];
+                    } elseif ($commit_secs > 180 && $commit_secs <= 10800) {
+                        $order_state = ORDER_STATE_NOEXIST;
+                    } else {
+                        $order_state = ORDER_STATE_SEND;
+                    }
+                }
+                else {
+                    $order_state = ORDER_STATE_CANCEL;
+                }
+            }
+            elseif ($status === '002') {
+                $order_state = ORDER_STATE_SEND;
+            }
+            else {
+                return [false, $status];
+            }
+
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['account'] = config::ACCOUNT;
+        $params['timestamp'] = $this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::BALANCE_URL, $params);
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['status'] === 'success') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['descriptor']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $signature = [config::KEY, $params['timestamp'], config::ACCOUNT];
+        sort($signature, SORT_STRING);
+        $signature = implode($signature);
+        return sha1($signature);
+    }
+
+    /**
+     * 获取毫秒级别的时间戳
+     */
+    private function get_millisecond()
+    {
+        $cur = microtime (true);
+        return intval($cur * 1000);
+    }
+}

+ 42 - 0
helper/refill/api/yl/benyu_sec/config.php

@@ -0,0 +1,42 @@
+<?php
+
+
+namespace refill\benyu_sec;
+use mtopcard;
+
+class config
+{
+    const ORDER_URL = 'http://8.137.108.195/flow-receiver/api/recharge/feecbk';
+    const QUERY_URL = 'http://8.137.108.195/flow-receiver/api/query/feecbk';
+    const BALANCE_URL = 'http://8.137.108.195/flow-receiver/api/balance/feecbk';
+    const NOTIFY_URL = BASE_SITE_URL . '/mobile/callback/refill_benyu_sec.php';
+
+    const ACCOUNT = 'bygc';
+    const KEY = 'c36920214280408aa7f7bbe4d4d81d82';
+    const operator = [
+        mtopcard\ChinaMobileCard  => 'CMCC',
+        mtopcard\ChinaUnicomCard  => 'CUCC',
+        mtopcard\ChinaTelecomCard => 'CTCC'
+    ];
+    const ProductIDS = [
+        mtopcard\ChinaMobileCard => [
+            50 => 'CMCCALLn50r',
+            100 => 'CMCCALLn100r',
+            200 => 'CMCCALLn200r'
+        ],
+        mtopcard\ChinaUnicomCard => [
+
+        ],
+        mtopcard\ChinaTelecomCard => [
+
+        ],
+    ];
+
+    const NotifyErrCodes = [
+        '003','004','005','006','007','008','015','016','017','018','019','020','021','022','023','025','027','028','098','099'
+    ];
+
+    const QueryErrCodes = [
+        '003','004','005','006','007','008','015','016','017','018','019','020','021','022','023','024','025','026','027','028','098','099'
+    ];
+}

二进制
helper/refill/api/yl/benyu_sec/话费API文档.docx


+ 25 - 0
helper/refill/api/yl/canbin_fs/API.MD

@@ -69,4 +69,29 @@
 福建电信50元     3350050  折扣95
 福建电信100元    3350100  折扣95
 福建电信200元    3350200  折扣95
+
+四川电信50元     编码 3510050   折扣95
+四川电信100元    编码 3510100  折扣95
+四川电信200元    编码 3510200   折扣95
+
+湖北电信50元    编码 3420050   折扣95
+湖北电信100元   编码 3420100   折扣95
+湖北电信200元   编码 3420200   折扣95
+
+广西电信200元    3450200
+广西电信100元    3450100
+广西电信50元    3450050
+
+云南电信200元    3530200
+云南电信100元    3530100
+云南电信50元    3530050
+
+江苏电信50-200  折扣95
+江苏电信200元    3320200
+江苏电信100元    3320100
+江苏电信50元    3320050
+
+山东电信50元    3370050    折扣95
+山东电信100元    3370100   折扣95
+山东电信200元    3370200   折扣95
 ```

+ 42 - 0
helper/refill/api/yl/canbin_fs/config.php

@@ -105,6 +105,42 @@ class config
                 100 => 3350100,
                 200 => 3350200,
             ],
+            //四川
+            23 => [
+                50  => 3510050,
+                100 => 3510100,
+                200 => 3510200,
+            ],
+            //湖北
+            17 => [
+                50  => 3420050,
+                100 => 3420100,
+                200 => 3420200,
+            ],
+            //广西
+            20 => [
+                50  => 3450050,
+                100 => 3450100,
+                200 => 3450200,
+            ],
+            //云南
+            25 => [
+                50  => 3530050,
+                100 => 3530100,
+                200 => 3530200,
+            ],
+            //江苏
+            10 => [
+                50  => 3320050,
+                100 => 3320100,
+                200 => 3320200,
+            ],
+            //山东
+            15 => [
+                50  => 3370050,
+                100 => 3370100,
+                200 => 3370200,
+            ],
         ]
     ];
 
@@ -125,5 +161,11 @@ class config
         "6-50-2" => 47.5, "6-100-2" => 95, "6-200-2" => 190, //天津
         "6-50-14" => 47.5, "6-100-14" => 95, "6-200-14" => 190, //江西
         "6-50-13" => 47.5, "6-100-13" => 95, "6-200-13" => 190, //福建
+        "6-50-23" => 47.5, "6-100-23" => 95, "6-200-23" => 190, //四川
+        "6-50-17" => 47.5, "6-100-17" => 95, "6-200-17" => 190, //湖北
+        "6-50-20" => 47.5, "6-100-20" => 95, "6-200-20" => 190, //广西
+        "6-50-25" => 47.5, "6-100-25" => 95, "6-200-25" => 190, //云南
+        "6-50-10" => 47.5, "6-100-10" => 95, "6-200-10" => 190, //江苏
+        "6-50-15" => 47.5, "6-100-15" => 95, "6-200-15" => 190, //山东
     ];
 }

二进制
helper/refill/api/yl/dexin_fs/20250414_price.png


+ 19 - 0
helper/refill/api/yl/dexin_fs/API.MD

@@ -0,0 +1,19 @@
+## 德欣分省
+
+### 正式环境:
+- 话费下单地址:http://8.136.129.136:10181/plat/api/hf/submitorder
+- 查询地址:http://8.136.129.136:10181/plat/api/queryorder
+- 查询余额地址:http://8.136.129.136:10181/plat/api/querybalance
+
+- 客户端地址:http://8.136.129.136:10181/plat/login
+- 账号:xj-fs
+- 密码:123456
+- 客户ID:200078
+- 密钥:dac29f95c5e644fa808eddce5989ec80
+
+### 对接文档地址:
+> https://docs.qq.com/doc/DWEhQWEhDVEJIdUVC
+
+### 店铺账号
+- dexin_fs
+- dexin_fs67890

+ 52 - 0
helper/refill/api/yl/dexin_fs/RefillCallBack.php

@@ -0,0 +1,52 @@
+<?php
+namespace refill\dexin_fs;
+
+require_once(BASE_HELPER_RAPI_PATH . '/dexin_fs/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false, false, ''];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 2) {
+            $official_sn = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 165 - 0
helper/refill/api/yl/dexin_fs/RefillPhone.php

@@ -0,0 +1,165 @@
+<?php
+
+namespace refill\dexin_fs;
+
+require_once(BASE_HELPER_RAPI_PATH . '/dexin_fs/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function goods($quality,int $amount,int $card_type,$regin_no,$other)
+    {
+        [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$regin_no,$other);
+        if($goods_id <= 0) return [0,0];
+        $key = "{$card_type}-{$amount}-{$regin_no}";
+        $price = config::Price[$key];
+        if(empty($price)) {
+            Log::record("channel cannot find price where name={$this->mName}, goods_id = {$goods_id} card_type={$card_type} amount={$amount} regin_no={$regin_no}",Log::ERR);
+            return [0,0];
+        } else {
+            return [$goods_id,ncPriceFormat($price)];
+        }
+    }
+
+    private function req_params(int $phone, int $amount, int $card_type, string $order_sn, string $regin_no)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['szProductId'] = config::Product[$card_type][$regin_no][$amount];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $regin_no = $params['regin_no'] ?? -1;
+
+        if($regin_no <= 0) {
+            return [false, '省份获取错误', false];
+        }
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn, $regin_no);
+
+        $sign = $this->sign($params);
+        $params['szVerifyString'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+
+            $nRtn = $resp['nRtn'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误', ''];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误', ''];
+            }
+
+            $official_sn = '';
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $official_sn = $resp['szRtnMsg'];
+
+                $updata['official_sn'] = $official_sn;
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] > 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg'], ''];
+            }
+
+            return [true, $order_state, $official_sn];
+        }
+    }
+
+    public function balance()
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
+            } else {
+                return [false, $resp['szRtnCode']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
+        return md5($content);
+    }
+}

二进制
helper/refill/api/yl/dexin_fs/code.xlsx


+ 164 - 0
helper/refill/api/yl/dexin_fs/config.php

@@ -0,0 +1,164 @@
+<?php
+
+
+namespace refill\dexin_fs;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://8.136.129.136:10181/plat/api/hf/submitorder';
+    const QUERY_URL= 'http://8.136.129.136:10181/plat/api/queryorder';
+    const BALANCE_URL = 'http://8.136.129.136:10181/plat/api/querybalance';
+
+    const USER_ID= '200078';
+    const KEY = 'dac29f95c5e644fa808eddce5989ec80';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_dexin_fs.php";
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
+
+    const Product = [
+        mtopcard\ChinaMobileCard => [
+            //宁夏
+            30 => [
+                50  => 1640050,
+                100 => 1640100,
+                200 => 1640200,
+            ],
+            //青海
+            29 => [
+                50  => 1630050,
+                100 => 1630100,
+                200 => 1630200,
+            ],
+            //陕西
+            27 => [
+                50  => 1610050,
+                100 => 1610100,
+                200 => 1610200,
+            ],
+            //福建
+            13 => [
+                50  => 1350050,
+                100 => 1350100,
+                200 => 1350200,
+            ],
+            //江苏
+            10 => [
+                50  => 1320050,
+                100 => 1320100,
+                200 => 1320200,
+            ],
+
+        ],
+        mtopcard\ChinaUnicomCard => [
+
+        ],
+        mtopcard\ChinaTelecomCard => [
+            //甘肃
+            28 => [
+                50  => 3620050,
+                100 => 3620100,
+                200 => 3620200,
+            ],
+            //云南
+            25 => [
+                50  => 3530050,
+                100 => 3530100,
+                200 => 3530200,
+            ],
+            //四川
+            23 => [
+                50  => 3510050,
+                100 => 3510100,
+                200 => 3510200,
+            ],
+            //海南
+            21 => [
+                50  => 3460050,
+                100 => 3460100,
+                200 => 3460200,
+            ],
+            //广西
+            20 => [
+                50  => 3450050,
+                100 => 3450100,
+                200 => 3450200,
+            ],
+            //广东
+            19 => [
+                50  => 3440050,
+                100 => 3440100,
+                200 => 3440200,
+            ],
+            //湖北
+            17 => [
+                50  => 3420050,
+                100 => 3420100,
+                200 => 3420200,
+            ],
+            //山东
+            15 => [
+                50  => 3370050,
+                100 => 3370100,
+                200 => 3370200,
+            ],
+            //江西
+            14 => [
+                50  => 3360050,
+                100 => 3360100,
+                200 => 3360200,
+            ],
+            //福建
+            13 => [
+                50  => 3350050,
+                100 => 3350100,
+                200 => 3350200,
+            ],
+            //江苏
+            10 => [
+                50  => 3320050,
+                100 => 3320100,
+                200 => 3320200,
+            ],
+            //天津
+            2 => [
+                50  => 3120050,
+                100 => 3120100,
+                200 => 3120200,
+            ],
+        ]
+    ];
+
+    //key格式 卡类型-面值-regin_no
+    const Price = [
+        //移动
+        "4-50-30" => 47.75, "4-100-30" => 95.5, "4-200-30" => 191, //宁夏
+        "4-50-29" => 47.75, "4-100-29" => 95.5, "4-200-29" => 191, //青海
+        "4-50-27" => 47.75, "4-100-27" => 95.5, "4-200-27" => 191, //陕西
+        "4-50-13" => 47.75, "4-100-13" => 95.5, "4-200-13" => 191, //福建
+        "4-50-10" => 47.75, "4-100-10" => 95.5, "4-200-10" => 191, //江苏
+
+        //电信
+        "6-50-28" => 47.65, "6-100-28" => 95.3, "6-200-28" => 190.6, //甘肃
+        "6-50-25" => 47.65, "6-100-25" => 95.3, "6-200-25" => 190.6, //云南
+        "6-50-23" => 47.65, "6-100-23" => 95.3, "6-200-23" => 190.6, //四川
+        "6-50-21" => 47.65, "6-100-21" => 95.3, "6-200-21" => 190.6, //海南
+        "6-50-20" => 47.65, "6-100-20" => 95.3, "6-200-20" => 190.6, //广西
+        "6-50-19" => 47.65, "6-100-19" => 95.3, "6-200-19" => 190.6, //广东
+        "6-50-17" => 47.65, "6-100-17" => 95.3, "6-200-17" => 190.6, //湖北
+        "6-50-15" => 47.65, "6-100-15" => 95.3, "6-200-15" => 190.6, //山东
+        "6-50-14" => 47.65, "6-100-14" => 95.3, "6-200-14" => 190.6, //江西
+        "6-50-13" => 47.65, "6-100-13" => 95.3, "6-200-13" => 190.6, //福建
+        "6-50-10" => 47.65, "6-100-10" => 95.3, "6-200-10" => 190.6, //江苏
+        "6-50-2" => 47.65, "6-100-2" => 95.3, "6-200-2" => 190.6, //天津
+    ];
+}

+ 54 - 0
helper/refill/api/yl/fengsheng_fs/API.MD

@@ -0,0 +1,54 @@
+## 风生分省
+
+### 正式环境:
+- 话费下单地址:http://47.98.53.152:16188/plat/api/hf/submitorder
+- 查询地址:http://47.98.53.152:16188/plat/api/queryorder
+- 查询余额地址:http://47.98.53.152:16188/plat/api/querybalance
+
+- 客户端地址:http://47.98.53.152:16188/plat/login
+- 账号:fqs4
+- 密码:123456
+- 客户ID:100010
+- 密钥:d5e286e4bcfa4866b93c8f81e97e1307
+
+### 对接文档地址:
+> https://docs.qq.com/doc/DWEhQWEhDVEJIdUVC
+
+### 店铺账号
+- fengsheng_fs
+- fengsheng_fs67890
+
+### 产品编码
+```angular2html
+移动
+陕西
+编码 1610050 面值50:折扣94.5
+编码 1610100 面值100:折扣94.5
+编码 1610200 面值200:折扣94.5
+
+电信
+甘肃
+编码 3620050 面值50 折扣94.2
+编码 3620100 面值100 折扣94.2
+编码 3620200 面值200 折扣94.2
+
+天津
+编码 3120050 面值50 折扣94.2
+编码 3120100 面值100 折扣94.2
+编码 3120200 面值200 折扣94.2
+
+广东
+编码 3440050 面值50 折扣94.2
+编码 3440100 面值100 折扣94.2
+编码 3440200 面值200 折扣94.2
+
+湖南
+编码 3430050 面值50 折扣94.2
+编码 3430100 面值100 折扣94.2
+编码 3430200 面值200 折扣94.2
+
+江西
+编码 3360050 面值50 折扣94.2
+编码 3360100 面值100 折扣94.2
+编码 3360200 面值200 折扣94.2
+```

+ 52 - 0
helper/refill/api/yl/fengsheng_fs/RefillCallBack.php

@@ -0,0 +1,52 @@
+<?php
+namespace refill\fengsheng_fs;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fengsheng_fs/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false, false, ''];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 2) {
+            $official_sn = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 165 - 0
helper/refill/api/yl/fengsheng_fs/RefillPhone.php

@@ -0,0 +1,165 @@
+<?php
+
+namespace refill\fengsheng_fs;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fengsheng_fs/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function goods($quality,int $amount,int $card_type,$regin_no,$other)
+    {
+        [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$regin_no,$other);
+        if($goods_id <= 0) return [0,0];
+        $key = "{$card_type}-{$amount}-{$regin_no}";
+        $price = config::Price[$key];
+        if(empty($price)) {
+            Log::record("channel cannot find price where name={$this->mName}, goods_id = {$goods_id} card_type={$card_type} amount={$amount} regin_no={$regin_no}",Log::ERR);
+            return [0,0];
+        } else {
+            return [$goods_id,ncPriceFormat($price)];
+        }
+    }
+
+    private function req_params(int $phone, int $amount, int $card_type, string $order_sn, string $regin_no)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['szProductId'] = config::Product[$card_type][$regin_no][$amount];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $regin_no = $params['regin_no'] ?? -1;
+
+        if($regin_no <= 0) {
+            return [false, '省份获取错误', false];
+        }
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn, $regin_no);
+
+        $sign = $this->sign($params);
+        $params['szVerifyString'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+
+            $nRtn = $resp['nRtn'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误', ''];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误', ''];
+            }
+
+            $official_sn = '';
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $official_sn = $resp['szRtnMsg'];
+
+                $updata['official_sn'] = $official_sn;
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] > 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg'], ''];
+            }
+
+            return [true, $order_state, $official_sn];
+        }
+    }
+
+    public function balance()
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
+            } else {
+                return [false, $resp['szRtnCode']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
+        return md5($content);
+    }
+}

+ 86 - 0
helper/refill/api/yl/fengsheng_fs/config.php

@@ -0,0 +1,86 @@
+<?php
+
+
+namespace refill\fengsheng_fs;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://47.98.53.152:16188/plat/api/hf/submitorder';
+    const QUERY_URL= 'http://47.98.53.152:16188/plat/api/queryorder';
+    const BALANCE_URL = 'http://47.98.53.152:16188/plat/api/querybalance';
+
+    const USER_ID= '100010';
+    const KEY = 'd5e286e4bcfa4866b93c8f81e97e1307';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_fengsheng_fs.php";
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
+
+    const Product = [
+        mtopcard\ChinaMobileCard => [
+            //陕西
+            27 => [
+                50  => 1610050,
+                100 => 1610100,
+                200 => 1610200,
+            ],
+        ],
+        mtopcard\ChinaUnicomCard => [
+
+        ],
+        mtopcard\ChinaTelecomCard => [
+            //甘肃
+            28 => [
+                50  => 3620050,
+                100 => 3620100,
+                200 => 3620200,
+            ],
+            //天津
+            2 => [
+                50  => 3120050,
+                100 => 3120100,
+                200 => 3120200,
+            ],
+            //广东
+            19 => [
+                50  => 3440050,
+                100 => 3440100,
+                200 => 3440200,
+            ],
+            //湖南
+            18 => [
+                50  => 3430050,
+                100 => 3430100,
+                200 => 3430200,
+            ],
+            //江西
+            14 => [
+                50  => 3360050,
+                100 => 3360100,
+                200 => 3360200,
+            ],
+        ]
+    ];
+
+    //key格式 卡类型-面值-regin_no
+    const Price = [
+        //移动
+        "4-50-27" => 47.25, "4-100-27" => 94.5, "4-200-27" => 189, //陕西
+
+        //电信
+        "6-50-28" => 47.1, "6-100-28" => 94.2, "6-200-28" => 188.4, //甘肃
+        "6-50-2" => 47.1, "6-100-2" => 94.2, "6-200-2" => 188.4, //天津
+        "6-50-19" => 47.1, "6-100-19" => 94.2, "6-200-19" => 188.4, //广东
+        "6-50-18" => 47.1, "6-100-18" => 94.2, "6-200-18" => 188.4, //湖南
+        "6-50-14" => 47.1, "6-100-14" => 94.2, "6-200-14" => 188.4, //江西
+    ];
+}

+ 10 - 8
helper/refill/api/yl/guochuang/config.php

@@ -72,11 +72,11 @@ class config
         "4-10-13" => 9.965, "4-20-13" => 19.93, "4-30-13" => 29.895, "4-50-13" => 49.825, "4-100-13" => 99.65, "4-200-13" => 199.3, "4-300-13" => 298.95, "4-500-13" => 498.25,//福建 13
         "4-10-5" => 10.26, "4-20-5" => 20.52, "4-30-5" => 30.78, "4-50-5" => 50.8, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
-        "4-10-19" => 10.37, "4-20-19" => 20.74, "4-30-19" => 31.11, "4-50-19" => 50.55, "4-100-19" => 101.1, "4-200-19" => 202.2, "4-300-19" => 303.3, "4-500-19" => 505.5,//广东 19
+        "4-10-19" => 10.37, "4-20-19" => 20.74, "4-30-19" => 31.11, "4-50-19" => 50.5, "4-100-19" => 101, "4-200-19" => 202, "4-300-19" => 303, "4-500-19" => 505,//广东 19
         "4-10-7" => 9.93, "4-20-7" => 19.86, "4-30-7" => 29.52, "4-50-7" => 49.2, "4-100-7" => 98.4, "4-200-7" => 196.8, "4-300-7" => 295.2, "4-500-7" => 492,//吉林 7
         "4-10-1" => 10.31, "4-20-1" => 20.32, "4-30-1" => 30.33, "4-50-1" => 50.6, "4-100-1" => 100.4, "4-200-1" => 200.3, "4-300-1" => 300.45, "4-500-1" => 500.75,//北京 1
         "4-10-22" => 10.015, "4-20-22" => 20.03, "4-30-22" => 30.045, "4-50-22" => 50.075, "4-100-22" => 100.15, "4-200-22" => 200.3, "4-300-22" => 300.45, "4-500-22" => 500.75,//重庆 22
-        "4-1-15" => 1.04, "4-2-15" => 2.08, "4-3-15" => 3.12, "4-4-15" => 4.16, "4-5-15" => 5.61, "4-6-15" => 6.24, "4-7-15" => 7.28, "4-8-15" => 8.32, "4-9-15" => 9.36, "4-10-15" => 10.62, "4-20-15" => 20.64, "4-30-15" => 30.66, "4-50-15" => 50.7, "4-100-15" => 99.3, "4-200-15" => 198.6, "4-300-15" => 297.9,//山东 15
+        "4-1-15" => 1.04, "4-2-15" => 2.08, "4-3-15" => 3.12, "4-4-15" => 4.16, "4-5-15" => 5.61, "4-6-15" => 6.24, "4-7-15" => 7.28, "4-8-15" => 8.32, "4-9-15" => 9.36, "4-10-15" => 10.33, "4-20-15" => 20.56, "4-30-15" => 30.66, "4-50-15" => 50.7, "4-100-15" => 99.3, "4-200-15" => 198.6, "4-300-15" => 297.9,//山东 15
         "4-10-10" => 9.945, "4-20-10" => 19.89, "4-30-10" => 30.18, "4-50-10" => 50.4, "4-100-10" => 100.48, "4-200-10" => 200.56, "4-300-10" => 300.84, "4-500-10" => 501.4,//江苏 10
         "4-10-11" => 9.945, "4-20-11" => 19.89, "4-30-11" => 29.835, "4-50-11" => 49.725, "4-100-11" => 99.45, "4-200-11" => 198.9, "4-300-11" => 298.35, "4-500-11" => 497.25,//浙江 11
         "4-10-17" => 9.945, "4-20-17" => 19.89, "4-30-17" => 29.835, "4-50-17" => 49.725, "4-100-17" => 99.45, "4-200-17" => 198.9, "4-300-17" => 298.35, "4-500-17" => 497.25,//湖北 17
@@ -94,20 +94,22 @@ class config
         "5-10-19" => 10.04, "5-20-19" => 20.08, "5-30-19" => 30.06, "5-50-19" => 50.1, "5-100-19" => 100.2, "5-200-19" => 200.4, "5-300-19" => 300.6, "5-500-19" => 501,//广东 19
         "5-10-1" => 9.99, "5-20-1" => 19.98, "5-30-1" => 29.97, "5-50-1" => 49.95, "5-100-1" => 99.9, "5-200-1" => 199.8, "5-300-1" => 299.7, "5-500-1" => 499.5,//北京 1
         "5-10-22" => 10.04, "5-20-22" => 20.08, "5-30-22" => 30.12, "5-50-22" => 50.2, "5-100-22" => 100.4, "5-200-22" => 200.8, "5-300-22" => 301.2, "5-500-22" => 502,//重庆 22
-        "5-10-14" => 10.03, "5-20-14" => 20.06, "5-30-14" => 30.09, "5-50-14" => 50.1, "5-100-14" => 100.2, "5-200-14" => 200.4, "5-300-14" => 300.6, "5-500-14" => 501,//江西 14
-        "5-20-23" => 20.08, "5-30-23" => 30.12, "5-50-23" => 50.2, "5-100-23" => 100.4, "5-200-23" => 200.8, "5-300-23" => 301.2, "5-500-23" => 502,//四川 23
-        "5-10-31" => 10.22, "5-20-31" => 20.22, "5-30-31" => 30.24, "5-50-31" => 50.25, "5-100-31" => 100.3, "5-200-31" => 200.4, "5-300-31" => 300.6, "5-500-31" => 501,//新疆 31
+        "5-10-14" => 10.15, "5-20-14" => 20.3, "5-30-14" => 30.45, "5-50-14" => 50.2, "5-100-14" => 100.4, "5-200-14" => 200.8, "5-300-14" => 301.2, "5-500-14" => 502,//江西 14
+        "5-10-23" => 10.11, "5-20-23" => 20.22, "5-30-23" => 30.33, "5-50-23" => 50.2, "5-100-23" => 100.4, "5-200-23" => 200.8, "5-300-23" => 301.2, "5-500-23" => 502,//四川 23
+        "5-10-31" => 10.17, "5-20-31" => 20.19, "5-30-31" => 30.24, "5-50-31" => 50.25, "5-100-31" => 100.3, "5-200-31" => 200.4, "5-300-31" => 300.6, "5-500-31" => 501,//新疆 31
+        "5-10-20" => 10.13, "5-20-20" => 20.14, "5-30-20" => 30.18,//广西 20
+
         //电信
         "6-10-27" => 10.12, "6-20-27" => 20.24, "6-30-27" => 30.36, "6-50-27" => 50.1, "6-100-27" => 100.2, "6-200-27" => 199.94, "6-300-27" => 299.91, "6-500-27" => 501,//陕西 27
         "6-10-4" => 10.37, "6-20-4" => 20.39, "6-30-4" => 30.42, "6-50-4" => 50.45, "6-100-4" => 100.6, "6-200-4" => 201.2, "6-300-4" => 301.8, "6-500-4" => 503,//山西 4
         "6-10-18" => 10.09, "6-20-18" => 20.1, "6-30-18" => 30.12, "6-50-18" => 50.1, "6-100-18" => 100.2, "6-200-18" => 200.3, "6-300-18" => 300.45, "6-500-18" => 500.75,//湖南 18
         "6-10-15" => 10.37, "6-20-15" => 20.38, "6-30-15" => 30.42, "6-50-15" => 50.8, "6-100-15" => 101, "6-200-15" => 200.4, "6-300-15" => 300.6, "6-500-15" => 501,//山东 15
-        "6-10-12" => 10.2, "6-20-12" => 20.24, "6-30-12" => 30.21, "6-50-12" => 50.4, "6-100-12" => 100.7, "6-200-12" => 200.6, "6-300-12" => 300.9, "6-500-12" => 501.5,//安徽 12
+        "6-10-12" => 10.2, "6-20-12" => 20.24, "6-30-12" => 30.21, "6-50-12" => 50.4, "6-100-12" => 100.8, "6-200-12" => 201.2, "6-300-12" => 300.9, "6-500-12" => 501.5,//安徽 12
         "6-10-2" => 10.12, "6-20-2" => 20.16, "6-30-2" => 30.21, "6-50-2" => 50.2, "6-100-2" => 100.4, "6-200-2" => 200.8, "6-300-2" => 301.2, "6-500-2" => 502,//天津 2
         "6-10-20" => 10.15, "6-20-20" => 20.18, "6-30-20" => 30.21, "6-50-20" => 50.3, "6-100-20" => 100.45, "6-200-20" => 200.6, "6-300-20" => 300.9, "6-500-20" => 501.5,//广西 20
         "6-10-29" => 10.13, "6-20-29" => 20.14, "6-30-29" => 30.18, "6-50-29" => 50.25, "6-100-29" => 100.35, "6-200-29" => 200.6, "6-300-29" => 300.9, "6-500-29" => 501.5,//青海 29
-        "6-100-1" => 100.2, "6-200-1" => 200.2, "6-300-1" => 300.3, "6-500-1" => 500.5,//北京 1
-        "6-10-16" => 10.13, "6-20-16" => 20.24, "6-30-16" => 30.36, "6-50-16" => 50.3, "6-100-16" => 100.4, "6-200-16" => 200.8, "6-300-16" => 301.2, "6-500-16" => 502,//河南 16
+        "6-10-1" => 10.3,  "6-20-1" => 20.34,  "6-30-1" => 30.36,  "6-50-1" => 50.45, "6-100-1" => 100.55, "6-200-1" => 200.9, "6-300-1" => 300.3, "6-500-1" => 500.5,//北京 1
+        "6-10-16" => 10.13, "6-20-16" => 20.24, "6-30-16" => 30.36, "6-50-16" => 50.25, "6-100-16" => 100.4, "6-200-16" => 200.8, "6-300-16" => 301.2, "6-500-16" => 502,//河南 16
         "6-10-13" => 10.17, "6-20-13" => 20.16, "6-30-13" => 30.18, "6-50-13" => 50.3, "6-100-13" => 100.55, "6-200-13" => 200.8, "6-300-13" => 301.2, "6-500-13" => 502,//福建 13
         "6-10-6" => 10.21, "6-20-6" => 20.24, "6-30-6" => 30.27, "6-50-6" => 50.2, "6-100-6" => 100.4, "6-200-6" => 200.8, "6-300-6" => 301.2, "6-500-6" => 502,//辽宁 6
         "6-10-17" => 10.23, "6-20-17" => 20.46, "6-30-17" => 30.69, "6-50-17" => 51.1,//湖北 17

+ 26 - 0
helper/refill/api/yl/lihui_fs/API.MD

@@ -25,6 +25,11 @@
 编码:1610100 面值100 折扣95
 编码:1610200 面值200 折扣95
 
+江苏移动
+50  编码 1320050     折扣95
+100 编码 1320100     折扣95
+200 编码 1320200     折扣95
+
 广东电信
 编码:3440050 面值50 折扣95
 编码:3440100 面值100 折扣95
@@ -49,4 +54,25 @@
 50编码  3360050 折扣95
 100编码 3360100 折扣95
 200编码 3360200 折扣9
+
+四川电信200元		3510200
+四川电信100元		3510100
+四川电信50元  		3510050
+
+福建电信200元		3350200
+福建电信100元		3350100
+福建电信50元  		3350050
+
+江苏电信
+50  编码 3320050    折扣95
+100 编码 3320100    折扣95
+200 编码 3320200    折扣95
+
+青海电信200元  3630200
+青海电信100元  3630100
+青海电信50元    3630050
+
+海南电信200元  3460200
+海南电信100元  3460100
+海南电信50元    3460050
 ```

+ 42 - 0
helper/refill/api/yl/lihui_fs/config.php

@@ -39,6 +39,12 @@ class config
                 100 => 1350100,
                 200 => 1350200,
             ],
+            //江苏
+            10 => [
+                50  => 1320050,
+                100 => 1320100,
+                200 => 1320200,
+            ],
         ],
         mtopcard\ChinaTelecomCard => [
             //广东
@@ -71,6 +77,36 @@ class config
                 100 => 3360100,
                 200 => 3360200,
             ],
+            //四川
+            23 => [
+                50  => 3510050,
+                100 => 3510100,
+                200 => 3510200,
+            ],
+            //福建
+            13 => [
+                50  => 3350050,
+                100 => 3350100,
+                200 => 3350200,
+            ],
+            //江苏
+            10 => [
+                50  => 3320050,
+                100 => 3320100,
+                200 => 3320200,
+            ],
+            //青海
+            29 => [
+                50  => 3630050,
+                100 => 3630100,
+                200 => 3630200,
+            ],
+            //海南
+            21 => [
+                50  => 3460050,
+                100 => 3460100,
+                200 => 3460200,
+            ],
         ],
     ];
 
@@ -79,6 +115,7 @@ class config
         //移动
         "4-50-27" => 47.5, "4-100-27" => 95, "4-200-27" => 190, //陕西
         "4-50-13" => 47.5, "4-100-13" => 95, "4-200-13" => 190, //福建
+        "4-50-10" => 47.5, "4-100-10" => 95, "4-200-10" => 190, //江苏
 
         //电信
         "6-50-19" => 47.5, "6-100-19" => 95, "6-200-19" => 190, //广东
@@ -86,6 +123,11 @@ class config
         "6-50-2" => 47.5, "6-100-2" => 95, "6-200-2" => 190, //天津
         "6-50-28" => 47.5, "6-100-28" => 95, "6-200-28" => 190, //甘肃
         "6-50-14" => 47.5, "6-100-14" => 95, "6-200-14" => 190, //江西
+        "6-50-23" => 47.5, "6-100-23" => 95, "6-200-23" => 190, //四川
+        "6-50-13" => 47.5, "6-100-13" => 95, "6-200-13" => 190, //福建
+        "6-50-10" => 47.5, "6-100-10" => 95, "6-200-10" => 190, //江苏
+        "6-50-29" => 47.5, "6-100-29" => 95, "6-200-29" => 190, //青海
+        "6-50-21" => 47.5, "6-100-21" => 95, "6-200-21" => 190, //海南
     ];
 
 }

+ 1 - 1
helper/refill/api/yl/nrui/config.php

@@ -12,7 +12,7 @@ class config
 
     const USER_ID= '100001';
     const KEY = 'ef09c5fd16554b78a171dda5fbd49c13';
-    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_nrui.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_nruiex.php";
 
     const operator = [
         mtopcard\ChinaMobileCard  => 1,

二进制
helper/refill/api/yl/xinbao_fs/20250320_dx_hb_sc.jpg


二进制
helper/refill/api/yl/xinbao_fs/20250403_dx_yunnan.png


+ 24 - 1
helper/refill/api/yl/xinbao_fs/API.MD

@@ -62,7 +62,30 @@
 江西电信 100面值 3360100
 江西电信 200面值 3360200
 
+四川电信50元  编码 3510050 折扣94
+四川电信100元 编码 3510100 折扣94
+四川电信200元 编码 3510200 折扣94
+
+湖北电信50元  编码 3420050 折扣94
+湖北电信100元 编码 3420100 折扣94
+湖北电信200元 编码 3420200 折扣94
 
 ## 2024。12.11 调价
 - 20241211_price_*.jpg
-- 其他面额参考100的折扣来
+- 其他面额参考100的折扣来
+
+## 2025.4.1
+甘肃移动  折扣95
+200面值   1620200
+100面值   1620100
+50面值   1620050
+
+福建电信  折扣94
+200面值  3350200
+100面值  3350100
+50面值   3350050
+
+## 2025.4.3
+云南电信200元 3530200
+云南电信100元 3530100
+云南电信50元  3530050

+ 28 - 0
helper/refill/api/yl/xinbao_fs/config.php

@@ -132,6 +132,12 @@ class config
                 50  => 1650050,
                 100 => 1650100,
                 200 => 1650200,
+            ],
+            //甘肃
+            28 => [
+                50  => 1620050,
+                100 => 1620100,
+                200 => 1620200,
             ]
         ],
         mtopcard\ChinaTelecomCard => [
@@ -200,6 +206,24 @@ class config
                 100 => 3360100,
                 200 => 3360200,
             ],
+            //湖北
+            17 => [
+                50  => 3420050,
+                100 => 3420100,
+                200 => 3420200,
+            ],
+            //福建
+            13 => [
+                50  => 3350050,
+                100 => 3350100,
+                200 => 3350200,
+            ],
+            //云南
+            25 => [
+                50  => 3530050,
+                100 => 3530100,
+                200 => 3530200,
+            ],
         ]
     ];
 
@@ -222,6 +246,7 @@ class config
         "4-50-14" => 47.5, "4-100-14" => 95, "4-200-14" => 190, //江西 14
         "4-50-12" => 47.5, "4-100-12" => 95, "4-200-12" => 190, //安徽 12
         "4-50-31" => 47.5, "4-100-31" => 95, "4-200-31" => 190, //新疆 31
+        "4-50-28" => 47.5, "4-100-28" => 95, "4-200-28" => 190, //甘肃 28
 
         //电信
         "6-30-18" => 28.2, "6-50-18" => 47, "6-100-18" => 94, "6-200-18" => 188,//湖南 18
@@ -234,5 +259,8 @@ class config
         "6-50-23" => 47, "6-100-23" => 94, "6-200-23" => 188,//四川 23
         "6-50-10" => 47, "6-100-10" => 94, "6-200-10" => 188,//江苏 10
         "6-50-14" => 47, "6-100-14" => 94, "6-200-14" => 188,//江西 14
+        "6-50-17" => 47, "6-100-17" => 94, "6-200-17" => 188,//湖北 17
+        "6-50-13" => 47, "6-100-13" => 94, "6-200-13" => 188,//福建 13
+        "6-50-25" => 47, "6-100-25" => 94, "6-200-25" => 188,//云南 25
     ];
 }

+ 24 - 6
helper/request_helper.php

@@ -265,7 +265,7 @@ class request_helper
     {
         $method = strtolower(request_helper::method());
         $squery = request_helper::query_string();
-        self::parse_formurl($squery,$method);
+        self::parse_fromurl($squery,$method);
 
         if ($method == 'post') {
             $content = request_helper::content();
@@ -275,9 +275,9 @@ class request_helper
         if(!empty($content))
         {
             $content_type = strtolower(self::content_type());
-            Log::record("type = {$content_type}, content={$content}",Log::DEBUG);
+            Log::record("type = $content_type, content=$content",Log::DEBUG);
 
-            $checker = function ($stype)
+            $checker_form = function ($stype)
             {
                 $formtypes = ['application/x-www-form-urlencoded', 'text/xml', 'text/html', 'multipart/form-data', 'application/octet-stream'];
                 foreach ($formtypes as $type) {
@@ -288,13 +288,31 @@ class request_helper
                 return false;
             };
 
-            if(empty($content_type) || $checker($content_type)) {
-                self::parse_formurl($content,$method);
+            $checker_json = function ($stype)
+            {
+                $formtypes = ['application/json'];
+                foreach ($formtypes as $type) {
+                    if(self::start_with($stype,$type)) {
+                        return true;
+                    }
+                }
+                return false;
+            };
+
+            if (empty($content_type) || $checker_form($content_type)) {
+                self::parse_fromurl($content, $method);
+            } elseif ($checker_json($content_type)) {
+                $values = json_decode($content, true);
+                foreach ($values as $key => $val) {
+                    $_GET[$key] = $val;
+                    $_POST[$key] = $val;
+                }
             }
         }
     }
 
-    static private function parse_formurl($squery,$method)
+
+    static private function parse_fromurl($squery,$method)
     {
         if(empty($squery)) return;
 

+ 31 - 0
mchsrv/control/merchant_order.php

@@ -200,6 +200,37 @@ class merchant_orderControl extends mbMerchantControl
         return self::outsuccess($result);
     }
 
+    public function interceptOp()
+    {
+        $mchid = $this->mchid();
+        $mch_order = $_GET['order_sn'];
+
+        if(empty($mch_order)) {
+            return self::outerr(205,"客户订单号为空.");
+        }
+
+        $mod_refill = Model('refill_order');
+        $order = $mod_refill->get_detail($mchid,$mch_order);
+
+        if(empty($order)) {
+            return self::outerr(205,"该订单号不存在.");
+        }
+
+        $order_state = $order['order_state'];
+        if($order_state === ORDER_STATE_HANDLED) {
+            return self::outerr(206,"该订单已经完成.");
+        }
+
+        $order_state = refill\util::query_queue_order($mchid,$mch_order);
+        if ($order_state == ORDER_STATE_TIMEOUT || $order_state == ORDER_STATE_HANDLED) {
+            Log::record("intercept timeout order mchid=$mchid mch_order=$mch_order order_state=$order_state" ,Log::DEBUG);
+            return self::outerr(206,"该订单已经完成.");
+        }
+
+        refill\util::set_cancel_order($mchid,$mch_order);
+        return self::outsuccess([]);
+    }
+
     private function merchant_order_format($orders)
     {
         $data = [];

+ 4 - 0
mobile/callback/refill_benyu_sec.php

@@ -0,0 +1,4 @@
+<?php
+
+refill\util::push_notify('benyu_sec',$_POST);
+echo ('SUCCESS');

+ 4 - 0
mobile/callback/refill_dexin_fs.php

@@ -0,0 +1,4 @@
+<?php
+
+refill\util::push_notify('dexin_fs',$_POST);
+echo ('ok');

+ 4 - 0
mobile/callback/refill_fengsheng_fs.php

@@ -0,0 +1,4 @@
+<?php
+
+refill\util::push_notify('fengsheng_fs',$_POST);
+echo ('ok');

mobile/callback/refill_nrui.php → mobile/callback/refill_nruiex.php


+ 18 - 0
test/TestRefill.php

@@ -6608,6 +6608,24 @@ class TestRefill extends TestCase
         $provider = $this->getProvider('zhixinzhuanch');
         $resp = $provider->balance();
     }
+
+    public function testfengsheng_fs()
+    {
+        $provider = $this->getProvider('fengsheng_fs');
+        $resp = $provider->balance();
+    }
+
+    public function testbenyu_sec()
+    {
+        $provider = $this->getProvider('benyu_sec');
+        $resp = $provider->balance();
+    }
+
+    public function testdexin_fs()
+    {
+        $provider = $this->getProvider('dexin_fs');
+        $resp = $provider->balance();
+    }
 }