Add GooglePlay preview in admin settings.

This commit is contained in:
Pedro Silva 2023-09-21 11:58:51 +01:00
parent 5ca0e16b5b
commit 08d8cded5b
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
10 changed files with 208 additions and 13 deletions

View file

@ -66,6 +66,21 @@ class GooglepayModule implements ModuleInterface {
}
);
add_action(
'admin_enqueue_scripts',
static function () use ( $c, $button ) {
if ( ! is_admin() ) {
return;
}
/**
* Should add this to the ButtonInterface.
*
* @psalm-suppress UndefinedInterfaceMethod
*/
$button->enqueue_admin();
}
);
add_action(
'woocommerce_blocks_payment_method_type_registration',
function( PaymentMethodRegistry $payment_method_registry ) use ( $c, $button ): void {
@ -75,6 +90,16 @@ class GooglepayModule implements ModuleInterface {
}
);
add_action(
'woocommerce_paypal_payments_admin_gateway_settings',
function( array $settings ) use ( $c, $button ): array {
if ( is_array( $settings['components'] ) ) {
$settings['components'][] = 'googlepay';
}
return $settings;
}
);
// Clear product status handling.
add_action(
'woocommerce_paypal_payments_clear_apm_product_status',