Changeset 3399339
- Timestamp:
- 11/20/2025 03:15:45 AM (5 months ago)
- Location:
- maaly-pay
- Files:
-
- 4 edited
-
assets/js/maaly-pay.js (modified) (1 diff)
-
trunk/assets/js/maaly-pay.js (modified) (1 diff)
-
trunk/includes/class-maaly-pay-gateway.php (modified) (2 diffs)
-
trunk/maaly-pay.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
maaly-pay/assets/js/maaly-pay.js
r3399333 r3399339 15 15 edit: null, 16 16 canMakePayment: () => true, 17 supports: {18 features: [],19 style: [],20 },21 17 }; 22 18 -
maaly-pay/trunk/assets/js/maaly-pay.js
r3399333 r3399339 15 15 edit: null, 16 16 canMakePayment: () => true, 17 supports: {18 features: [],19 style: [],20 },21 17 }; 22 18 -
maaly-pay/trunk/includes/class-maaly-pay-gateway.php
r3399281 r3399339 18 18 $this->method_description = __('Accept cryptocurrency payments via Maaly Pay.', 'maaly-pay'); 19 19 20 $this->supports = array( 21 'products', 22 ); 23 20 24 $this->init_form_fields(); 21 25 $this->init_settings(); … … 25 29 $this->enabled = $this->get_option('enabled', 'yes'); 26 30 add_action('woocommerce_update_options_payment_gateways_' . $this->id, [$this, 'process_admin_options']); 27 }28 29 public function is_available()30 {31 if ($this->enabled !== 'yes') {32 return false;33 }34 35 // Check if WooCommerce is available36 if (!WC() || !WC()->cart) {37 return false;38 }39 40 // Check if cart needs payment41 if (!WC()->cart->needs_payment()) {42 return false;43 }44 45 return true;46 31 } 47 32 -
maaly-pay/trunk/maaly-pay.php
r3399323 r3399339 37 37 require_once MAALY_PAY_PLUGIN_DIR . 'includes/class-maaly-pay-admin.php'; 38 38 require_once MAALY_PAY_PLUGIN_DIR . 'includes/class-maaly-pay-frontend.php'; 39 require_once MAALY_PAY_PLUGIN_DIR . 'includes/class-maaly-pay-gateway.php'; 39 40 40 41 // Initialize frontend 41 Maaly_Pay_Frontend::init(); 42 43 add_action('woocommerce_blocks_loaded', 'maalypayplugin_register_gateway_block_support'); 42 // Maaly_Pay_Frontend::init(); 44 43 45 44 // Fix checkout page template issues … … 152 151 // REGISTER PAYMENT GATEWAY (FIXED) 153 152 // ----------------------------------------------------------------------------- 154 // add_action('plugins_loaded', 'maaly_pay_init_gateway', 0); 155 add_action('woocommerce_loaded', 'maaly_pay_init_gateway', 0); 153 add_action('plugins_loaded', 'maaly_pay_init_gateway', 0); 154 // add_action('woocommerce_loaded', 'maaly_pay_init_gateway', 0); 155 156 add_filter('woocommerce_payment_gateways', 'maaly_pay_add_gateway_class'); 157 158 add_action('woocommerce_blocks_loaded', 'maalypayplugin_register_gateway_block_support'); 156 159 157 160 function maaly_pay_init_gateway() … … 166 169 return; 167 170 } 168 169 require_once MAALY_PAY_PLUGIN_DIR . 'includes/class-maaly-pay-gateway.php';170 add_filter('woocommerce_payment_gateways', 'maaly_pay_add_gateway_class');171 171 172 172 $initialized = true;
Note: See TracChangeset
for help on using the changeset viewer.