From df4406f49a4a1e18248aabcfb265c2488dcebd8f Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Mon, 7 Aug 2023 12:01:05 +0530 Subject: [PATCH] feat: handle webhook notification for customer merchant product sunscription update --- ...tIntegrationProductSubscriptionUpdated.php | 23 +++++++++++++++++++ .../Webhooks/WebhookRegister.php | 2 ++ .../onBoardingRedirectHandler.php | 3 ++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/PaymentGateways/PayPalCommerce/Webhooks/Listeners/PayPalCommerce/CustomerMerchantIntegrationProductSubscriptionUpdated.php diff --git a/src/PaymentGateways/PayPalCommerce/Webhooks/Listeners/PayPalCommerce/CustomerMerchantIntegrationProductSubscriptionUpdated.php b/src/PaymentGateways/PayPalCommerce/Webhooks/Listeners/PayPalCommerce/CustomerMerchantIntegrationProductSubscriptionUpdated.php new file mode 100644 index 0000000000..8be99afadc --- /dev/null +++ b/src/PaymentGateways/PayPalCommerce/Webhooks/Listeners/PayPalCommerce/CustomerMerchantIntegrationProductSubscriptionUpdated.php @@ -0,0 +1,23 @@ +refreshAccountStatus(); + } +} diff --git a/src/PaymentGateways/PayPalCommerce/Webhooks/WebhookRegister.php b/src/PaymentGateways/PayPalCommerce/Webhooks/WebhookRegister.php index 20c4aa06ba..a92c736015 100644 --- a/src/PaymentGateways/PayPalCommerce/Webhooks/WebhookRegister.php +++ b/src/PaymentGateways/PayPalCommerce/Webhooks/WebhookRegister.php @@ -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; @@ -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, ]; /** diff --git a/src/PaymentGateways/PayPalCommerce/onBoardingRedirectHandler.php b/src/PaymentGateways/PayPalCommerce/onBoardingRedirectHandler.php index 6c40f373db..60168dda5a 100644 --- a/src/PaymentGateways/PayPalCommerce/onBoardingRedirectHandler.php +++ b/src/PaymentGateways/PayPalCommerce/onBoardingRedirectHandler.php @@ -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();