Browse Source

苹果 server to server,接收正式

lizhen_gitee 1 year ago
parent
commit
9400e2eb7b
1 changed files with 8 additions and 5 deletions
  1. 8 5
      application/api/controller/Payios.php

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

@@ -468,11 +468,14 @@ class Payios extends Api
         try {
 
             $raw = file_get_contents("php://input");
+            filePut("\r\n\r\n".'入口:'.$raw);
             $raw = json_decode($raw,true);
 
-            $token = $raw['signedPayload'] ?? '';
+            $token = isset($raw['signedPayload']) ? $raw['signedPayload'] : '';
             $data  = $this->verifyAppleToken($token);
-            dump($data);
+
+
+
             if (empty($data)) {
                 //timbao add
                 //记录苹果通知逻辑中的bug
@@ -480,7 +483,7 @@ class Payios extends Api
             }
 
             $transaction_info = $this->verifyAppleToken($data['data']['signedTransactionInfo']);
-            dump($transaction_info);
+
             $rs = '默认';
             switch ($data['notificationType']) {
                 case 'DID_RENEW': // 续订
@@ -551,8 +554,8 @@ class Payios extends Api
         } else {
             $xml = file_get_contents("php://input");
             file_put_contents($notify_file, "\r\n\r\n".date('Y-m-d H:i:s')." [notify][入口接收php://input流原始数据] \n".$xml, FILE_APPEND);
-            $xmlObj = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
-            file_put_contents($notify_file, "\r\n\r\n".date('Y-m-d H:i:s')." [notify][入口接收php://input流] ".json_encode($xmlObj), FILE_APPEND);
+            /*$xmlObj = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
+            file_put_contents($notify_file, "\r\n\r\n".date('Y-m-d H:i:s')." [notify][入口接收php://input流] ".json_encode($xmlObj), FILE_APPEND);*/
         }
 
         ini_set('display_errors','On');