소스 검색

opt paytaro error report

Tokumeikoi 5 년 전
부모
커밋
168b0ad72e
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      library/PayTaro.php

+ 2 - 2
library/PayTaro.php

@@ -22,10 +22,10 @@ class PayTaro
         $params['sign'] = md5($str);
         $curl = new Curl();
         $curl->post('https://api.paytaro.com/v1/gateway/fetch', http_build_query($params));
+        $result = $curl->response;
         if ($curl->error) {
-            abort(500, '接口请求失败');
+            abort(500, $result->errors[array_keys($result->errors)[0]]);
         }
-        $result = $curl->response;
         $curl->close();
         if (!isset($result->data->trade_no)) {
             abort(500, '接口请求失败');