Skip to content

Commit

Permalink
Listener Docblock comments added.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhartman committed Nov 17, 2019
1 parent dddff35 commit 18c0380
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 18 deletions.
15 changes: 14 additions & 1 deletion src/Listeners/Base.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
<?php

/**
* This file implements Base.
*
* @author Bilal Gultekin <bilal@gultekin.me>
* @author Justin Hartman <justin@22digital.co.za>
* @copyright 2019 22 Digital
* @license MIT
* @since v0.1
*/
namespace TwentyTwoDigital\CashierFastspring\Listeners;

/**
* This class describes a base.
*
* {@inheritDoc}
*/
class Base
{
/**
Expand Down
27 changes: 18 additions & 9 deletions src/Listeners/OrderCompleted.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
<?php

/**
* This class is a listener for order completed events.
*
* It updates or creates related order model so that you can show payment
* and bill details to your customers.
*
* @author Bilal Gultekin <bilal@gultekin.me>
* @author Justin Hartman <justin@22digital.co.za>
* @copyright 2019 22 Digital
* @license MIT
* @since v0.1
*/
namespace TwentyTwoDigital\CashierFastspring\Listeners;

use TwentyTwoDigital\CashierFastspring\Events;
use TwentyTwoDigital\CashierFastspring\Invoice;

/**
* This class is a listener for order completed events.
*
* It updates or creates related order model so that you can show payment
* and bill details to your customers.
* This class describes an order completed.
*
* Note: "order.completed" event is works just at creation for subscription products.
*
* IMPORTANT: This class handles expansion enabled webhooks
*
* {@inheritDoc}
*/
class OrderCompleted extends Base
{
/**
* Create the event listener.
*
* @return void
* @return null
*/
public function __construct()
{
Expand All @@ -36,8 +45,8 @@ public function __construct()
*/
public function handle(Events\OrderCompleted $event)
{
// try to find that invoice on the database
// if not exists then create one
// Try to find that invoice on the database if not exists then create
// one
$data = $event->data;
$subscription = $data['items'][0]['subscription'];

Expand Down
16 changes: 14 additions & 2 deletions src/Listeners/SubscriptionActivated.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
/**
* This file implements Subscription Activated.
*
* @author Bilal Gultekin <bilal@gultekin.me>
* @author Justin Hartman <justin@22digital.co.za>
* @copyright 2019 22 Digital
* @license MIT
* @since v0.1
*/

namespace TwentyTwoDigital\CashierFastspring\Listeners;

Expand All @@ -7,21 +16,24 @@
use TwentyTwoDigital\CashierFastspring\SubscriptionPeriod;

/**
* This class is a listener for subscription state change events.
* This class describes a subscription activated.
*
* It is planned to listen following fastspring events:
* - subscription.canceled
* - subscription.deactivated
* - subscription.payment.overdue
* It updates related subscription event.
*
* IMPORTANT: This class handles expansion enabled webhooks.
*
* {@inheritDoc}
*/
class SubscriptionActivated extends Base
{
/**
* Create the event listener.
*
* @return void
* @return null
*/
public function __construct()
{
Expand Down
14 changes: 12 additions & 2 deletions src/Listeners/SubscriptionChargeCompleted.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php

/**
* This file implements Subscription Charge Completed.
*
* @author Bilal Gultekin <bilal@gultekin.me>
* @author Justin Hartman <justin@22digital.co.za>
* @copyright 2019 22 Digital
* @license MIT
* @since v0.1
*/
namespace TwentyTwoDigital\CashierFastspring\Listeners;

use TwentyTwoDigital\CashierFastspring\Events;
Expand All @@ -14,13 +22,15 @@
* and bill details to your customers.
*
* IMPORTANT: This class handles expansion enabled webhooks.
*
* {@inheritDoc}
*/
class SubscriptionChargeCompleted extends Base
{
/**
* Create the event listener.
*
* @return void
* @return null
*/
public function __construct()
{
Expand Down
14 changes: 12 additions & 2 deletions src/Listeners/SubscriptionDeactivated.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php

/**
* This file implements Subscription Deactivated.
*
* @author Bilal Gultekin <bilal@gultekin.me>
* @author Justin Hartman <justin@22digital.co.za>
* @copyright 2019 22 Digital
* @license MIT
* @since v0.1
*/
namespace TwentyTwoDigital\CashierFastspring\Listeners;

use TwentyTwoDigital\CashierFastspring\Events;
Expand All @@ -8,13 +16,15 @@
/**
* This class is a listener for subscription deactivation events.
* It deactivated fastspring subscription and create another local, free one.
*
* {@inheritDoc}
*/
class SubscriptionDeactivated extends Base
{
/**
* Create the event listener.
*
* @return void
* @return null
*/
public function __construct()
{
Expand Down
14 changes: 12 additions & 2 deletions src/Listeners/SubscriptionStateChanged.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php

/**
* This file implements Subscription State Changed.
*
* @author Bilal Gultekin <bilal@gultekin.me>
* @author Justin Hartman <justin@22digital.co.za>
* @copyright 2019 22 Digital
* @license MIT
* @since v0.1
*/
namespace TwentyTwoDigital\CashierFastspring\Listeners;

use TwentyTwoDigital\CashierFastspring\Events;
Expand All @@ -13,13 +21,15 @@
* It updates related subscription event.
*
* IMPORTANT: This class handles expansion enabled webhooks.
*
* {@inheritDoc}
*/
class SubscriptionStateChanged extends Base
{
/**
* Create the event listener.
*
* @return void
* @return null
*/
public function __construct()
{
Expand Down

0 comments on commit 18c0380

Please sign in to comment.