seven 2 週間 前
コミット
7f7c2c360c

+ 19 - 1
app/Services/Payment/SanJinService.php

@@ -6,6 +6,7 @@ use GuzzleHttp\Client;
 use GuzzleHttp\Exception\RequestException;
 use GuzzleHttp\Psr7\Response;
 use App\Services\BaseService;
+use Illuminate\Support\Facades\Lang;
 
 class SanJinService extends BaseService
 {
@@ -15,7 +16,6 @@ class SanJinService extends BaseService
     const PRODUCT_TEST = 'T888'; // 测试支付通道
 
     public static $CHANNEL = [
-        // 'test' => '测试', 
         'zfbsm' => '支付宝扫码',
         'zfbge' => '支付宝固额',
         'zfbzk' => '支付宝转卡',
@@ -24,6 +24,24 @@ class SanJinService extends BaseService
         'sdjt' => '手动金条',
     ];
 
+    /**
+     * @description: 获取支付频道
+     * @return {*}
+     */    
+    public static function getChannel($key = '')
+    {
+        $channel = self::$CHANNEL;
+        if($key){
+            return Lang($channel[$key]);
+        }else{
+            foreach($channel as $k => $v){
+                $channel[$k] = lang($v);
+            }
+            return $channel;
+        }
+        
+    }
+
     public static $PRODUCT = [
         // 'T888' => [
         //     'type' => 'test',

+ 3 - 3
app/Services/SanJinRechargeService.php

@@ -59,7 +59,7 @@ class SanJinRechargeService extends BaseService
             $k = $matches[1]; 
             
             // 验证 $k 是否有效
-            $channel = SanJinService::$CHANNEL;
+            $channel = SanJinService::getChannel();
             if (!isset($channel[$k])) {
                 // 处理无效的通道
                 $text = "无效的支付通道!";
@@ -272,7 +272,7 @@ class SanJinRechargeService extends BaseService
 
         $text = "请选择支付的通道 \n";
         $keyboard = [];
-        $channel = SanJinService::$CHANNEL;
+        $channel = SanJinService::getChannel();
         $keyboard[] = [
             ['text' => 'USDT', 'callback_data' => "topup@@topup"],
         ];
@@ -320,7 +320,7 @@ class SanJinRechargeService extends BaseService
         }
 
         // 验证 $k 是否有效
-        $channel = SanJinService::$CHANNEL;
+        $channel = SanJinService::getChannel();
         if (!isset($channel[$paymentType])) {
             // 处理无效的通道
             $text = "无效的支付通道!";

+ 6 - 1
lang/en/messages.php

@@ -133,7 +133,12 @@ return [
     "zh" => "Chinese",
     "vi" => "Vietnamese",
     "语言设置成功" => "Language set successfully",
-
+    "支付宝扫码"=>"Alipay code scanning",
+    "支付宝固额"=>"Alipay fixed amount",
+    "支付宝转卡"=>"Alipay card transfer",
+    "银联扫码"=>"UnionPay QR code scanning",
+    "数字人民币"=>"digital yuan",
+    "手动金条"=>"Manual gold bars",
 
 
 

+ 6 - 1
lang/vi/messages.php

@@ -133,7 +133,12 @@ return [
     "zh" => "Tiếng Trung",
     "vi" => "Tiếng Việt",
     "语言设置成功" => "Cài đặt ngôn ngữ thành công",
-
+    "支付宝扫码"=>"Thanh toán hóa đơn",
+    "支付宝固额"=>"Thanh toán cố định",
+    "支付宝转卡"=>"Thẻ chuyển tiền Alipay",
+    "银联扫码"=>"Mã quét UnionPay",
+    "数字人民币"=>"CNY kỹ thuật số",
+    "手动金条"=>"Hướng dẫn sử dụng Gold Bar",
 
 
 ];

+ 6 - 0
lang/zh/messages.php

@@ -133,4 +133,10 @@ return [
     "zh" => "中文",
     "vi" => "越南语",
     "语言设置成功"=>"语言设置成功",
+    "支付宝扫码"=>"支付宝扫码",
+    "支付宝固额"=>"支付宝固额",
+    "支付宝转卡"=>"支付宝转卡",
+    "银联扫码"=>"银联扫码",
+    "数字人民币"=>"数字人民币",
+    "手动金条"=>"手动金条",
 ];