14
14
use Magento \Quote \Model \Quote ;
15
15
16
16
/**
17
+ * Guest payment information management model.
18
+ *
17
19
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18
20
*/
19
21
class GuestPaymentInformationManagement implements \Magento \Checkout \Api \GuestPaymentInformationManagementInterface
@@ -66,7 +68,7 @@ class GuestPaymentInformationManagement implements \Magento\Checkout\Api\GuestPa
66
68
* @param \Magento\Checkout\Api\PaymentInformationManagementInterface $paymentInformationManagement
67
69
* @param \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory
68
70
* @param CartRepositoryInterface $cartRepository
69
- * @param ResourceConnection|null
71
+ * @param ResourceConnection $connectionPool
70
72
* @codeCoverageIgnore
71
73
*/
72
74
public function __construct (
@@ -88,7 +90,7 @@ public function __construct(
88
90
}
89
91
90
92
/**
91
- * {@inheritDoc}
93
+ * @inheritdoc
92
94
*/
93
95
public function savePaymentInformationAndPlaceOrder (
94
96
$ cartId ,
@@ -129,7 +131,7 @@ public function savePaymentInformationAndPlaceOrder(
129
131
}
130
132
131
133
/**
132
- * {@inheritDoc}
134
+ * @inheritdoc
133
135
*/
134
136
public function savePaymentInformation (
135
137
$ cartId ,
@@ -156,7 +158,7 @@ public function savePaymentInformation(
156
158
}
157
159
158
160
/**
159
- * {@inheritDoc}
161
+ * @inheritdoc
160
162
*/
161
163
public function getPaymentInformation ($ cartId )
162
164
{
@@ -190,9 +192,8 @@ private function limitShippingCarrier(Quote $quote) : void
190
192
{
191
193
$ shippingAddress = $ quote ->getShippingAddress ();
192
194
if ($ shippingAddress && $ shippingAddress ->getShippingMethod ()) {
193
- $ shippingDataArray = explode ('_ ' , $ shippingAddress ->getShippingMethod ());
194
- $ shippingCarrier = array_shift ($ shippingDataArray );
195
- $ shippingAddress ->setLimitCarrier ($ shippingCarrier );
195
+ $ shippingRate = $ shippingAddress ->getShippingRateByCode ($ shippingAddress ->getShippingMethod ());
196
+ $ shippingAddress ->setLimitCarrier ($ shippingRate ->getCarrier ());
196
197
}
197
198
}
198
199
}
0 commit comments