Skip to content

Commit

Permalink
DEV-499 Add messenger + messenger bounce webhook definition (#31)
Browse files Browse the repository at this point in the history
* DEV-499 Add messenger + messenger bounce webhook definition

* Add class
  • Loading branch information
MrEssex authored Oct 31, 2023
1 parent 69cfde0 commit c256aab
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Events/MessengerWHE.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
namespace Fortifi\Webhooks\Events;

final class MessengerWHE
{
const BOUNCED = 'messenger.bounced';
}
9 changes: 9 additions & 0 deletions src/Payloads/Messenger/MessengerBouncedWHP.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
namespace Fortifi\Webhooks\Payloads\Messenger;

class MessengerBouncedWHP extends MessengerWHP
{
public $type;
public $reason;
public $message;
}
13 changes: 13 additions & 0 deletions src/Payloads/Messenger/MessengerWHP.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
namespace Fortifi\Webhooks\Payloads\Messenger;

use Fortifi\Webhooks\Payloads\Foundation\DataNodeWHP;

class MessengerWHP extends DataNodeWHP
{
public $customerFid;
public $emailAddress;
public $deliveryFid;
public $companyFid;
public $emailFid;
}
3 changes: 3 additions & 0 deletions src/Webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Fortifi\Webhooks\Events\CustomerWHE;
use Fortifi\Webhooks\Events\EmployeeWHE;
use Fortifi\Webhooks\Events\InvoiceWHE;
use Fortifi\Webhooks\Events\MessengerWHE;
use Fortifi\Webhooks\Events\OrderWHE;
use Fortifi\Webhooks\Events\PaymentAccountWHE;
use Fortifi\Webhooks\Events\PaymentWHE;
Expand All @@ -26,6 +27,7 @@
use Fortifi\Webhooks\Payloads\Invoice\InvoicePaidWHP;
use Fortifi\Webhooks\Payloads\Invoice\InvoiceTransactionWHP;
use Fortifi\Webhooks\Payloads\Invoice\InvoiceWHP;
use Fortifi\Webhooks\Payloads\Messenger\MessengerBouncedWHP;
use Fortifi\Webhooks\Payloads\Order\OrderCreatedWHP;
use Fortifi\Webhooks\Payloads\Order\OrderStateChangedWHP;
use Fortifi\Webhooks\Payloads\Payment\PaymentAuthorisationTransactionWHP;
Expand Down Expand Up @@ -105,6 +107,7 @@ public static function all()
EmployeeWHE::AUTH => EmployeeAuthWHP::class,
ChargebackWHE::CREATED => ChargebackWHP::class,
ChargebackWHE::ACTIONED => ChargebackActionWHP::class,
MessengerWHE::BOUNCED => MessengerBouncedWHP::class
];
}

Expand Down

0 comments on commit c256aab

Please sign in to comment.