Explorar o código

opt paytaro error report

Tokumeikoi %!s(int64=5) %!d(string=hai) anos
pai
achega
9dc64114f5
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      library/PayTaro.php

+ 2 - 1
library/PayTaro.php

@@ -24,7 +24,8 @@ class PayTaro
         $curl->post('https://api.paytaro.com/v1/gateway/fetch', http_build_query($params));
         $result = $curl->response;
         if ($curl->error) {
-            abort(500, $result->errors[array_keys($result->errors)[0]]);
+            $errors = (array)$result->errors;
+            abort(500, $errors[array_keys($errors)[0]][0]);
         }
         $curl->close();
         if (!isset($result->data->trade_no)) {