Skip to content

Commit 1377424

Browse files
committed
Fix php notices
1 parent 044f984 commit 1377424

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

woocommerce-gateway-payu.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ function view_order( $order_id ) {
464464
$order = wc_get_order( $order_id );
465465
$payu_gateways = WC_Payu_Gateways::gateways_list();
466466
if ( in_array( $order->get_status(), [ 'on-hold', 'pending', 'failed' ] ) ) {
467-
if ( @$payu_gateways[ $order->get_payment_method() ] && isset( get_option( 'payu_settings_option_name' )['global_repayment'] ) ) {
467+
if ( isset($payu_gateways[ $order->get_payment_method() ]) && isset( get_option( 'payu_settings_option_name' )['global_repayment'] ) ) {
468468
$pay_now_url = add_query_arg( [
469469
'pay_for_order' => 'true',
470470
'key' => $order->get_order_key()
@@ -544,7 +544,7 @@ function filter_woocommerce_my_account_my_orders_actions( $actions, $order ) {
544544
get_option( 'payu_settings_option_name' )['global_default_on_hold_status']
545545
] ) ) {
546546
$payu_gateways = WC_Payu_Gateways::gateways_list();
547-
if ( @$payu_gateways[ $order->get_payment_method() ] && isset( get_option( 'payu_settings_option_name' )['global_repayment'] ) ) {
547+
if ( isset($payu_gateways[ $order->get_payment_method() ]) && isset( get_option( 'payu_settings_option_name' )['global_repayment'] ) ) {
548548
$actions['repayu'] = [
549549
'name' => __( 'Pay with PayU', 'woo-payu-payment-gateway' ),
550550
'url' => wc_get_endpoint_url( 'order-pay', $order->get_id(),
@@ -565,7 +565,7 @@ function wc_order_item_add_action_buttons_callback( $order ) {
565565
$payu_gateways = WC_Payu_Gateways::gateways_list();
566566
$payuOrderStatus = $order->get_meta( '_payu_order_status', false, '' );
567567

568-
if ( @$payu_gateways[ $order->get_payment_method() ] && ! isset( get_option( 'payu_settings_option_name' )['global_repayment'] ) && $payuOrderStatus ) {
568+
if ( isset($payu_gateways[ $order->get_payment_method() ]) && ! isset( get_option( 'payu_settings_option_name' )['global_repayment'] ) && $payuOrderStatus ) {
569569
$payu_statuses = WC_Payu_Gateways::clean_payu_statuses( $payuOrderStatus );
570570
if ( ( ! in_array( OpenPayuOrderStatus::STATUS_COMPLETED,
571571
$payu_statuses ) && ! in_array( OpenPayuOrderStatus::STATUS_CANCELED,

0 commit comments

Comments
 (0)