Changeset 3399333
- Timestamp:
- 11/20/2025 02:49:53 AM (5 months ago)
- Location:
- maaly-pay
- Files:
-
- 1 added
- 2 edited
-
assets/js/maaly-pay.js (added)
-
trunk/assets/js/maaly-pay.js (modified) (3 diffs)
-
trunk/includes/class-maaly-pay-gateway-blocks.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
maaly-pay/trunk/assets/js/maaly-pay.js
r3399327 r3399333 1 const { registerExpressPaymentMethod } = window.wc.wcBlocksRegistry; 1 const { registerPaymentMethod } = window.wc.wcBlocksRegistry; 2 const label = window.React.createElement("p", {}, "Maaly Pay") 3 const content = window.React.createElement("p", {}, "Maaly Pay") 2 4 3 5 const options = { … … 5 7 title: 'Maaly Pay', 6 8 description: 'Getting Crypto Payment using Maaly Pay', 9 ariaLabel: "Pay with Maaly Pay", 10 placeOrderButtonLabel: "Pay with Maaly Pay", 7 11 gatewayId: 'maaly_pay', 8 label: <ReactNode />, 9 content: <ReactNode />, 10 edit: <ReactNode />, 12 paymentMethodId: 'maaly_pay', 13 label: label, 14 content: content, 15 edit: null, 11 16 canMakePayment: () => true, 12 paymentMethodId: 'maaly_pay',13 17 supports: { 14 18 features: [], … … 17 21 }; 18 22 19 register ExpressPaymentMethod(options)23 registerPaymentMethod(options) -
maaly-pay/trunk/includes/class-maaly-pay-gateway-blocks.php
r3399323 r3399333 29 29 // Load settings for your gateway (if applicable) 30 30 $this->settings = get_option( 'maaly_pay_settings', array() ); 31 32 $gateways = WC()->payment_gateways->payment_gateways(); 31 33 // Instantiate your main payment gateway class 32 $this->gateway = new WC_Gateway_Maaly_Pay();34 $this->gateway = $gateways($this->name); 33 35 } 34 36 … … 49 51 public function get_payment_method_script_handles() { 50 52 wp_register_script( 51 'maaly-pay-method', 52 plugins_url( 'assets/js/maaly-pay.js', __FILE__ ), // Path to your frontend script 53 'wc-maaly-pay-blocks', 54 // plugins_url( 'assets/js/maaly-pay.js', __FILE__ ), // Path to your frontend script 55 MAALY_PAY_PLUGIN_URL . 'assets/js/maaly-pay.js', 53 56 [ 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n' ], 54 false,57 '1.1.0', 55 58 true 56 59 ); 57 60 58 61 if ( function_exists( 'wp_set_script_translations' ) ) { 59 wp_set_script_translations( ' maaly-pay-method' );62 wp_set_script_translations( 'wc-maaly-pay-blocks' ); 60 63 } 61 64 62 return [ ' maaly-pay-method' ];65 return [ 'wc-maaly-pay-blocks' ]; 63 66 } 64 67 … … 72 75 'title' => $this->gateway->title, 73 76 'description' => $this->gateway->description, 77 'supports' => array_filter( $this->gateway->supports, [ $this->gateway, 'supports' ] ) 74 78 // Add any other data needed by your frontend script 75 79 ];
Note: See TracChangeset
for help on using the changeset viewer.