From 078a52f2069978d4485ac28379f676e2f4b2c28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Tue, 12 Apr 2022 16:11:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E4=BB=98=E4=BA=A4=E6=98=93=E8=B6=85?= =?UTF-8?q?=E6=97=B6,=E9=87=8D=E6=96=B0=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/WalletToBankCommand.php | 6 ++++++ app/Services/YeePayService.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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']);