From 1c47ebda9b3fd5468308b01232ac74d98b4fa9d8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:31:02 +0000 Subject: [PATCH 1/3] Initial plan for issue From 2c76d1ec48d22164fec3840582d3dd188f8f98b1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:37:43 +0000 Subject: [PATCH 2/3] Enable WooCommerce blocks checkout support Co-authored-by: nomanualdev <18367936+nomanualdev@users.noreply.github.com> --- includes/class-mojito-sinpe-gateway-block.php | 6 +++--- includes/class-mojito-sinpe.php | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/includes/class-mojito-sinpe-gateway-block.php b/includes/class-mojito-sinpe-gateway-block.php index 06400ce..ff4fae4 100644 --- a/includes/class-mojito-sinpe-gateway-block.php +++ b/includes/class-mojito-sinpe-gateway-block.php @@ -48,9 +48,9 @@ public function get_payment_method_script_handles() { } public function get_payment_method_data() { return [ - 'title' => $this->get_setting( 'title' ), - 'description' => $this->get_setting( 'description' ), - 'supports' => $this->get_supported_features(), + 'title' => $this->gateway->get_option( 'title' ), + 'description' => $this->gateway->get_option( 'description' ), + 'supports' => $this->gateway->supports, ]; } diff --git a/includes/class-mojito-sinpe.php b/includes/class-mojito-sinpe.php index 6855a6e..8f3c16c 100644 --- a/includes/class-mojito-sinpe.php +++ b/includes/class-mojito-sinpe.php @@ -164,7 +164,6 @@ function(){ ); // Hook the custom function to the 'woocommerce_blocks_loaded' action - /* Working on it, not ready yet add_action( 'woocommerce_blocks_loaded', function(){ // Check if the required class exists @@ -172,7 +171,6 @@ function(){ return; } - // Include the custom Blocks Checkout class require_once MOJITO_SINPE_DIR . 'includes/class-mojito-sinpe-gateway-block.php'; @@ -180,12 +178,11 @@ function(){ add_action( 'woocommerce_blocks_payment_method_type_registration', function( \Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { - // Register an instance of My_Custom_Gateway_Blocks + // Register an instance of Mojito_Sinpe_Gateway_Block $payment_method_registry->register( new Mojito_Sinpe_Gateway_Block() ); } ); } ); - */ } From 8a3a330b0214dea1aa51bd5a29473b4b30364460 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:40:26 +0000 Subject: [PATCH 3/3] Add version number to script registration and clean up formatting Co-authored-by: nomanualdev <18367936+nomanualdev@users.noreply.github.com> --- includes/class-mojito-sinpe-gateway-block.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/includes/class-mojito-sinpe-gateway-block.php b/includes/class-mojito-sinpe-gateway-block.php index ff4fae4..92b8b66 100644 --- a/includes/class-mojito-sinpe-gateway-block.php +++ b/includes/class-mojito-sinpe-gateway-block.php @@ -39,12 +39,10 @@ public function get_payment_method_script_handles() { 'wp-html-entities', 'wp-i18n', ], - null, + '1.2.0', true ); return [ 'moji-sinpe-checkout-js' ]; - - } public function get_payment_method_data() { return [