Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit c6b4328

Browse files
author
Jens Schulze
committed
feat(ShippingMethod): add isMatching flag to shipping rates
1 parent 1f40cef commit c6b4328

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/Core/Model/ShippingMethod/ShippingRate.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* @method ShippingRate setPrice(Money $price = null)
1616
* @method Money getFreeAbove()
1717
* @method ShippingRate setFreeAbove(Money $freeAbove = null)
18+
* @method bool getIsMatching()
19+
* @method ShippingRate setIsMatching(bool $isMatching = null)
1820
*/
1921
class ShippingRate extends JsonObject
2022
{
@@ -23,6 +25,7 @@ public function fieldDefinitions()
2325
return [
2426
'price' => [static::TYPE => Money::class],
2527
'freeAbove' => [static::TYPE => Money::class],
28+
'isMatching' => [static::TYPE => 'bool']
2629
];
2730
}
2831
}

tests/fixtures/models.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ shippingRate:
630630
fields:
631631
- price
632632
- freeAbove
633+
- isMatching
633634

634635
state:
635636
domain: state

tests/integration/ShippingMethod/ShippingMethodQueryRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public function testByLocation()
9595
$response = $request->executeWithClient($this->getClient(), ['X-Vrap-Disable-Validation' => 'response']);
9696
$result = $request->mapResponse($response);
9797

98+
$this->assertTrue($result->current()->getZoneRates()->current()->getShippingRates()->current()->getIsMatching());
9899
$this->assertInstanceOf(ShippingMethodCollection::class, $result);
99100
$this->assertSame($shippingMethod->getId(), $result->current()->getId());
100101
}

0 commit comments

Comments
 (0)