Ver código fonte

paymentservice 接受shippingMethod字段

fogwind 3 dias atrás
pai
commit
4db6e6f84f

+ 7 - 0
packages/Webkul/BagistoApi/src/Services/PaymentService.php

@@ -79,10 +79,17 @@ class PaymentService
         if ($express) {
             $this->validateExpressInitiation($cart, $input);
         } else {
+              if ($input->shippingMethod) {
+                if (! Cart::saveShippingMethod($input->shippingMethod)) {
+                    throw new OperationFailedException(__('bagistoapi::app.graphql.checkout.shipping-method-save-failed'));
+                }
+                }
             $this->validateStandardInitiation($cart, $input);
             Cart::collectTotals();
         }
 
+      
+
         if (! $input->paymentMethod && ! $cart->payment?->method) {
             throw new OperationFailedException(__('bagistoapi::app.graphql.checkout.payment-method-required'));
         }