Jelajahi Sumber

修改礼品卡

llp 5 hari lalu
induk
melakukan
a7fc863849

+ 1 - 1
packages/Longyi/Gift/src/Routes/shop-routes.php

@@ -5,7 +5,7 @@ use Longyi\Gift\Http\Controllers\Shop\GiftController;
 use Longyi\RewardPoints\Http\Middleware\ApiCustomerAuthenticate;
 
 Route::group(['prefix' => 'api'], function () {
-    Route::group(['middleware' => ['api', ApiCustomerAuthenticate::class], 'prefix' => 'gift'], function () {
+    Route::group(['middleware' => ['web', 'customer', ApiCustomerAuthenticate::class], 'prefix' => 'gift'], function () {
         Route::get('/lists', [GiftController::class, 'lists'])->name('shop.gift.lists');
         Route::post('/add', [GiftController::class, 'add'])->name('shop.gift.add');
         Route::get('/my-gift-cards', [GiftController::class, 'getCustomerGiftCards'])->name('shop.api.checkout.cart.giftcard.list');

+ 8 - 0
packages/Longyi/Pay/Afterpay/src/Payment/Afterpay.php

@@ -380,4 +380,12 @@ class Afterpay extends Payment
     {
         return round((float) $number, 2);
     }
+    public function getDescription()
+    {
+        $description = $this->getConfigData('description');
+        $info = $this->getOrder() ?: Cart::getCart();
+        $amount = round($info->grand_total / 4, 2);
+        $symbol = core()->getCurrentCurrency()->symbol;
+        return sprintf($description, $symbol.$amount);
+    }
 }

+ 8 - 0
packages/Longyi/Pay/AwxAfterpay/src/Payment/AwxAfterpay.php

@@ -321,4 +321,12 @@ class AwxAfterpay extends Payment
         }
         return true;
     }
+    public function getDescription()
+    {
+        $description = $this->getConfigData('description');
+        $info = $this->getOrder() ?: Cart::getCart();
+        $amount = round($info->grand_total / 4, 2);
+        $symbol = core()->getCurrentCurrency()->symbol;
+        return sprintf($description, $symbol.$amount);
+    }
 }

+ 2 - 1
packages/Longyi/Pay/AwxKlarna/src/Payment/AwxKlarna.php

@@ -333,9 +333,10 @@ class AwxKlarna extends Payment
 
     public function getDescription()
     {
+        $description = $this->getConfigData('description');
         $info = $this->getOrder() ?: Cart::getCart();
         $amount = round($info->grand_total / 4, 2);
         $symbol = core()->getCurrentCurrency()->symbol;
-        return "4 interest-free payments of {$symbol}{$amount}";
+        return sprintf($description, $symbol.$amount);
     }
 }

+ 8 - 0
packages/Longyi/Pay/Klarna/src/Payment/Klarna.php

@@ -338,4 +338,12 @@ class Klarna extends Payment
     {
         return  config('app.url');
     }
+    public function getDescription()
+    {
+        $description = $this->getConfigData('description');
+        $info = $this->getOrder() ?: Cart::getCart();
+        $amount = round($info->grand_total / 4, 2);
+        $symbol = core()->getCurrentCurrency()->symbol;
+        return sprintf($description, $symbol.$amount);
+    }
 }