diff --git a/app/Console/Commands/WalletToBankCommand.php b/app/Console/Commands/WalletToBankCommand.php index 850d9dce..e6293f29 100644 --- a/app/Console/Commands/WalletToBankCommand.php +++ b/app/Console/Commands/WalletToBankCommand.php @@ -50,8 +50,14 @@ class WalletToBankCommand extends Command 'amount' => bcdiv($log->account_amount, 100, 2), 'feeRole' => 'PAYER', 'tradeMemo' => '商城余额提现', + 'context' => json_encode(['type' => 'wallet_to_bank']), ]); + // 如果交易超时,重新发起支付 + if ($result['resultCode'] === 'TIME_OUT') { + continue; + } + if ($result['orderStatus'] === 'SUCCESS') { $log->update([ 'status' => WalletToBankLogStatus::Success, diff --git a/app/Services/YeePayService.php b/app/Services/YeePayService.php index 454ecdf9..2a5eedc8 100644 --- a/app/Services/YeePayService.php +++ b/app/Services/YeePayService.php @@ -36,7 +36,7 @@ class YeePayService $result = $response->json(); - if ($result['success'] && in_array($result['resultCode'], ['EXECUTE_SUCCESS', 'EXECUTE_PROCESSING'])) { + if ($result['success'] && in_array($result['resultCode'], ['EXECUTE_SUCCESS', 'EXECUTE_PROCESSING', 'TIME_OUT'])) { return $result; } @@ -51,7 +51,7 @@ class YeePayService * @param array $params * @return string */ - protected function sign(array $params): string + public function sign(array $params): string { unset($params['sign']);