Skip to content

Commit

Permalink
removed echo statements put for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitcbr committed May 27, 2024
1 parent 9369b14 commit 54da3dc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
1 change: 0 additions & 1 deletion tests/phpunit/tests/test-methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public function testReceiptPage()
$orderId = $order->get_id();

$this->instance->shouldReceive('autoEnableWebhook');
echo 'orderId in testReceiptPage: '.$orderId;
$razorpayOrderId=$this->instance->shouldReceive('createOrGetRazorpayOrderId')->andReturn('order_test');

$this->instance->shouldReceive('getRazorpayApiPublicInstance')->andReturnUsing(function () {
Expand Down
8 changes: 0 additions & 8 deletions tests/phpunit/tests/test-order-methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,6 @@ public function testProcessRefund()
function () {
return new MockApi('key_id_2', 'key_secret2');
});
if(! $order)
{
echo 'order is null';
}
if(! $order->get_transaction_id())
{
echo 'order transaction_id is null: '.$order->get_transaction_id();
}

$response = $this->instance->process_refund($wcOrderId, 25.25, "not interested anymore");

Expand Down
14 changes: 0 additions & 14 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,6 @@ public function createOrGetRazorpayOrderId($order, $orderId, $is1ccCheckout = 'n
global $woocommerce;
rzpLogInfo("createOrGetRazorpayOrderId $orderId and is1ccCheckout is set to $is1ccCheckout");

echo "createOrGetRazorpayOrderId " . $orderId . " and is1ccCheckout is set to " . $is1ccCheckout;

$create = false;

if($is1ccCheckout == 'no')
Expand Down Expand Up @@ -1052,7 +1050,6 @@ protected function getRazorpayPaymentParams($order, $orderId)

rzpLogInfo("getRazorpayPaymentParams $orderId");
$razorpayOrderId = $this->createOrGetRazorpayOrderId($order, $orderId);
echo 'createOrGetRazorpayOrderId with order: ' . json_encode($order) . ' and orderId: ' . $orderId . ' and $razorpayOrderId: ' . $razorpayOrderId;

if ($razorpayOrderId === null)
{
Expand All @@ -1077,12 +1074,10 @@ protected function getRazorpayPaymentParams($order, $orderId)
public function generate_razorpay_form($orderId)
{
$order = wc_get_order($orderId);
echo 'generate_razorpay_form with orderId: ' . $orderId . ' and order: ' . json_encode($order);

try
{
$params = $this->getRazorpayPaymentParams($order, $orderId);
echo '$params from getRazorpayPaymentParams: ' . json_encode($params);
}
catch (Exception $e)
{
Expand Down Expand Up @@ -1523,18 +1518,14 @@ public function process_refund($orderId, $amount = null, $reason = '')
{
$order = wc_get_order($orderId);

echo 'process refund: line 1526: orderId: '.$orderId.' amount: '.$amount.' reason: '.$reason;

if (! $order or ! $order->get_transaction_id())
{
return new WP_Error('error', __('Refund failed: No transaction ID', 'woocommerce'));
}
echo 'process refund: line 1532';

$client = $this->getRazorpayApiInstance();

$paymentId = $order->get_transaction_id();
echo 'process refund: line 1538: paymentId: '.$paymentId;

$data = array(
'amount' => (int) round($amount * 100),
Expand All @@ -1554,18 +1545,14 @@ public function process_refund($orderId, $amount = null, $reason = '')

if (isset($refund) === true)
{
echo 'process refund: line 1559';

$order->add_order_note(__('Refund Id: ' . $refund->id, 'woocommerce'));
echo 'process refund: line 1562';

/**
* @var $refund ->id -- Provides the RazorPay Refund ID
* @var $orderId -> Refunded Order ID
* @var $refund -> WooCommerce Refund Instance.
*/
do_action('woo_razorpay_refund_success', $refund->id, $orderId, $refund);
echo 'process refund: line 1570';

rzpLogInfo('Refund ID = ' . $refund->id .
' , Refund speed requested = ' . $refund->speed_requested .
Expand All @@ -1576,7 +1563,6 @@ public function process_refund($orderId, $amount = null, $reason = '')
}
catch(Exception $e)
{
echo 'error message: line 1582: '.$e->getMessage();
return new WP_Error('error', __($e->getMessage(), 'woocommerce'));
}
}
Expand Down

0 comments on commit 54da3dc

Please sign in to comment.