Changeset 3476008
- Timestamp:
- 03/06/2026 12:39:19 AM (3 weeks ago)
- Location:
- advanced-emt-payment-gateway/trunk
- Files:
-
- 5 edited
-
advanced-emt-payment-gateway.php (modified) (1 diff)
-
assets/build/emt-block-v2.js (modified) (1 diff)
-
blocks/class-advanced-emt-blocks.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
resources/index.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-emt-payment-gateway/trunk/advanced-emt-payment-gateway.php
r3474032 r3476008 5 5 * Plugin URI: https://wordpress.org/plugins/advanced-emt-payment-gateway/ 6 6 * Description: Accept Interac e-Transfer / Email Money Transfer (EMT) in WooCommerce with dynamic secret answers, order notes, and customizable instructions. Supports Block and Classic checkout. 7 * Version: 2.0. 47 * Version: 2.0.5 8 8 * Author: CaphLabs 9 9 * Author URI: https://profiles.wordpress.org/ipodguy79/ -
advanced-emt-payment-gateway/trunk/assets/build/emt-block-v2.js
r3474032 r3476008 92 92 } 93 93 94 const contentElement = el( 'div', {}, ...contentParts ); 95 94 96 registerPaymentMethod( { 95 97 name: 'advanced_emt', 96 98 label: labelContent, 97 99 ariaLabel: title, 98 content: el( 'div', {}, ...contentParts ),99 edit: null,100 content: contentElement, 101 edit: contentElement, 100 102 canMakePayment: () => true, 101 supports: [ 'products' ], 103 supports: { 104 features: [ 'products' ], 105 }, 102 106 } ); 103 107 } ); -
advanced-emt-payment-gateway/trunk/blocks/class-advanced-emt-blocks.php
r3474032 r3476008 58 58 59 59 public function get_payment_method_data() { 60 $gateway = WC()->payment_gateways->payment_gateways()['advanced_emt'] ?? null; 61 if (!$gateway) return []; 60 // Checkout block editor previews can execute this before gateways are fully initialized. 61 // Return empty data instead of throwing fatal errors in that context. 62 if ( ! function_exists( 'WC' ) || ! WC() ) { 63 return []; 64 } 65 66 $payment_gateways = WC()->payment_gateways(); 67 if ( ! $payment_gateways || ! method_exists( $payment_gateways, 'payment_gateways' ) ) { 68 return []; 69 } 70 71 $registered_gateways = $payment_gateways->payment_gateways(); 72 $gateway = $registered_gateways['advanced_emt'] ?? null; 73 if ( ! $gateway ) { 74 return []; 75 } 62 76 63 77 $settings = get_option('woocommerce_' . $this->name . '_settings', []); … … 68 82 $discount_notice = trim( wp_strip_all_tags( $discount_notice ) ); 69 83 if ( strlen( $discount_notice ) > 200 ) { 70 $discount_notice = mb_substr( $discount_notice, 0, 197 ) . '...'; 84 $discount_notice = function_exists( 'mb_substr' ) 85 ? mb_substr( $discount_notice, 0, 197 ) . '...' 86 : substr( $discount_notice, 0, 197 ) . '...'; 71 87 } 72 88 -
advanced-emt-payment-gateway/trunk/readme.txt
r3474032 r3476008 7 7 WC requires at least: 6.0 8 8 WC tested up to: 8.6 9 Stable tag: 2.0. 49 Stable tag: 2.0.5 10 10 License: GPL2 or later 11 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 247 247 248 248 == Changelog == 249 250 = 2.0.5 = 251 - Fixed Checkout Block editor preview crash caused by invalid EMT payment-method registration config. 252 - Fixed EMT gateway not appearing in Checkout Blocks when content/edit types failed Woo Blocks validation. 253 - Hardened Blocks payment data loading for editor contexts where WooCommerce gateways are not fully initialized. 254 - Added safe string truncation fallback when mbstring is unavailable. 249 255 250 256 = 2.0.4 = -
advanced-emt-payment-gateway/trunk/resources/index.js
r3278447 r3476008 2 2 const { __ } = window.wp.i18n; 3 3 const { createElement } = window.wp.element; 4 5 const contentElement = 6 createElement( 7 'div', 8 {}, 9 createElement('p', {}, __('Pay via EMT. You will receive instructions after placing the order.', 'advanced-emt-payment-gateway')) 10 ); 4 11 5 12 registerPaymentMethod({ … … 7 14 label: __('Email Money Transfer', 'advanced-emt-payment-gateway'), 8 15 ariaLabel: __('Email Money Transfer', 'advanced-emt-payment-gateway'), 9 content: () => 10 createElement( 11 'div', 12 {}, 13 createElement('p', {}, __('Pay via EMT. You will receive instructions after placing the order.', 'advanced-emt-payment-gateway')) 14 ), 15 edit: () => null, 16 content: contentElement, 17 edit: contentElement, 16 18 canMakePayment: () => true, 17 19 supports: {
Note: See TracChangeset
for help on using the changeset viewer.