|
|
@@ -37,6 +37,26 @@ class QianBaoWithdrawService
|
|
|
$telegram->editMessageText($res);
|
|
|
}
|
|
|
|
|
|
+ //选择银行卡号
|
|
|
+ $pattern = "/^withdrawAddress@@choose_qb_\d+$/";
|
|
|
+ if (preg_match($pattern, $data)) {
|
|
|
+ $id = preg_replace('/^withdrawAddress@@choose_qb_/', '', $data);
|
|
|
+ $res = QianBaoWithdrawService::chooseBank($chatId, $id);
|
|
|
+ $telegram->deleteMessage([
|
|
|
+ 'chat_id' => $chatId,
|
|
|
+ 'message_id' => $messageId,
|
|
|
+ ]);
|
|
|
+ $telegram->sendMessage($res);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //确认提现信息
|
|
|
+ if ($data === "withdraw@@qb_confirm") {
|
|
|
+ $res = QianBaoWithdrawService::confirm($chatId, $messageId);
|
|
|
+ $telegram->editMessageText($res);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if ($data === "withdraw@@qb_apply") {
|
|
|
$res = QianBaoWithdrawService::qbApply($chatId, $messageId);
|
|
|
@@ -55,19 +75,6 @@ class QianBaoWithdrawService
|
|
|
}
|
|
|
|
|
|
|
|
|
- //选择银行卡号
|
|
|
- $pattern = "/^withdrawAddress@@choose_qb_\d+$/";
|
|
|
- if (preg_match($pattern, $data)) {
|
|
|
- $id = preg_replace('/^withdrawAddress@@choose_qb_/', '', $data);
|
|
|
- $res = QianBaoWithdrawService::chooseBank($chatId, $id);
|
|
|
- $telegram->deleteMessage([
|
|
|
- 'chat_id' => $chatId,
|
|
|
- 'message_id' => $messageId,
|
|
|
- ]);
|
|
|
- $telegram->sendMessage($res);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
//银行卡管理
|
|
|
if ($data === 'withdraw@@banks') {
|
|
|
$res = QianBaoWithdrawService::banks($chatId, $messageId);
|
|
|
@@ -367,6 +374,14 @@ class QianBaoWithdrawService
|
|
|
];
|
|
|
}
|
|
|
|
|
|
+ private static function confirm($chatId, $messageId)
|
|
|
+ {
|
|
|
+ $id = Cache::get("{$chatId}_QB_BANK_ID");
|
|
|
+ $bank = Bank::where('id', $id)->first();
|
|
|
+ $amount = Cache::get("{$chatId}_WITHDRAW_QB_MONEY");
|
|
|
+ return PaymentOrderService::createPayout($chatId, $amount, $bank->channel, $bank->bank_name, $bank->account, $bank->card_no);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//银行卡管理
|
|
|
private static function banks($chatId, $messageId)
|