Skip to content

Commit

Permalink
Merge pull request #302 from razorpay/subscription_failed_webhookevent
Browse files Browse the repository at this point in the history
Added pending and halted state Webhook event
  • Loading branch information
Hancil Sequeira authored Apr 12, 2022
2 parents bf824dd + 48cd449 commit e42ff4f
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions Controller/Payment/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function __construct(
public function execute()
{
$post = $this->getPostData();

if (json_last_error() !== 0)
{
return;
Expand Down Expand Up @@ -163,24 +163,16 @@ public function execute()
$subscriptionWebhook = new SubscriptionWebhook($this->logger);
return $subscriptionWebhook->processSubscriptionCharged($post);
}

case 'subscription.paused':
if(class_exists(SubscriptionWebhook::class)) {
$subscriptionWebhook = new SubscriptionWebhook($this->logger);
return $subscriptionWebhook->processSubscriptionAction($post);
}

case 'subscription.pending':
case 'subscription.halted':
case 'subscription.resumed':
if(class_exists(SubscriptionWebhook::class)) {
$subscriptionWebhook = new SubscriptionWebhook($this->logger);
return $subscriptionWebhook->processSubscriptionAction($post);
}

case 'subscription.cancelled':
if(class_exists(SubscriptionWebhook::class)) {
$subscriptionWebhook = new SubscriptionWebhook($this->logger);
return $subscriptionWebhook->processSubscriptionAction($post);
}
}

default:
return;
Expand Down

0 comments on commit e42ff4f

Please sign in to comment.