Skip to content

Commit

Permalink
feat: handle webhook notification for customer merchant product sunsc…
Browse files Browse the repository at this point in the history
…ription update
  • Loading branch information
ravinderk committed Aug 7, 2023
1 parent a434c00 commit df4406f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Give\PaymentGateways\PayPalCommerce\Webhooks\Listeners\PayPalCommerce;

use Give\PaymentGateways\PayPalCommerce\onBoardingRedirectHandler;

/**
* Class PaymentCaptureCompleted
* @package Give\PaymentGateways\PayPalCommerce\Webhooks\Listeners\PayPalCommerce
*
* @unreleased
*/
class CustomerMerchantIntegrationProductSubscriptionUpdated extends PaymentEventListener
{
/**
* @inheritDoc
*/
public function processEvent($event)
{
// Refresh account status.
give(onBoardingRedirectHandler::class)->refreshAccountStatus();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Give\Framework\Exceptions\Primitives\InvalidArgumentException;
use Give\PaymentGateways\PayPalCommerce\Webhooks\Listeners\EventListener;
use Give\PaymentGateways\PayPalCommerce\Webhooks\Listeners\PayPalCommerce\CustomerMerchantIntegrationProductSubscriptionUpdated;
use Give\PaymentGateways\PayPalCommerce\Webhooks\Listeners\PayPalCommerce\PaymentCaptureCompleted;
use Give\PaymentGateways\PayPalCommerce\Webhooks\Listeners\PayPalCommerce\PaymentCaptureDenied;
use Give\PaymentGateways\PayPalCommerce\Webhooks\Listeners\PayPalCommerce\PaymentCaptureRefunded;
Expand All @@ -24,6 +25,7 @@ class WebhookRegister
'PAYMENT.CAPTURE.REFUNDED' => PaymentCaptureRefunded::class,
'PAYMENT.CAPTURE.COMPLETED' => PaymentCaptureCompleted::class,
'PAYMENT.CAPTURE.DENIED' => PaymentCaptureDenied::class,
'CUSTOMER.MERCHANT-INTEGRATION.PRODUCT-SUBSCRIPTION-UPDATED' => CustomerMerchantIntegrationProductSubscriptionUpdated::class,
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,10 @@ private function didWeGetValidSellerRestApiCredentials($array)
/**
* Handles the request for refreshing the account status
*
* @unreleased Make function publicly accessible.
* @since 2.9.0
*/
private function refreshAccountStatus()
public function refreshAccountStatus()
{
$merchantDetails = $this->merchantRepository->getDetails();

Expand Down

0 comments on commit df4406f

Please sign in to comment.