Skip to content

Commit

Permalink
T2523 webhook (#2)
Browse files Browse the repository at this point in the history
* Ref T2523 - new webhook

* Ref T2523 - new webhook

* Ref T2523 - Add webhook to list

* Ref T2523 - Typo

* Ref T2523 - Update webhook
  • Loading branch information
Jleagle authored and bajb committed Mar 20, 2017
1 parent f027144 commit d1bbf0a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Events/TransactionWHE.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
namespace Fortifi\Webhooks\Events;

final class TransactionWHE
{
const FAILED = 'transaction.failed';
}
16 changes: 16 additions & 0 deletions src/Payloads/Transaction/TransactionFailedWHP.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
namespace Fortifi\Webhooks\Payloads\Transaction;

use Fortifi\Webhooks\Payloads\Foundation\DataNodeWHP;

class TransactionFailedWHP extends DataNodeWHP
{
public $subscriptionFids = [];
public $attemptNumber;
public $amount;
public $amountUsd;
public $exchangeRate;
public $transactionDate;
public $errorStatus;
public $customerFid;
}
3 changes: 3 additions & 0 deletions src/Webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Fortifi\Webhooks\Events\PaymentAccountWHE;
use Fortifi\Webhooks\Events\PaymentWHE;
use Fortifi\Webhooks\Events\PurchaseWHE;
use Fortifi\Webhooks\Events\TransactionWHE;
use Fortifi\Webhooks\Payloads\Advertiser\AdvertiserCreatedWHP;
use Fortifi\Webhooks\Payloads\Advertiser\Campaign\AdvertiserCampaignCreatedWHP;
use Fortifi\Webhooks\Payloads\Customer\CustomerCreatedWHP;
Expand All @@ -31,6 +32,7 @@
use Fortifi\Webhooks\Payloads\Purchase\PurchaseRefundWHP;
use Fortifi\Webhooks\Payloads\Purchase\PurchaseStateChangedWHP;
use Fortifi\Webhooks\Payloads\Purchase\PurchaseSubscriptionRenewWHP;
use Fortifi\Webhooks\Payloads\Transaction\TransactionFailedWHP;
use Packaged\Helpers\Objects;

class Webhooks
Expand Down Expand Up @@ -74,6 +76,7 @@ public static function all()
PurchaseWHE::STATE_CHANGE => PurchaseStateChangedWHP::class,
PurchaseWHE::SUBSCRIPTION_RENEW => PurchaseSubscriptionRenewWHP::class,
PurchaseWHE::AUTO_CHARGE_STATE_UPDATED => PurchaseAutoChargeStateChangedWHP::class,
TransactionWHE::FAILED => TransactionFailedWHP::class,
];
}

Expand Down

0 comments on commit d1bbf0a

Please sign in to comment.