-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Events added to package.
- Loading branch information
Showing
6 changed files
with
275 additions
and
9 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
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,44 @@ | ||
<?php | ||
|
||
namespace Amsgames\LaravelShop\Events; | ||
|
||
use Illuminate\Queue\SerializesModels; | ||
|
||
/** | ||
* Event fired when an order has been completed. | ||
* | ||
* @author Alejandro Mostajo | ||
* @copyright Amsgames, LLC | ||
* @license MIT | ||
* @package Amsgames\LaravelShop | ||
*/ | ||
class CartCheckout | ||
{ | ||
use SerializesModels; | ||
|
||
/** | ||
* Cart ID. | ||
* @var int | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* Flag that indicates if the checkout was successful or not. | ||
* @var bool | ||
*/ | ||
public $success; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param int $id Order ID. | ||
* @param bool $success Checkout flag result. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct($id, $success) | ||
{ | ||
$this->id = $id; | ||
$this->success = $success; | ||
} | ||
} |
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,36 @@ | ||
<?php | ||
|
||
namespace Amsgames\LaravelShop\Events; | ||
|
||
use Illuminate\Queue\SerializesModels; | ||
|
||
/** | ||
* Event fired when an order has been completed. | ||
* | ||
* @author Alejandro Mostajo | ||
* @copyright Amsgames, LLC | ||
* @license MIT | ||
* @package Amsgames\LaravelShop | ||
*/ | ||
class OrderCompleted | ||
{ | ||
use SerializesModels; | ||
|
||
/** | ||
* Order ID. | ||
* @var int | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param int $id Order ID. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
} |
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,36 @@ | ||
<?php | ||
|
||
namespace Amsgames\LaravelShop\Events; | ||
|
||
use Illuminate\Queue\SerializesModels; | ||
|
||
/** | ||
* Event fired when an order is placed. | ||
* | ||
* @author Alejandro Mostajo | ||
* @copyright Amsgames, LLC | ||
* @license MIT | ||
* @package Amsgames\LaravelShop | ||
*/ | ||
class OrderPlaced | ||
{ | ||
use SerializesModels; | ||
|
||
/** | ||
* Order ID. | ||
* @var int | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param int $id Order ID. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
} |
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,51 @@ | ||
<?php | ||
|
||
namespace Amsgames\LaravelShop\Events; | ||
|
||
use Illuminate\Queue\SerializesModels; | ||
|
||
/** | ||
* Event fired when an order has changed status code. | ||
* | ||
* @author Alejandro Mostajo | ||
* @copyright Amsgames, LLC | ||
* @license MIT | ||
* @package Amsgames\LaravelShop | ||
*/ | ||
class OrderStatusChanged | ||
{ | ||
use SerializesModels; | ||
|
||
/** | ||
* Order ID. | ||
* @var int | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* Order status code. | ||
* @var string | ||
*/ | ||
public $statusCode; | ||
|
||
/** | ||
* Previous order status code. | ||
* @var string | ||
*/ | ||
public $previousStatusCode; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param int $id Order ID. | ||
* @param string $statusCode Order status code. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct($id, $statusCode, $previousStatusCode) | ||
{ | ||
$this->id = $id; | ||
$this->statusCode = $statusCode; | ||
$this->previousStatusCode = $previousStatusCode; | ||
} | ||
} |