Skip to content

Commit fdb3b3f

Browse files
PHPSDK-164: Overwrite min and max amount for coupons (#367)
1 parent 92ed570 commit fdb3b3f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/Api/PaymentMethods/PaymentMethod.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ public function getBrands(): array
174174
*/
175175
public function getMinAmount(): float
176176
{
177+
if ($this->getType() === self::COUPON_TYPE) {
178+
return 0.0;
179+
}
180+
177181
return (float)$this->allowedAmount[self::ALLOWED_MIN_AMOUNT_KEY];
178182
}
179183

@@ -182,6 +186,10 @@ public function getMinAmount(): float
182186
*/
183187
public function getMaxAmount(): ?float
184188
{
189+
if ($this->getType() === self::COUPON_TYPE) {
190+
return null;
191+
}
192+
185193
return $this->allowedAmount[self::ALLOWED_MAX_AMOUNT_KEY] ?? null;
186194
}
187195

0 commit comments

Comments
 (0)