Skip to content

Commit

Permalink
cod changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulwahidsharief committed Dec 11, 2024
1 parent 9c15d68 commit 775240d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -1494,10 +1494,14 @@ public function getDefaultCheckoutArguments($order)

$productinfo = "Order $orderId";

$hidePaymentMethods = [];
if (get_option('enable_cod_intelligence') === 'yes')
$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'))
{
$hidePaymentMethods['method'] = "cod";
$config['display']['hide'] = ['method' => 'cod'];
}

return array(
Expand All @@ -1512,13 +1516,7 @@ public function getDefaultCheckoutArguments($order)
'order_id' => $razorpayOrderId,
'callback_url' => $callbackUrl,
'prefill' => $this->getCustomerInfo($order),
'config'=> [
'display'=> [
'hide'=> [
$hidePaymentMethods
]
]
]
'config' => $config
);
}

Expand Down

0 comments on commit 775240d

Please sign in to comment.