Skip to content

Commit

Permalink
added getDisplayConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulwahidsharief committed Dec 11, 2024
1 parent 775240d commit 0be1c58
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,22 @@ public function generate_razorpay_form($orderId)
return $html;
}

public function getDisplayConfig()
{
$checkout360_status = get_option('rzp_checkout360_status');
$rzp_cod_intelligence_enable = get_option('rzp_cod_intelligence_enable');

if (isset($checkout360_status) === true and
$checkout360_status === 'yes' and
(empty($rzp_cod_intelligence_enable) === true or
$rzp_cod_intelligence_enable === 'no'))
{
return [$config['display']['hide'] = ['method' => 'cod']];
}

return [];
}

/**
* default parameters passed to checkout
* @param WC_Order $order WC Order
Expand All @@ -1494,15 +1510,7 @@ public function getDefaultCheckoutArguments($order)

$productinfo = "Order $orderId";

$config = [];

if (isset(get_option('rzp_checkout360_status')) === true and
get_option('rzp_checkout360_status') === 'yes' and
(empty(get_option('rzp_cod_intelligence_enable')) === true or
get_option('rzp_cod_intelligence_enable') === 'no'))
{
$config['display']['hide'] = ['method' => 'cod'];
}
$config = $this->getDisplayConfig();

return array(
'key' => $this->getSetting('key_id'),
Expand Down

0 comments on commit 0be1c58

Please sign in to comment.