xiaoyu 3 gadi atpakaļ
vecāks
revīzija
9603ae269c

+ 15 - 1
data/config/win/refill.ini.php

@@ -2770,6 +2770,19 @@ $xingzy_normal_phone = ['name' => 'xingzy_normal', 'store_id' => 137, 'qualitys'
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$pushang_phone = ['name' => 'pushang', 'store_id' => 138, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 7187, 'price' => 10.03, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7188, 'price' => 20.06, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7189, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7190, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7191, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7192, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7193, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7194, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2873,7 +2886,8 @@ $phone_providers = [
     ['name' => 'chizeng', 'cfg' => $chizeng_phone],
     ['name' => 'jinxin', 'cfg' => $jinxin_phone],
     ['name' => 'kachong', 'cfg' => $kachong_phone],
-    ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone]
+    ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone],
+    ['name' => 'pushang', 'cfg' => $pushang_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 15 - 1
data/config/xyz/refill.ini.php

@@ -2770,6 +2770,19 @@ $xingzy_normal_phone = ['name' => 'xingzy_normal', 'store_id' => 137, 'qualitys'
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$pushang_phone = ['name' => 'pushang', 'store_id' => 138, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 7187, 'price' => 10.03, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7188, 'price' => 20.06, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7189, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7190, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7191, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7192, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7193, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7194, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2873,7 +2886,8 @@ $phone_providers = [
     ['name' => 'chizeng', 'cfg' => $chizeng_phone],
     ['name' => 'jinxin', 'cfg' => $jinxin_phone],
     ['name' => 'kachong', 'cfg' => $kachong_phone],
-    ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone]
+    ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone],
+    ['name' => 'pushang', 'cfg' => $pushang_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 15 - 1
data/config/xyzadm/refill.ini.php

@@ -2770,6 +2770,19 @@ $xingzy_normal_phone = ['name' => 'xingzy_normal', 'store_id' => 137, 'qualitys'
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$pushang_phone = ['name' => 'pushang', 'store_id' => 138, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 7187, 'price' => 10.03, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7188, 'price' => 20.06, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7189, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7190, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7191, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7192, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7193, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7194, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2873,7 +2886,8 @@ $phone_providers = [
     ['name' => 'chizeng', 'cfg' => $chizeng_phone],
     ['name' => 'jinxin', 'cfg' => $jinxin_phone],
     ['name' => 'kachong', 'cfg' => $kachong_phone],
-    ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone]
+    ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone],
+    ['name' => 'pushang', 'cfg' => $pushang_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 1 - 2
helper/refill/api/xyz/pushang/RefillCallBack.php

@@ -34,8 +34,7 @@ class RefillCallBack implements refill\IRefillCallBack
 
         $order_id = $order_info['order_id'];
         if ($status === 4) {
-            $data['ch_trade_no'] = strtolower($params['orderId']) == 'null' ? '' : $params['orderId'];
-            Model('refill_order')->edit($order_id, $data);
+            Model('refill_order')->edit($order_id, ['official_sn' => $params['exchangeTraded'], 'ch_trade_no' => $params['orderId']]);
             return [$order_id, true, false, true];
         } elseif ($status === 5) {
             return [$order_id, false, true, true];

+ 1 - 2
helper/refill/api/xyz/pushang/RefillPhone.php

@@ -28,7 +28,6 @@ class RefillPhone extends refill\IRefillPhone
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
         $params = $this->req_params($card_no, $card_type, $params['order_sn'], $amount);
-
         $sign = $this->sign($params);
         $params['md5'] = $sign;
 
@@ -75,6 +74,7 @@ class RefillPhone extends refill\IRefillPhone
             {
                 $status = intval($resp['data']);
                 if ($status === 4) {
+                    Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $resp['ext']['exchangeTraded']]);
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($status === 5) {
                     $order_state = ORDER_STATE_CANCEL;
@@ -96,7 +96,6 @@ class RefillPhone extends refill\IRefillPhone
     public function balance()
     {
         $params['merchantId'] = config::MCH_ID;
-
         $content = $params['merchantId'] . config::KEY;
         $params['sign'] = md5($content);
 

+ 5 - 5
helper/refill/api/xyz/pushang/config.php

@@ -4,12 +4,12 @@ namespace refill\pushang;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://121.43.128.122:8080/api/jyk/makeOrder';
-    const QUERY_URL = 'http://121.43.128.122:8080/api/queryOrder';
-    const BALANCE_URL = 'http://121.43.128.122:8080/api/queryOrder';
+    const ORDER_URL = 'http://123.60.45.58:8080/api/huafei/makeOrder';
+    const QUERY_URL = 'http://123.60.45.58:8080/api/queryOrder';
+    const BALANCE_URL = 'http://123.60.45.58:8080/api/queryBalance';
 
-    const MCH_ID = 'M00107';
-    const KEY = 'n42TtiQDUsKfKwsUJiRmN5oNey4YXSqH';
+    const MCH_ID = 'M00050';
+    const KEY = 'mg035JzCXuno967P54TbEbyC15kCtPwA';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_pushang.php";
     const operator = [
         mtopcard\ChinaMobileCard => '移动',

+ 6 - 9
helper/refill/api/xyz/pushang/对接文档.txt

@@ -1,9 +1,6 @@
-接口文档地址 http://121.43.128.122:8080/doc/api.html
-http://121.43.128.122:8080
-
-商户号:M00107
-密钥:n42TtiQDUsKfKwsUJiRmN5oNey4YXSqH
-
-客户后台:http://218.244.159.217:7777
-商户号:M00107
-密码:123456
+商户号:M00050
+登陆密码:NJPS1135
+MD5KEY :mg035JzCXuno967P54TbEbyC15kCtPwA
+后台地址 http://123.60.22.32/#/login
+接口文档地址 :http://123.60.45.58:8080/doc/doc.html
+生产服务器地址:  http://123.60.45.58:8080/api/

+ 4 - 0
mobile/callback/refill_pushang.php

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

+ 14 - 0
test/TestRefill.php

@@ -1151,6 +1151,20 @@ class TestRefill extends TestCase
         $resp = $providers->balance();
     }
 
+    public function testPushang()
+    {
+        $providers = $this->getProvider('pushang');
+//        $resp = $providers->balance();
+//        $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
+        $resp = $providers->query(['order_sn' => '23391632986567769626']);
+
+//        $body = '{"msg":"\u8d26\u52a1\u6263\u6b3e\u5931\u8d25","extOrderId":"22081632982700152800","orderId":"R2021093014240000154555","salePrice":"30.0900","sign":"b0fe238f16e516316729589d42ab97b1","state":"5","exchangeTraded":""}';
+//        $params = json_decode($body, true);
+//        $providers = $this->getProvider('pushang','RefillCallBack');
+//        $ret = $providers->verify($params);
+//        $resp = $providers->notify($params);
+    }
+
     public function testAmingjd()
     {
 //        $providers = new refill\amingjd\RefillPhone([]);