浏览代码

苹果支付回调,bundle_id从arg里面拿出来单独一个字段

lizhen_gitee 1 年之前
父节点
当前提交
e14b0980c9
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      application/api/controller/Payios.php

+ 6 - 5
application/api/controller/Payios.php

@@ -61,7 +61,8 @@ class Payios extends Api
         $data['order_status'] = 0;
         $data['table_name'] = 'vip_recharge';
         $data['table_id'] = 0;
-        $data['args'] = json_encode(['days'=>$recharge_config['days'],'bundle_id'=>$recharge_config['bundle_id']]);
+        $data['args'] = json_encode(['days'=>$recharge_config['days']]);
+        $data['bundle_id'] = $recharge_config['bundle_id'];
 
         $orderid = Db::name('pay_order')->insertGetId($data);
 
@@ -70,7 +71,6 @@ class Payios extends Api
 
     //vip,苹果内购支付回调
     public function vip_notify_ios(){
-        $notify_file = $this->notify_log_start('ios');
 
         //苹果内购的验证收据
         $receipt_data = input('apple_receipt', '', 'trim');
@@ -104,7 +104,7 @@ class Payios extends Api
         $count = count($result['data']['receipt']['in_app']);
         $use_count = $count - 1;
         $args = json_decode($order_info['args'],true);
-        if ($result['data']['receipt']['in_app'][$use_count]['product_id'] != $args['bundle_id']) {
+        if ($result['data']['receipt']['in_app'][$use_count]['product_id'] != $order_info['bundle_id']) {
             Db::rollback();
             filePut('VIP ios充值:非法请求,请立刻停止out_trade_no='.$order_no.','.$result['message'].','.$result['data']['receipt']['in_app'][$use_count]['product_id'].'!='.$args['bundle_id']);
             $this->error('非法请求,请立刻停止');
@@ -200,7 +200,8 @@ class Payios extends Api
         $data['order_status'] = 0;
         $data['table_name'] = 'gold_recharge';
         $data['table_id'] = 0;
-        $data['args'] = json_encode(['gold'=>$gold,'bundle_id'=>$recharge_config['bundle_id']]);
+        $data['args'] = json_encode(['gold'=>$gold]);
+        $data['bundle_id'] = $recharge_config['bundle_id'];
 
         $orderid = Db::name('pay_order')->insertGetId($data);
 
@@ -243,7 +244,7 @@ class Payios extends Api
         $count = count($result['data']['receipt']['in_app']);
         $use_count = $count - 1;
         $args = json_decode($order_info['args'],true);
-        if ($result['data']['receipt']['in_app'][$use_count]['product_id'] != $args['bundle_id']) {
+        if ($result['data']['receipt']['in_app'][$use_count]['product_id'] != $order_info['bundle_id']) {
             Db::rollback();
             filePut('金币 ios充值:非法请求,请立刻停止out_trade_no='.$order_no.','.$result['message'].','.$result['data']['receipt']['in_app'][$use_count]['product_id'].'!='.$args['bundle_id']);
             $this->error('非法请求,请立刻停止');