Skip to content

Commit 009d4eb

Browse files
committed
Merge pull request #238 from magento-mpi/pull-request
[MPI] Define Public API + Bugs
2 parents 0247336 + 5e6c346 commit 009d4eb

File tree

40 files changed

+218
-218
lines changed

40 files changed

+218
-218
lines changed

app/code/Magento/Checkout/Block/Cart/Shipping.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart
3434
protected $_directoryBlock;
3535

3636
/**
37-
* @var \Magento\Quote\Model\Quote\Address\CarrierFactoryInterface
37+
* @var \Magento\Shipping\Model\CarrierFactoryInterface
3838
*/
3939
protected $_carrierFactory;
4040

@@ -48,7 +48,7 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart
4848
* @param \Magento\Customer\Model\Session $customerSession
4949
* @param \Magento\Checkout\Model\Session $checkoutSession
5050
* @param \Magento\Directory\Block\Data $directoryBlock
51-
* @param \Magento\Quote\Model\Quote\Address\CarrierFactoryInterface $carrierFactory
51+
* @param \Magento\Shipping\Model\CarrierFactoryInterface $carrierFactory
5252
* @param PriceCurrencyInterface $priceCurrency
5353
* @param array $data
5454
*/
@@ -57,7 +57,7 @@ public function __construct(
5757
\Magento\Customer\Model\Session $customerSession,
5858
\Magento\Checkout\Model\Session $checkoutSession,
5959
\Magento\Directory\Block\Data $directoryBlock,
60-
\Magento\Quote\Model\Quote\Address\CarrierFactoryInterface $carrierFactory,
60+
\Magento\Shipping\Model\CarrierFactoryInterface $carrierFactory,
6161
PriceCurrencyInterface $priceCurrency,
6262
array $data = []
6363
) {

app/code/Magento/Checkout/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"magento/module-customer": "0.74.0-beta4",
1111
"magento/module-catalog": "0.74.0-beta4",
1212
"magento/module-payment": "0.74.0-beta4",
13+
"magento/module-shipping": "0.74.0-beta4",
1314
"magento/module-tax": "0.74.0-beta4",
1415
"magento/module-directory": "0.74.0-beta4",
1516
"magento/module-eav": "0.74.0-beta4",

app/code/Magento/Dhl/Model/Carrier.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,10 @@ protected function _getDefaultValue($origValue, $pathToValue)
295295
/**
296296
* Collect and get rates
297297
*
298-
* @param RateRequest $request
298+
* @param \Magento\Framework\Object $request
299299
* @return bool|Result|null
300300
*/
301-
public function collectRates(RateRequest $request)
301+
public function collectRates(\Magento\Framework\Object $request)
302302
{
303303
if (!$this->getConfigFlag($this->_activeFlag)) {
304304
return false;
@@ -1255,10 +1255,10 @@ protected function _doShipmentRequest(\Magento\Framework\Object $request)
12551255
/**
12561256
* Processing additional validation to check is carrier applicable.
12571257
*
1258-
* @param RateRequest $request
1259-
* @return $this|Error|boolean
1258+
* @param \Magento\Framework\Object $request
1259+
* @return $this|\Magento\Framework\Object|boolean
12601260
*/
1261-
public function proccessAdditionalValidation(RateRequest $request)
1261+
public function proccessAdditionalValidation(\Magento\Framework\Object $request)
12621262
{
12631263
//Skip by item validation if there is no items in request
12641264
if (!count($this->getAllItems($request))) {

app/code/Magento/Fedex/Model/Carrier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ protected function _createTrackSoapClient()
236236
/**
237237
* Collect and get rates
238238
*
239-
* @param RateRequest $request
239+
* @param \Magento\Framework\Object $request
240240
* @return Result|bool|null
241241
*/
242-
public function collectRates(RateRequest $request)
242+
public function collectRates(\Magento\Framework\Object $request)
243243
{
244244
if (!$this->getConfigFlag($this->_activeFlag)) {
245245
return false;

app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ public function __construct(
5555
}
5656

5757
/**
58-
* @param \Magento\Quote\Model\Quote\Address\RateRequest $request
58+
* @param \Magento\Framework\Object $request
5959
* @return Result|bool
6060
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
6161
* @SuppressWarnings(PHPMD.NPathComplexity)
6262
*/
63-
public function collectRates(\Magento\Quote\Model\Quote\Address\RateRequest $request)
63+
public function collectRates(\Magento\Framework\Object $request)
6464
{
6565
if (!$this->getConfigFlag('active')) {
6666
return false;

app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public function __construct(
5858
/**
5959
* FreeShipping Rates Collector
6060
*
61-
* @param \Magento\Quote\Model\Quote\Address\RateRequest $request
61+
* @param \Magento\Framework\Object $request
6262
* @return \Magento\Shipping\Model\Rate\Result|bool
6363
*/
64-
public function collectRates(\Magento\Quote\Model\Quote\Address\RateRequest $request)
64+
public function collectRates(\Magento\Framework\Object $request)
6565
{
6666
if (!$this->getConfigFlag('active')) {
6767
return false;

app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public function __construct(
5050
}
5151

5252
/**
53-
* @param \Magento\Quote\Model\Quote\Address\RateRequest $request
53+
* @param \Magento\Framework\Object $request
5454
* @return \Magento\Shipping\Model\Rate\Result
5555
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
5656
*/
57-
public function collectRates(\Magento\Quote\Model\Quote\Address\RateRequest $request)
57+
public function collectRates(\Magento\Framework\Object $request)
5858
{
5959
if (!$this->getConfigFlag('active')) {
6060
return false;

app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ public function __construct(
7272
}
7373

7474
/**
75-
* @param \Magento\Quote\Model\Quote\Address\RateRequest $request
75+
* @param \Magento\Framework\Object $request
7676
* @return \Magento\Shipping\Model\Rate\Result
7777
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
7878
* @SuppressWarnings(PHPMD.NPathComplexity)
7979
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
8080
*/
81-
public function collectRates(\Magento\Quote\Model\Quote\Address\RateRequest $request)
81+
public function collectRates(\Magento\Framework\Object $request)
8282
{
8383
if (!$this->getConfigFlag('active')) {
8484
return false;

app/code/Magento/Payment/Model/Cart.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class Cart
7575
/**
7676
* @param \Magento\Payment\Model\Cart\SalesModel\Factory $salesModelFactory
7777
* @param \Magento\Framework\Event\ManagerInterface $eventManager
78-
* @param \Magento\Sales\Model\Order|\Magento\Quote\Model\Quote $salesModel
78+
* @param \Magento\Quote\Api\Data\CartInterface $salesModel
7979
*/
8080
public function __construct(
8181
\Magento\Payment\Model\Cart\SalesModel\Factory $salesModelFactory,
@@ -91,6 +91,7 @@ public function __construct(
9191
* Return payment cart sales model
9292
*
9393
* @return \Magento\Payment\Model\Cart\SalesModel\SalesModelInterface
94+
* @api
9495
*/
9596
public function getSalesModel()
9697
{
@@ -102,6 +103,7 @@ public function getSalesModel()
102103
*
103104
* @param float $taxAmount
104105
* @return void
106+
* @api
105107
*/
106108
public function addTax($taxAmount)
107109
{
@@ -113,6 +115,7 @@ public function addTax($taxAmount)
113115
*
114116
* @param float $taxAmount
115117
* @return void
118+
* @api
116119
*/
117120
public function setTax($taxAmount)
118121
{
@@ -123,6 +126,7 @@ public function setTax($taxAmount)
123126
* Get tax amount
124127
*
125128
* @return float
129+
* @api
126130
*/
127131
public function getTax()
128132
{
@@ -134,6 +138,7 @@ public function getTax()
134138
*
135139
* @param float $discountAmount
136140
* @return void
141+
* @api
137142
*/
138143
public function addDiscount($discountAmount)
139144
{
@@ -145,6 +150,7 @@ public function addDiscount($discountAmount)
145150
*
146151
* @param float $discountAmount
147152
* @return void
153+
* @api
148154
*/
149155
public function setDiscount($discountAmount)
150156
{
@@ -155,6 +161,7 @@ public function setDiscount($discountAmount)
155161
* Get discount amount
156162
*
157163
* @return float
164+
* @api
158165
*/
159166
public function getDiscount()
160167
{
@@ -166,6 +173,7 @@ public function getDiscount()
166173
*
167174
* @param float $shippingAmount
168175
* @return void
176+
* @api
169177
*/
170178
public function addShipping($shippingAmount)
171179
{
@@ -177,6 +185,7 @@ public function addShipping($shippingAmount)
177185
*
178186
* @param float $shippingAmount
179187
* @return void
188+
* @api
180189
*/
181190
public function setShipping($shippingAmount)
182191
{
@@ -187,6 +196,7 @@ public function setShipping($shippingAmount)
187196
* Get shipping amount
188197
*
189198
* @return float
199+
* @api
190200
*/
191201
public function getShipping()
192202
{
@@ -198,6 +208,7 @@ public function getShipping()
198208
*
199209
* @param float $subtotalAmount
200210
* @return void
211+
* @api
201212
*/
202213
public function addSubtotal($subtotalAmount)
203214
{
@@ -208,6 +219,7 @@ public function addSubtotal($subtotalAmount)
208219
* Get subtotal amount
209220
*
210221
* @return float
222+
* @api
211223
*/
212224
public function getSubtotal()
213225
{
@@ -222,6 +234,7 @@ public function getSubtotal()
222234
* @param float $amount
223235
* @param string|null $identifier
224236
* @return void
237+
* @api
225238
*/
226239
public function addCustomItem($name, $qty, $amount, $identifier = null)
227240
{
@@ -232,6 +245,7 @@ public function addCustomItem($name, $qty, $amount, $identifier = null)
232245
* Get all cart items
233246
*
234247
* @return array
248+
* @api
235249
*/
236250
public function getAllItems()
237251
{
@@ -243,6 +257,7 @@ public function getAllItems()
243257
* Get shipping, tax, subtotal and discount amounts all together
244258
*
245259
* @return array
260+
* @api
246261
*/
247262
public function getAmounts()
248263
{
@@ -255,6 +270,7 @@ public function getAmounts()
255270
* Specify that shipping should be transferred as cart item
256271
*
257272
* @return void
273+
* @api
258274
*/
259275
public function setTransferShippingAsItem()
260276
{
@@ -265,6 +281,7 @@ public function setTransferShippingAsItem()
265281
* Specify that discount should be transferred as cart item
266282
*
267283
* @return void
284+
* @api
268285
*/
269286
public function setTransferDiscountAsItem()
270287
{

app/code/Magento/Payment/Model/Cart/SalesModel/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan
2626
/**
2727
* Wrap sales model with Magento\Payment\Model\Cart\SalesModel\SalesModelInterface
2828
*
29-
* @param \Magento\Sales\Model\Order|\Magento\Quote\Model\Quote $salesModel
29+
* @param \Magento\Quote\Api\Data\CartInterface $salesModel
3030
* @return \Magento\Payment\Model\Cart\SalesModel\SalesModelInterface
3131
* @throws \InvalidArgumentException
3232
*/

app/code/Magento/Payment/Model/Cart/SalesModel/SalesModelInterface.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,31 @@ interface SalesModelInterface
1414
* Get all items from shopping sales model
1515
*
1616
* @return array
17+
* @api
1718
*/
1819
public function getAllItems();
1920

2021
/**
2122
* @return float|null
23+
* @api
2224
*/
2325
public function getBaseSubtotal();
2426

2527
/**
2628
* @return float|null
29+
* @api
2730
*/
2831
public function getBaseTaxAmount();
2932

3033
/**
3134
* @return float|null
35+
* @api
3236
*/
3337
public function getBaseShippingAmount();
3438

3539
/**
3640
* @return float|null
41+
* @api
3742
*/
3843
public function getBaseDiscountAmount();
3944

@@ -43,13 +48,15 @@ public function getBaseDiscountAmount();
4348
* @param string $key
4449
* @param mixed $args
4550
* @return mixed
51+
* @api
4652
*/
4753
public function getDataUsingMethod($key, $args = null);
4854

4955
/**
5056
* Return object that contains tax related fields
5157
*
52-
* @return \Magento\Sales\Model\Order|\Magento\Quote\Model\Quote\Address
58+
* @return \Magento\Sales\Api\Data\OrderInterface|\Magento\Quote\Api\Data\AddressInterface
59+
* @api
5360
*/
5461
public function getTaxContainer();
5562
}

app/code/Magento/Payment/Model/Checks/PaymentMethodChecksInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface PaymentMethodChecksInterface
1414
* Retrieve payment method code
1515
*
1616
* @return string
17+
* @api
1718
*/
1819
public function getCode();
1920

@@ -22,13 +23,15 @@ public function getCode();
2223
* Can be used in admin
2324
*
2425
* @return bool
26+
* @api
2527
*/
2628
public function canUseInternal();
2729

2830
/**
2931
* Can be used in regular checkout
3032
*
3133
* @return bool
34+
* @api
3235
*/
3336
public function canUseCheckout();
3437

@@ -37,6 +40,7 @@ public function canUseCheckout();
3740
*
3841
* @param string $country
3942
* @return bool
43+
* @api
4044
*/
4145
public function canUseForCountry($country);
4246

@@ -45,6 +49,7 @@ public function canUseForCountry($country);
4549
*
4650
* @param string $currencyCode
4751
* @return bool
52+
* @api
4853
*/
4954
public function canUseForCurrency($currencyCode);
5055

@@ -55,6 +60,7 @@ public function canUseForCurrency($currencyCode);
5560
* @param int|string|null|\Magento\Store\Model\Store $storeId
5661
*
5762
* @return mixed
63+
* @api
5864
*/
5965
public function getConfigData($field, $storeId = null);
6066
}

0 commit comments

Comments
 (0)