|
|
@@ -10,8 +10,9 @@ use App\Models\Wallet;
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
use Telegram\Bot\Api;
|
|
|
use App\Services\Payment\SanJinService;
|
|
|
+use App\Services\BaseService;
|
|
|
|
|
|
-class SanJinRechargeService
|
|
|
+class SanJinRechargeService extends BaseService
|
|
|
{
|
|
|
/**
|
|
|
* @param Api $telegram
|
|
|
@@ -40,6 +41,17 @@ class SanJinRechargeService
|
|
|
$telegram->editMessageText($res);
|
|
|
}
|
|
|
|
|
|
+ //选择充值
|
|
|
+ $pattern = "/^topup@@sj_amount_\d+$/";
|
|
|
+ if (preg_match($pattern, $data)) {
|
|
|
+ $amount = preg_replace('/^topup@@sj_amount_/', '', $data);
|
|
|
+
|
|
|
+ $res = SanJinRechargeService::inputSjAmount($chatId, $amount, $messageId);
|
|
|
+
|
|
|
+ self::sendMessage($chatId,$res['text'],$res['keyboard']??[],$res['image']);
|
|
|
+ // $telegram->editMessageText($res);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// 支付通道
|
|
|
$pattern = '/^topup_channel@@(.+)$/';
|
|
|
@@ -118,6 +130,9 @@ class SanJinRechargeService
|
|
|
'text' => $text,
|
|
|
'message_id' => $messageId
|
|
|
];
|
|
|
+ if($keyboard){
|
|
|
+ $res['reply_markup'] = json_encode(['inline_keyboard' => $keyboard]);
|
|
|
+ }
|
|
|
$telegram->editMessageText($res);
|
|
|
}
|
|
|
|