-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e81ca5b
commit 8f8fdc0
Showing
6 changed files
with
69 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Vanilo\Checkout\Contracts; | ||
|
||
interface CouponEvent extends CheckoutEvent | ||
{ | ||
public function getCouponCode(): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Contains the BaseCouponEvent class. | ||
* | ||
* @copyright Copyright (c) 2024 Vanilo UG | ||
* @author Attila Fulop | ||
* @license MIT | ||
* @since 2024-08-24 | ||
* | ||
*/ | ||
|
||
namespace Vanilo\Checkout\Events; | ||
|
||
use Vanilo\Checkout\Contracts\Checkout; | ||
use Vanilo\Checkout\Contracts\CouponEvent; | ||
|
||
abstract class BaseCouponEvent extends BaseCheckoutEvent implements CouponEvent | ||
{ | ||
public readonly string $couponCode; | ||
|
||
public function __construct(Checkout $checkout, string $couponCode) | ||
{ | ||
parent::__construct($checkout); | ||
$this->couponCode = $couponCode; | ||
} | ||
|
||
public function getCouponCode(): string | ||
{ | ||
return $this->couponCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Contains the CouponUtilized Event class | ||
* | ||
* @copyright Copyright (c) 2024 Vanilo UG | ||
* @author Attila Fulop | ||
* @license MIT | ||
* @since 2024-08-24 | ||
* | ||
*/ | ||
|
||
namespace Vanilo\Checkout\Events; | ||
|
||
class CouponUtilized extends BaseCouponEvent | ||
{ | ||
} |