diff --git a/includes/razorpay-webhook.php b/includes/razorpay-webhook.php index f84b28e5..64a9565a 100644 --- a/includes/razorpay-webhook.php +++ b/includes/razorpay-webhook.php @@ -83,10 +83,8 @@ public function process() if ($this->shouldConsumeWebhook($data) === false) { return; } - if (isset($_SERVER['HTTP_X_RAZORPAY_SIGNATURE']) === true) { - $razorpayWebhookSecret = $this->razorpay->getSetting('webhook_secret'); - + $razorpayWebhookSecret = get_option('rzp_webhook_secret'); // // If the webhook secret isn't set on wordpress, return // diff --git a/woo-razorpay.php b/woo-razorpay.php index b87ee3ec..e680cee9 100644 --- a/woo-razorpay.php +++ b/woo-razorpay.php @@ -306,7 +306,7 @@ public function autoEnableWebhook() $enabled = true; $alphanumericString = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-=~!@#$%^&*()_+,./<>?;:[]{}|abcdefghijklmnopqrstuvwxyz'; $secret = substr(str_shuffle($alphanumericString), 0, 20); - + update_option('rzp_webhook_secret', $secret); $getWebhookFlag = get_option('webhook_enable_flag'); $time = time();