xiaoyu 2 年之前
父節點
當前提交
af4e94e4b3

+ 34 - 0
data/config/xyz/refill.ini.php

@@ -8387,6 +8387,39 @@ $siyicheng_phone = ['name' => 'siyicheng', 'store_id' => 304, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$piaoyi_phone = ['name' => 'piaoyi', 'store_id' => 305, 'qualitys' => '3',
+    'amount' => [
+//        10 => [['goods_id' => 8520, 'price' => 10.36, 'quality' => 3, 'card_type' => 'chinaunicom']],
+//        20 => [['goods_id' => 8521, 'price' => 20.72, 'quality' => 3, 'card_type' => 'chinaunicom']],
+//        30 => [['goods_id' => 8522, 'price' => 31.08, 'quality' => 3, 'card_type' => 'chinamobile']],
+        50 => [
+            ['goods_id' => 8523, 'price' => 51.8, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8523, 'price' => 51.8, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8523, 'price' => 51.8, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 8524, 'price' => 103.6, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8524, 'price' => 103.6, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8524, 'price' => 103.6, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 8525, 'price' => 207.2, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8525, 'price' => 207.2, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8525, 'price' => 207.2, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 8526, 'price' => 310.8, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8526, 'price' => 310.8, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8526, 'price' => 310.8, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 8527, 'price' => 518, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8527, 'price' => 518, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8527, 'price' => 518, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -8645,6 +8678,7 @@ $phone_providers = [
     ['name' => 'shenzhou_ylyw', 'cfg' => $shenzhou_ylyw_phone],
     ['name' => 'jiuyi', 'cfg' => $jiuyi_phone],
     ['name' => 'siyicheng', 'cfg' => $siyicheng_phone],
+    ['name' => 'piaoyi', 'cfg' => $piaoyi_phone],
 
 ];
 $config['phone_providers'] = $phone_providers;

+ 4 - 4
helper/refill/api/xyz/piaoyi/RefillPhone.php

@@ -14,7 +14,7 @@ class RefillPhone extends refill\IRefillPhone
         parent::__construct($cfgs);
     }
 
-    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
     {
         $params['agentName'] = config::agentName;
         $params['chargeFace'] = $amount;
@@ -79,14 +79,14 @@ class RefillPhone extends refill\IRefillPhone
             {
                 $offical_sn = '';
                 $status = $resp['data']['orderStatus'];
-                if ($status === 200) {
+                if ($status === '200') {
                     $offical_sn = $resp['data']['brandOrderNumber'];
                     $updata['official_sn'] = $offical_sn;
                     Model('refill_order')->edit($refill_info['order_id'], $updata);
                     $order_state = ORDER_STATE_SUCCESS;
-                } elseif ($status === 300) {
+                } elseif ($status === '300') {
                     $order_state = ORDER_STATE_CANCEL;
-                } elseif ($status === 4) {
+                } elseif ($status === '4') {
                     $order_state = ORDER_STATE_SEND;
                 } else {
                     return [false, $status, $offical_sn];

+ 6 - 0
mobile/callback/refill_piaoyi.php

@@ -0,0 +1,6 @@
+<?php
+$content = $_SERVER['post_content'];
+$input = json_decode($content,true);
+
+refill\util::push_notify('piaoyi',$input);
+echo ('success');

File diff suppressed because it is too large
+ 14 - 0
test/TestRefill.php