Skip to content

Commit

Permalink
Fix formatting issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Oct 1, 2024
1 parent e75dc9a commit cc2206a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions includes/class-wc-gateway-payfast.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function __construct() {
add_filter( 'nocache_headers', array( $this, 'no_store_cache_headers' ) );

// Validate the gateway credentials.
add_filter( 'update_option_woocommerce_payfast_settings', array( $this, 'validate_payfast_credentials' ) , 10, 2 );
add_filter( 'update_option_woocommerce_payfast_settings', array( $this, 'validate_payfast_credentials' ), 10, 2 );
}

/**
Expand Down Expand Up @@ -1880,13 +1880,16 @@ public function validate_payfast_credentials( $old_settings, $settings ) {

// Check Payfast server response if the response code is not 200 then show an error message.
if ( 200 !== wp_remote_retrieve_response_code( $results ) ) {
add_action( 'admin_notices', function () {
?>
<div class="notice notice-error is-dismissible">
<p><?php esc_html_e( 'Invalid Payfast credentials. Please verify and enter the correct details.', 'woocommerce-gateway-payfast' ); ?></p>
</div>
<?php
});
add_action(
'admin_notices',
function () {
?>
<div class="notice notice-error is-dismissible">
<p><?php esc_html_e( 'Invalid Payfast credentials. Please verify and enter the correct details.', 'woocommerce-gateway-payfast' ); ?></p>
</div>
<?php
}
);
}
}
}

0 comments on commit cc2206a

Please sign in to comment.