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