notifyApi = new LakalaNotifyApi($this->config->getV3Config()); } public function notify(): void { $notify = $this->notifyApi->notiApi(); Log::debug('lakala notify '. json_encode($notify)); $inBody = $notify->getOriginalText(); if (!json_validate($inBody)) { throw_logic_exception('lakala notify json error'); } $bodyArr = json_decode($inBody, true); $payment = ExtensionPaymentModel::where(['transaction_id' => $bodyArr['trade_no']])->findOrEmpty(); if ($payment->isEmpty()) { throw_logic_exception('lakala notify transaction_id error'); } if ($payment->status != PaymentStatusEnum::PENDING) { throw_logic_exception('lakala notify transaction_id status error'); } $this->paymentProvider->query($payment->id); Log::debug('lakala notified success {transaction_id}', ['transaction_id' => $payment->transaction_id]); } }