Skip to content

Commit

Permalink
DEV-512: Add webhook when the default email changes. (#32)
Browse files Browse the repository at this point in the history
* New webhook

* Add to registry

* Format
  • Loading branch information
Jleagle authored Nov 8, 2023
1 parent c256aab commit fc2262a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Events/CustomerWHE.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ final class CustomerWHE
const CREATED = 'customer.created';
const SUBJECT_ACCESS_REQUEST = 'customer.sar';
const EMAIL_UNSUBSCRIBED = 'customer.email.unsubscribed';
const DEFAULT_EMAIL_UPDATED = 'customer.default-email.updated';
}
9 changes: 9 additions & 0 deletions src/Payloads/Customer/CustomerDefaultEmailChangedWHP.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
namespace Fortifi\Webhooks\Payloads\Customer;

use Fortifi\Webhooks\Payloads\FortifiWebhookPayload;

class CustomerDefaultEmailChangedWHP extends CustomerWHP
{
public $emailFid;
}
4 changes: 3 additions & 1 deletion src/Webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Fortifi\Webhooks\Payloads\Chargeback\ChargebackWHP;
use Fortifi\Webhooks\Payloads\Contact\ContactPhoneWHP;
use Fortifi\Webhooks\Payloads\Customer\CustomerCreatedWHP;
use Fortifi\Webhooks\Payloads\Customer\CustomerDefaultEmailChangedWHP;
use Fortifi\Webhooks\Payloads\Customer\CustomerEmailUnsubscribedWHP;
use Fortifi\Webhooks\Payloads\Customer\SubjectAccessRequestWHP;
use Fortifi\Webhooks\Payloads\Employee\EmployeeAuthWHP;
Expand Down Expand Up @@ -74,6 +75,7 @@ public static function all()
CustomerWHE::CREATED => CustomerCreatedWHP::class,
CustomerWHE::EMAIL_UNSUBSCRIBED => CustomerEmailUnsubscribedWHP::class,
CustomerWHE::SUBJECT_ACCESS_REQUEST => SubjectAccessRequestWHP::class,
CustomerWHE::DEFAULT_EMAIL_UPDATED => CustomerDefaultEmailChangedWHP::class,
ContactWHE::PHONE_SUBSCRIBED => ContactPhoneWHP::class,
ContactWHE::PHONE_UNSUBSCRIBED => ContactPhoneWHP::class,
InvoiceWHE::CREATED => InvoiceWHP::class,
Expand Down Expand Up @@ -107,7 +109,7 @@ public static function all()
EmployeeWHE::AUTH => EmployeeAuthWHP::class,
ChargebackWHE::CREATED => ChargebackWHP::class,
ChargebackWHE::ACTIONED => ChargebackActionWHP::class,
MessengerWHE::BOUNCED => MessengerBouncedWHP::class
MessengerWHE::BOUNCED => MessengerBouncedWHP::class,
];
}

Expand Down

0 comments on commit fc2262a

Please sign in to comment.