diff --git a/includes/Framework/PaymentGateway/Payment_Gateway.php b/includes/Framework/PaymentGateway/Payment_Gateway.php index f6a15cf6..8ba64c19 100644 --- a/includes/Framework/PaymentGateway/Payment_Gateway.php +++ b/includes/Framework/PaymentGateway/Payment_Gateway.php @@ -380,6 +380,7 @@ public function __construct( $id, $plugin, $args ) { // Enqueue the necessary scripts & styles add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); + add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // <=-- <=-- // add API request logging $this->add_api_request_logging(); diff --git a/includes/Gateway/Digital_Wallet.php b/includes/Gateway/Digital_Wallet.php index 34306d3e..878cfeae 100644 --- a/includes/Gateway/Digital_Wallet.php +++ b/includes/Gateway/Digital_Wallet.php @@ -60,6 +60,7 @@ public function __construct( $gateway ) { if ( 'yes' === $gateway->get_option( 'enabled', 'no' ) && $this->is_digital_wallet_enabled() ) { add_action( 'wp', array( $this, 'init' ) ); + add_action( 'admin_init', array( $this, 'init' ) ); add_action( 'admin_notices', array( $this, 'admin_notices' ) ); } @@ -125,7 +126,7 @@ public function init() { add_action( 'before_woocommerce_pay', array( $this, 'render_button' ) ); } - $page = $this->get_current_page(); + $page = is_admin() ? 'checkout' : $this->get_current_page(); $payment_request = false; try { diff --git a/src/blocks/digital-wallets/index.js b/src/blocks/digital-wallets/index.js index 1ef382d5..899542e8 100644 --- a/src/blocks/digital-wallets/index.js +++ b/src/blocks/digital-wallets/index.js @@ -9,7 +9,7 @@ const squareDigitalWalletsMethod = { name: 'square-credit-card', paymentMethodId: 'square_credit_card', content: , - edit: , + edit: , canMakePayment: () => { const isSquareConnected = getSquareServerData().applicationId &&