소스 검색

weishengy and wailing provider

HARUHARU 4 년 전
부모
커밋
7f8646c400

+ 1 - 1
data/config/lingzh/refill.ini.php

@@ -404,7 +404,7 @@ $phone_providers = [
     ['name' => 'feiniao', 'cfg' => $feiniao_phone],
     ['name' => 'fensheng', 'cfg' => $fensheng_phone],
     ['name' => 'riying', 'cfg' => $riying_phone],
-//    ['name' => 'weishengy', 'cfg' => $weishengy_phone],
+    ['name' => 'weishengy', 'cfg' => $weishengy_phone],
     ['name' => 'wailing', 'cfg' => $wailing_phone],
     ];
 $config['phone_providers'] = $phone_providers;

+ 1 - 1
helper/fcgisrv/LZRAccServer.php

@@ -29,7 +29,7 @@ class LZRAccServer extends BaseServer
             'callback/lingzh/ruishun.php','callback/lingzh/wuchen.php','callback/lingzh/yibao.php',
             'callback/lingzh/amingyd.php','callback/lingzh/chuka.php','callback/lingzh/amingjd.php',
             'callback/lingzh/legou.php'  ,'callback/lingzh/feiniao.php', 'callback/lingzh/fensheng.php',
-            'callback/lingzh/riying.php' ,'callback/lingzh/wailing.php'
+            'callback/lingzh/riying.php' ,'callback/lingzh/wailing.php','callback/lingzh/weishengy.php'
         ];
 
         $this->setExFiles($exfiles);

+ 1 - 1
helper/refill/api/lingzh/wailing/config.php

@@ -10,6 +10,6 @@ class config
 
     const MCHID = 10045;
     const KEY = 'a1b2f886cfda41170547cd6cfc1cf16b';
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/racc/callback/lingzh/wailing.php";
     const NotifyTimeout = 7200;
 }

+ 2 - 2
helper/refill/api/lingzh/weishengy/RefillCallBack.php

@@ -23,7 +23,7 @@ class RefillCallBack implements refill\IRefillCallBack
     {
         $masId = config::masId;
         $content  = "masId={$masId}&oids={$params['oids']}&orderNo={$params['orderNo']}&orderPrice={$params['orderPrice']}&phone={$params['phone']}";
-        $content .= "&status={$params['status']}&time={$params['time']}&type={$params['time']}";
+        $content .= "&status={$params['status']}&time={$params['time']}&type={$params['type']}";
         return strtoupper(md5($content));
     }
 
@@ -37,7 +37,7 @@ class RefillCallBack implements refill\IRefillCallBack
         }
 
         $order_id = $order_info['order_id'];
-        if ($status === 1) {
+        if ($status == 1) {
             $data['official_sn'] = strtolower($params['oids']) == 'null' ? '' : $params['oids'];
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false,true];

+ 1 - 1
helper/refill/api/lingzh/weishengy/RefillPhone.php

@@ -84,7 +84,7 @@ class RefillPhone extends refill\IRefillPhone
                     $order_state = ORDER_STATE_SUCCESS;
                     $save['official_sn'] = strtolower($data['oids']) == 'null' ? '' : $data['oids'];
                     Model('refill_order')->edit($refill_info['order_id'], $save);
-                } elseif ($data['status'] == 0) {
+                } elseif (in_array($data['status'], [0,2])) {
                     $order_state = ORDER_STATE_SEND;
                 } else {
                     return [false, $resp['message']];

+ 1 - 2
helper/refill/api/lingzh/weishengy/config.php

@@ -10,7 +10,6 @@ class config
 
     const masId = '699270071532654592';
     const appKey = '8sa877sdj219sda';
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
-
+    const NOTIFY_URL = BASE_SITE_URL . "/racc/callback/lingzh/weishengy.php";
     const ExtHeaders = ['Content-Type: application/json;charset=utf-8'];
 }

+ 4 - 0
racc/callback/lingzh/weishengy.php

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

+ 5 - 2
test/TestRefill.php

@@ -442,8 +442,11 @@ class TestRefill extends TestCase
     public function testWeishengyPhone()
     {
         $providers = new refill\weishengy\RefillPhone([]);
-//        $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
-        $resp = $providers->query(['order_sn' => '65461618466399202798']);
+//        $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '15551618590601301527']);
+        $data = '{"masId":"699270071532654592","oids":"158877719094,166090529155,158887187476","orderNo":"62411618635377880788","orderPrice":"150.00","phone":"18500608333","sign":"3EC10A32FC4CCC976048E1164D0FCBF6","status":"1","time":"1618643281063","type":"2"}';
+        $input = json_decode($data, true);
+        refill\RefillFactory::instance()->notify('weishengy',$input);
     }
 
     public function testWailingPhone()