mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge pull request #916 from woocommerce/PCP-742-1.9.0-test5]-when-brand-name-field-is-left-empty,-pui-purchase-fails
When Brand Name field is left empty, PUI purchase fails (742)
This commit is contained in:
commit
68a300e9fe
1 changed files with 6 additions and 1 deletions
|
@ -503,13 +503,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