mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Add check for empty brand name and disable gateway if error message
This commit is contained in:
parent
763e1e287c
commit
dee2c66f14
1 changed files with 6 additions and 1 deletions
|
@ -509,13 +509,18 @@ class PayUponInvoice {
|
|||
) {
|
||||
$error_messages = array();
|
||||
$pui_gateway = WC()->payment_gateways->payment_gateways()[ PayUponInvoiceGateway::ID ];
|
||||
if ( $pui_gateway->get_option( 'brand_name' ) === '' ) {
|
||||
$error_messages[] = esc_html__( 'Could not enable gateway because "Brand name" field is empty.', 'woocommerce-paypal-payments' );
|
||||
}
|
||||
if ( $pui_gateway->get_option( 'logo_url' ) === '' ) {
|
||||
$error_messages[] = esc_html__( 'Could not enable gateway because "Logo URL" field is empty.', 'woocommerce-paypal-payments' );
|
||||
}
|
||||
if ( $pui_gateway->get_option( 'customer_service_instructions' ) === '' ) {
|
||||
$error_messages[] = esc_html__( 'Could not enable gateway because "Customer service instructions" field is empty.', 'woocommerce-paypal-payments' );
|
||||
}
|
||||
if ( count( $error_messages ) > 0 ) { ?>
|
||||
if ( count( $error_messages ) > 0 ) {
|
||||
$pui_gateway->update_option( 'enabled', 'no' );
|
||||
?>
|
||||
<div class="notice notice-error">
|
||||
<?php
|
||||
array_map(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue