Changeset 3327025
- Timestamp:
- 07/13/2025 01:49:12 PM (9 months ago)
- Location:
- mugglepay
- Files:
-
- 57 added
- 9 edited
-
tags/1.0.9 (added)
-
tags/1.0.9/LICENSE (added)
-
tags/1.0.9/assets (added)
-
tags/1.0.9/assets/css (added)
-
tags/1.0.9/assets/css/mpwp-admin.css (added)
-
tags/1.0.9/assets/css/mpwp-public.css (added)
-
tags/1.0.9/assets/images (added)
-
tags/1.0.9/assets/images/btc.png (added)
-
tags/1.0.9/assets/images/eth.png (added)
-
tags/1.0.9/assets/images/mugglepay-logo-c.png (added)
-
tags/1.0.9/assets/images/usdc.png (added)
-
tags/1.0.9/assets/images/usdt.png (added)
-
tags/1.0.9/assets/js (added)
-
tags/1.0.9/assets/js/blocks (added)
-
tags/1.0.9/assets/js/blocks/eth_methods.js (added)
-
tags/1.0.9/assets/js/blocks/mpwp.js (added)
-
tags/1.0.9/assets/js/blocks/muggle_pay_methods.js (added)
-
tags/1.0.9/assets/js/blocks/usdc_methods.js (added)
-
tags/1.0.9/assets/js/blocks/usdt_methods.js (added)
-
tags/1.0.9/assets/js/wpmp-admin.js (added)
-
tags/1.0.9/assets/setting.jpg (added)
-
tags/1.0.9/class (added)
-
tags/1.0.9/class/class-mpwp-eth-methods.php (added)
-
tags/1.0.9/class/class-mpwp-eth.php (added)
-
tags/1.0.9/class/class-mpwp-gateway-blocks-support.php (added)
-
tags/1.0.9/class/class-mpwp-gateway.php (added)
-
tags/1.0.9/class/class-mpwp-muggle-pay-methods.php (added)
-
tags/1.0.9/class/class-mpwp-muggle-pay.php (added)
-
tags/1.0.9/class/class-mpwp-usdc-methods.php (added)
-
tags/1.0.9/class/class-mpwp-usdc.php (added)
-
tags/1.0.9/class/class-mpwp-usdt-methods.php (added)
-
tags/1.0.9/class/class-mpwp-usdt.php (added)
-
tags/1.0.9/class/class-mugglepay-request.php (added)
-
tags/1.0.9/i18n (added)
-
tags/1.0.9/i18n/languages (added)
-
tags/1.0.9/i18n/languages/mpwp-zh_CN.mo (added)
-
tags/1.0.9/i18n/languages/mpwp-zh_CN.po (added)
-
tags/1.0.9/i18n/languages/mpwp.pot (added)
-
tags/1.0.9/muggle-pay.php (added)
-
tags/1.0.9/readme-es_ES.txt (added)
-
tags/1.0.9/readme-ru_RU.txt (added)
-
tags/1.0.9/readme-zh_CN.txt (added)
-
tags/1.0.9/readme.txt (added)
-
tags/1.0.9/screenshot (added)
-
tags/1.0.9/screenshot/screenshot-1.png (added)
-
trunk/assets/css/mpwp-admin.css (modified) (1 diff)
-
trunk/assets/js/blocks/eth_methods.js (added)
-
trunk/assets/js/blocks/mpwp.js (modified) (1 diff)
-
trunk/assets/js/blocks/muggle_pay_methods.js (added)
-
trunk/assets/js/blocks/usdc_methods.js (added)
-
trunk/assets/js/blocks/usdt_methods.js (added)
-
trunk/class/class-mpwp-eth-methods.php (added)
-
trunk/class/class-mpwp-eth.php (added)
-
trunk/class/class-mpwp-gateway-blocks-support.php (modified) (6 diffs)
-
trunk/class/class-mpwp-gateway.php (modified) (2 diffs)
-
trunk/class/class-mpwp-muggle-pay-methods.php (added)
-
trunk/class/class-mpwp-muggle-pay.php (added)
-
trunk/class/class-mpwp-usdc-methods.php (added)
-
trunk/class/class-mpwp-usdc.php (added)
-
trunk/class/class-mpwp-usdt-methods.php (added)
-
trunk/class/class-mpwp-usdt.php (added)
-
trunk/muggle-pay.php (modified) (10 diffs)
-
trunk/readme-es_ES.txt (modified) (2 diffs)
-
trunk/readme-ru_RU.txt (modified) (2 diffs)
-
trunk/readme-zh_CN.txt (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mugglepay/trunk/assets/css/mpwp-admin.css
r3137189 r3327025 1 #woocommerce_mpwp_payment_gateway+.form-table { 1 tr[data-gateway_id="muggle_pay_methods"], 2 tr[data-gateway_id="usdt_methods"], 3 tr[data-gateway_id="usdc_methods"], 4 tr[data-gateway_id="eth_methods"], 5 #muggle_pay_methods.woocommerce-item__payment-gateway, 6 #usdt_methods.woocommerce-item__payment-gateway, 7 #usdc_methods.woocommerce-item__payment-gateway, 8 #eth_methods.woocommerce-item__payment-gateway { 2 9 display: none; 3 10 } -
mugglepay/trunk/assets/js/blocks/mpwp.js
r3137189 r3327025 1 (() => { 2 const { wcSettings, wcBlocksRegistry } = window.wc; 1 const { registerPaymentMethod } = window.wc.wcBlocksRegistry; 3 2 4 const data =wcSettings.getSetting("mpwp_data");3 const mpwp_data = window.wc.wcSettings.getSetting("mpwp_data"); 5 4 6 console.log('data', data) 5 const mpwp_label = wp.htmlEntities.decodeEntities(mpwp_data.title || ""); 7 6 8 const mpwpTitle = wp.htmlEntities.decodeEntities(data.title || ""); 9 const decodeDescription = () => wp.htmlEntities.decodeEntities(data.description || ""); 7 const mpwp_Content = () => { 8 return wp.htmlEntities.decodeEntities(mpwp_data.description || ""); 9 } 10 10 11 const mpwpPaymentMethod = { 12 name: "mpwp", 13 ariaLabel: mpwpTitle, 14 label: window.React.createElement( 15 () => { 16 return window.React.createElement(() => mpwpTitle); 17 }, 18 null 19 ), 20 content: window.React.createElement(decodeDescription, null), 21 edit: window.React.createElement(decodeDescription, null), 22 canMakePayment: () => { 23 console.log("canMakePaymentcanMakePayment"); 24 console.log("canMakePayment"); 25 return true; 26 }, 27 supports: { 28 showSavedCards: false, 29 showSaveOption: false, 30 features: data.supports, 31 }, 32 }; 11 const mpwp_Label = (props) => { 12 const { PaymentMethodLabel } = props.components; 13 return React.createElement(PaymentMethodLabel, { text: mpwp_label }); 14 } 33 15 34 wcBlocksRegistry.registerPaymentMethod(mpwpPaymentMethod); 35 })(); 16 registerPaymentMethod({ 17 name: "mpwp", 18 title: React.createElement(mpwp_Label), 19 description: React.createElement(mpwp_Content), 20 label: React.createElement(mpwp_Label), 21 content: React.createElement(mpwp_Content), 22 gatewayId : "mpwp", 23 edit: React.createElement(mpwp_Content), 24 canMakePayment: () => true, 25 ariaLabel: mpwp_label, 26 supports: { 27 features: mpwp_data.supports, 28 } 29 }); -
mugglepay/trunk/class/class-mpwp-gateway-blocks-support.php
r3137189 r3327025 17 17 protected $name = 'mpwp'; 18 18 19 private $gateway; 19 20 20 21 /** … … 22 23 */ 23 24 public function initialize() { 25 24 26 $this->settings = get_option( 'woocommerce_mpwp_settings', array() ); 27 28 $gateways = WC()->payment_gateways->payment_gateways(); 29 30 $this->gateway = $gateways[ $this->name ]; 25 31 26 32 add_action( 'woocommerce_rest_checkout_process_payment_with_context', array( $this, 'mpwp_failed_payment_notice' ), 8, 2 ); … … 40 46 41 47 // return $payment_gateways[ $this->name ]->is_available(); 42 43 return true;48 49 return ! empty( $this->settings[ 'enabled' ] ) && 'yes' === $this->settings[ 'enabled' ]; 44 50 } 45 51 … … 51 57 public function get_payment_method_script_handles() { 52 58 $script_url = plugins_url( "/assets/js/blocks/mpwp.js", MPWP_MAIN_FILE ); 53 59 54 60 wp_register_script( 55 61 "wc-mpwp-blocks", 56 62 $script_url, 57 array( 'wc-blocks-checkout', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'),58 '1. 2',63 array( 'wp-element', 'wc-blocks-checkout', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 64 '1.4', 59 65 true 60 66 ); 67 61 68 wp_set_script_translations( 'wc-mpwp-blocks', 'mugglepay' ); 69 62 70 return array( "wc-mpwp-blocks" ); 63 71 } … … 75 83 'title' => $this->get_setting( 'title' ), 76 84 'description' => $this->get_setting( 'description' ), 77 'supports' => array_filter( $ gateway->supports, array( $gateway, 'supports' ) ),85 'supports' => array_filter( $this->gateway->supports, array( $this->gateway, 'supports' ) ), 78 86 'allow_saved_cards' => is_user_logged_in(), 79 87 ); … … 98 106 } 99 107 } 108 100 109 } -
mugglepay/trunk/class/class-mpwp-gateway.php
r3178105 r3327025 4 4 exit; 5 5 } 6 7 use Automattic\WooCommerce\StoreApi\Exceptions\RouteException; 6 8 7 9 /** … … 264 266 265 267 $result = $this->get_payment_url($order, $this->current_method); 266 268 267 269 if (is_wp_error($result)) { 268 wc_add_notice($result->get_error_message(), 'error'); 270 // wc_add_notice($result->get_error_message(), 'error'); 271 throw new RouteException( 'woocommerce_rest_checkout_process_payment_error', esc_html($result->get_error_message() ), 400 ); 269 272 return; 270 273 } -
mugglepay/trunk/muggle-pay.php
r3271150 r3327025 9 9 Plugin URI: https://mugglepay.com/ 10 10 Description: MugglePay is a one-stop payment solution for merchants with an online payment need. 11 Version: 1.0. 811 Version: 1.0.9 12 12 Author: MugglePay 13 13 Author URI: https://x.com/mugglepay … … 26 26 { 27 27 require_once MPWP_PLUGIN_DIR . 'class/class-mpwp-gateway.php'; 28 require_once MPWP_PLUGIN_DIR . 'class/class-mpwp-muggle-pay.php'; 29 require_once MPWP_PLUGIN_DIR . 'class/class-mpwp-eth.php'; 30 require_once MPWP_PLUGIN_DIR . 'class/class-mpwp-usdc.php'; 31 require_once MPWP_PLUGIN_DIR . 'class/class-mpwp-usdt.php'; 28 32 29 33 // add_action( 'init', 'cb_wc_register_blockchain_status' ); … … 39 43 // add payment gateway filter 40 44 add_filter('woocommerce_available_payment_gateways', 'mpwp_filter_woocommerce_available_payment_gateways', 10, 1); 45 41 46 } 42 47 add_action('plugins_loaded', 'mpwp_init'); … … 47 52 */ 48 53 function mpwp_wc_gateway_woocommerce_block_support() { 49 if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) { 50 require_once __DIR__ . '/class/class-mpwp-gateway-blocks-support.php'; 51 add_action( 52 'woocommerce_blocks_payment_method_type_registration', 53 static function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { 54 $payment_method_registry->register( new MPWP_WC_Gateway_Blocks_Support() ); 55 } 56 ); 57 } 54 55 require_once __DIR__ . '/class/class-mpwp-gateway-blocks-support.php'; 56 require_once __DIR__ . '/class/class-mpwp-muggle-pay-methods.php'; 57 require_once __DIR__ . '/class/class-mpwp-usdt-methods.php'; 58 require_once __DIR__ . '/class/class-mpwp-usdc-methods.php'; 59 require_once __DIR__ . '/class/class-mpwp-eth-methods.php'; 60 61 add_action( 62 'woocommerce_blocks_payment_method_type_registration', 63 function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { 64 $payment_method_registry->register( new MPWP_WC_Gateway_Blocks_Support() ); 65 $payment_method_registry->register( new MPWP_WC_Muggle_Pay_Methods() ); 66 $payment_method_registry->register( new MPWP_WC_Usdt_Methods() ); 67 $payment_method_registry->register( new MPWP_WC_Usdc_Methods() ); 68 $payment_method_registry->register( new MPWP_WC_Eth_Methods() ); 69 } 70 ); 71 58 72 } 59 73 add_action( 'woocommerce_blocks_loaded', 'mpwp_wc_gateway_woocommerce_block_support' ); 60 61 74 62 75 // Regiester Gateway To WooCommerce … … 64 77 { 65 78 $methods[] = 'MPWP_WC_Gateway'; 79 $methods[] = 'MPWP_WC_Muggle_Pay'; 80 $methods[] = 'MPWP_WC_Usdt'; 81 $methods[] = 'MPWP_WC_Usdc'; 82 $methods[] = 'MPWP_WC_Eth'; 66 83 return $methods; 67 84 } … … 150 167 function mpwp_filter_woocommerce_available_payment_gateways($available_gateways) 151 168 { 169 170 if ( is_admin() && isset( $available_gateways['eth_methods'] ) ) { 171 unset( $available_gateways['eth_methods'] ); 172 } 173 152 174 if (isset($available_gateways['mpwp']) && $available_gateways['mpwp']) { 153 175 $mpwp = $available_gateways['mpwp']; … … 166 188 unset($available_gateways['mpwp']); 167 189 } 190 168 191 return $available_gateways; 169 192 }; … … 183 206 function mpwp_admin_load_scripts() { 184 207 185 wp_register_style( ' wpmp-admin-style', MPWP_PLUGIN_URL.'/assets/css/wpmp-admin.css', array(), 1);186 wp_enqueue_style( ' wpmp-admin-style' );208 wp_register_style( 'mpwp-admin-style', MPWP_PLUGIN_URL.'/assets/css/mpwp-admin.css', array(), 4 ); 209 wp_enqueue_style( 'mpwp-admin-style' ); 187 210 188 211 wp_enqueue_script('jquery'); 189 212 190 wp_register_script( ' wpmp-admin-script', MPWP_PLUGIN_URL.'/assets/js/wpmp-admin.js', array(), 1, true );191 wp_enqueue_script( ' wpmp-admin-script' );192 193 } 194 195 add_filter( 'network_admin_plugin_action_links', ' wpmp_add_settings_link_to_network_plugins', 10, 2 );213 wp_register_script( 'mpwp-admin-script', MPWP_PLUGIN_URL.'/assets/js/mpwp-admin.js', array(), 1, true ); 214 wp_enqueue_script( 'mpwp-admin-script' ); 215 216 } 217 218 add_filter( 'network_admin_plugin_action_links', 'mpwp_add_settings_link_to_network_plugins', 10, 2 ); 196 219 197 220 /** 198 221 * Settings Link 199 222 */ 200 function wpmp_add_settings_link_to_network_plugins($actions, $plugin_file) {223 function mpwp_add_settings_link_to_network_plugins($actions, $plugin_file) { 201 224 202 225 if ( 'mugglepay/muggle-pay.php' === $plugin_file ) … … 224 247 } 225 248 226 add_filter( 'plugin_action_links', ' wpmp_add_settings_link_to_plugins', 10, 2 );227 228 function wpmp_add_settings_link_to_plugins($actions, $plugin_file) {249 add_filter( 'plugin_action_links', 'mpwp_add_settings_link_to_plugins', 10, 2 ); 250 251 function mpwp_add_settings_link_to_plugins($actions, $plugin_file) { 229 252 230 253 if ( 'mugglepay/muggle-pay.php' === $plugin_file ) … … 239 262 return $actions; 240 263 } 264 265 function declare_cart_checkout_blocks_compatibility() { 266 // Check if the required class exists 267 if (class_exists('\Automattic\WooCommerce\Utilities\FeaturesUtil')) { 268 // Declare compatibility for 'cart_checkout_blocks' 269 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('cart_checkout_blocks', __FILE__, true); 270 } 271 } 272 // Hook the custom function to the 'before_woocommerce_init' action 273 add_action('before_woocommerce_init', 'declare_cart_checkout_blocks_compatibility'); -
mugglepay/trunk/readme-es_ES.txt
r3271150 r3327025 3 3 Etiquetas: mugglepay, woocommerce, pago en criptomonedas, USDT, USDC, Tether, Bitcoin, Ethereum, Solana, BTC, ETH, Visa, Stripe, tarjeta de crédito, Alipay, WeChat 4 4 Requiere al menos: 5.3 5 Probado hasta: 6. 5.55 Probado hasta: 6.8.1 6 6 Requiere PHP: 7.0 7 Versión estable: 1.0. 87 Versión estable: 1.0.9 8 8 Licencia: GPLv3+ 9 9 URI de licencia: https://www.gnu.org/licenses/gpl-3.0.html … … 57 57 == Registro de cambios == 58 58 59 === 1.0.9 === 60 * Admite pagos en USDC Stellar y Stellar XLM. 61 * Se agregó soporte para editor de bloques. 62 63 59 64 === 1.0.8 === 60 65 * Se agregó el enlace de Configuración en la página de complementos -
mugglepay/trunk/readme-ru_RU.txt
r3271150 r3327025 3 3 Теги: mugglepay, woocommerce, криптовалютные платежи, USDT, USDC, Tether, Bitcoin, Ethereum, Solana, BTC, ETH, Visa, Stripe, кредитная карта, Alipay, WeChat 4 4 Минимальная версия: 5.3 5 Проверено до: 6. 5.55 Проверено до: 6.8.1 6 6 Требуется PHP: 7.0 7 Стабильная версия: 1.0. 87 Стабильная версия: 1.0.9 8 8 Лицензия: GPLv3+ 9 9 URI лицензии: https://www.gnu.org/licenses/gpl-3.0.html … … 57 57 == История обновлений == 58 58 59 === 1.0.9 === 60 * Поддержка платежей USDC Stellar и Stellar XLM. 61 * Добавлена поддержка редактора блоков. 62 63 59 64 === 1.0.8 === 60 65 * Добавлена ссылка «Настройки» на странице плагинов -
mugglepay/trunk/readme-zh_CN.txt
r3271150 r3327025 3 3 标签: mugglepay, woocommerce, 加密支付, USDT, USDC, Tether, 比特币, 以太坊, Solana, BTC, ETH, Visa, Stripe, 信用卡, 支付宝, 微信 4 4 最低要求: 5.3 5 测试通过: 6. 5.55 测试通过: 6.8.1 6 6 最低 PHP 版本: 7.0 7 稳定版本: 1.0. 87 稳定版本: 1.0.9 8 8 许可证: GPLv3+ 9 9 许可证链接: https://www.gnu.org/licenses/gpl-3.0.html … … 57 57 == 更新日志 == 58 58 59 === 1.0.9 === 60 * 支持 USDC Stellar 和 Stellar XLM 支付。 61 * 添加了块编辑器支持。 62 63 59 64 === 1.0.8 === 60 65 * 在插件页面上添加了设置链接 -
mugglepay/trunk/readme.txt
r3271150 r3327025 3 3 Tags: mugglepay woocommerce crypto payment usdt usdc tether bitcoin ethereum solana btc eth visa stripe credit card alipay wechat 4 4 Requires at least: 5.3 5 Tested up to: 6. 5.55 Tested up to: 6.8.1 6 6 Requires PHP: 7.0 7 Stable tag: 1.0. 87 Stable tag: 1.0.9 8 8 License: GPLv3+ 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 64 64 == Changelog == 65 65 66 === 1.0.9 === 67 * Support USDC Stellar and Stellar XLM payments. 68 * Added block editor support. 69 70 66 71 === 1.0.8 === 67 72 * Added Settings link on plugins page
Note: See TracChangeset
for help on using the changeset viewer.