mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
Show if PPEC was used in status report
This commit is contained in:
parent
195474ad6e
commit
b8b4766fba
2 changed files with 19 additions and 0 deletions
|
@ -29,6 +29,15 @@ class PPECHelper {
|
|||
const PPEC_SETTINGS_OPTION_NAME = 'woocommerce_ppec_paypal_settings';
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the PayPal Express Checkout plugin was configured previously.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_plugin_configured() {
|
||||
return is_array( get_option( self::PPEC_SETTINGS_OPTION_NAME ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the PayPal Express Checkout plugin is active.
|
||||
*
|
||||
|
|
|
@ -19,6 +19,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
|||
use WooCommerce\PayPalCommerce\ApiClient\Helper\CurrencySupport;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies;
|
||||
use WooCommerce\PayPalCommerce\Button\Helper\MessagesApply;
|
||||
use WooCommerce\PayPalCommerce\Compat\PPEC\PPECHelper;
|
||||
use WooCommerce\PayPalCommerce\Onboarding\State;
|
||||
|
||||
/**
|
||||
|
@ -66,6 +67,8 @@ class StatusReportModule implements ModuleInterface {
|
|||
/* @var Renderer $renderer The renderer. */
|
||||
$renderer = $c->get( 'status-report.renderer' );
|
||||
|
||||
$had_ppec_plugin = PPECHelper::is_plugin_configured();
|
||||
|
||||
$items = array(
|
||||
array(
|
||||
'label' => esc_html__( 'Onboarded', 'woocommerce-paypal-payments' ),
|
||||
|
@ -114,6 +117,13 @@ class StatusReportModule implements ModuleInterface {
|
|||
$settings->has( 'logging_enabled' ) && $settings->get( 'logging_enabled' )
|
||||
),
|
||||
),
|
||||
array(
|
||||
'label' => esc_html__( 'Used PayPal Checkout plugin', 'woocommerce-paypal-payments' ),
|
||||
'description' => esc_html__( 'Whether the PayPal Checkout Gateway plugin was configured previously or not', 'woocommerce-paypal-payments' ),
|
||||
'value' => $this->bool_to_text(
|
||||
$had_ppec_plugin
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
echo wp_kses_post(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue