Skip to content

Commit

Permalink
repositioned auto post installation call
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulwahidsharief committed Dec 27, 2024
1 parent d3ac4a8 commit 2b6490c
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,21 @@ public function createOrGetRazorpayOrderId($order, $orderId, $is1ccCheckout = 'n
{
try
{
// Every hour post installation check
$getPostInstallationFlag = get_option('rzp_post_installation_update_at');
if (empty($getPostInstallationFlag) == false)
{
if ($getPostInstallationFlag + 3600 < time())
{
$this->autoPostInstallationCheck();
}
}
else
{
update_option('rzp_post_installation_update_at', $time);
$this->autoPostInstallationCheck();
}

return $this->createRazorpayOrderId($orderId, $sessionKey);
}
// For the bad request errors, it's safe to show the message to the customer.
Expand Down Expand Up @@ -1653,21 +1668,6 @@ protected function createRazorpayOrderId($orderId, $sessionKey)
$this->autoEnableWebhook();
}

// Every hour post installation check
$getPostInstallationFlag = get_option('rzp_post_installation_update_at');
if (empty($getPostInstallationFlag) == false)
{
if ($getPostInstallationFlag + 3600 < time())
{
$this->autoPostInstallationCheck();
}
}
else
{
update_option('rzp_post_installation_update_at', $time);
$this->autoPostInstallationCheck();
}

$razorpayOrderId = $razorpayOrder['id'];

// Storing the razorpay order id in transient for 5 hours time.
Expand Down

0 comments on commit 2b6490c

Please sign in to comment.