xiaoyu 3 years atrás
parent
commit
e2524b42c8

+ 2 - 2
helper/refill/api/xyz/dongyefs/RefillPhone.php

@@ -18,7 +18,7 @@ class RefillPhone extends refill\IRefillPhone
     {
         [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$regin_no,$other);
         if($goods_id <= 0) return [0,0];
-        $key = "{$amount}-{$regin_no}";
+        $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);
@@ -46,7 +46,7 @@ class RefillPhone extends refill\IRefillPhone
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
         $order_sn = $params['order_sn'];
-        $regin_no = $input['regin_no'] ?? -1;
+        $regin_no = $params['regin_no'] ?? -1;
         if($regin_no <= 0) {
             return [false, '省份获取错误', false];
         }

+ 2 - 1
helper/refill/api/xyz/dongyefs/config.php

@@ -10,7 +10,8 @@ class config
 
     const USER_ID= '10003125';
     const KEY = '82dkkhEaR6GhchQkhS5SiffF2w8yX4wQ';
-    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_dongyefs.php";
+//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_dongyefs.php";
+    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
     const operator = [
         mtopcard\ChinaMobileCard  => 'yd',
         mtopcard\ChinaUnicomCard  => 'lt',

+ 8 - 0
test/TestRefill.php

@@ -1488,6 +1488,14 @@ class TestRefill extends TestCase
 //        $resp = $provider->notify($params);
     }
 
+    public function testDongyefs()
+    {
+        $provider = $this->getProvider('dongyefs');
+//        $resp = $provider->balance();
+//        [$goods_id, $price] = $provider->goods(1, 10, 4, 6, []);
+        $resp = $provider->add(13898167806, 4, 10, ['order_sn' => $this->make_sn(),'regin_no' => 6]);
+    }
+
     public function testAmingjd()
     {
 //        $provider = new refill\amingjd\RefillPhone([]);