diff --git a/src/Http/Classes/Payme/Payme.php b/src/Http/Classes/Payme/Payme.php index 91d5308..4c5c35d 100644 --- a/src/Http/Classes/Payme/Payme.php +++ b/src/Http/Classes/Payme/Payme.php @@ -109,7 +109,7 @@ private function CheckTransaction() ); } - $detail = json_decode($transaction->detail, true); + $detail = $transaction->detail; $this->response->success([ 'create_time' => 1 * $detail['create_time'], 'perform_time' => 1 * $detail['perform_time'], @@ -235,7 +235,7 @@ private function PerformTransaction() $transaction->state = Transaction::STATE_COMPLETED; $transaction->updated_time = $perform_time; - $detail = json_decode($transaction->detail, true); + $detail = $transaction->detail; $detail['perform_time'] = $perform_time; $detail = json_encode($detail); @@ -254,7 +254,7 @@ private function PerformTransaction() break; case Transaction::STATE_COMPLETED: // handle complete transaction - $detail = json_decode($transaction->detail, true); + $detail = $transaction->detail; $this->response->success([ 'transaction' => (string)$transaction->id, @@ -323,7 +323,7 @@ private function CancelTransaction() if (true) { $transaction->cancel(1 * $this->request->params['reason']); - $detail = json_decode($transaction->detail, true); + $detail = $transaction->detail; PaymentService::payListener(null, $transaction, 'cancel-pay'); diff --git a/src/Http/Classes/Paynet/Request.php b/src/Http/Classes/Paynet/Request.php index cdfb526..1d18253 100644 --- a/src/Http/Classes/Paynet/Request.php +++ b/src/Http/Classes/Paynet/Request.php @@ -136,10 +136,21 @@ private function paramsCancel($par) private function paramsInformation($par) { + $key = $par['parameters']; + if (isset($key['paramValue'])) { + $key = $key['paramValue']; + } else { + $keys = $key; + foreach ($keys as $k) { + if ($k['paramKey'] == 'key') { + $key = $k['paramValue']; + } + } + } $res = [ 'method' => self::METHOD_GetInformation, 'key' => $par['parameters']['paramValue'] ]; $this->params = array_merge($this->params, $res); } -} \ No newline at end of file +}