PluginProbe
PayPlug for WooCommerce (Official) / 3.1.0
PayPlug for WooCommerce (Official) v3.1.0
3.1.0 3.0.0 2.18.0 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 1.10.0 1.10.1 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 All 102 releases
payplug / resources / js / frontend / wc-payplug-scalapay-blocks.js

wc-payplug-scalapay-blocks.js in PayPlug for WooCommerce (Official) 3.1.0, at resources/js/frontend/wc-payplug-scalapay-blocks.js

52 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2 import { registerPaymentMethod } from '@woocommerce/blocks-registry';
3 import { decodeEntities } from '@wordpress/html-entities';
4 import { getSetting } from '@woocommerce/settings';
5
6 const settings = getSetting( 'scalapay_data', {} );
7 const defaultLabel = __('Gateway method title', 'payplug');
8 const label = decodeEntities( settings?.title ) || defaultLabel;
9
10 /**
11 * Content component
12 */
13 const Content = () => {
14 return window.wp.htmlEntities.decodeEntities( settings?.description || '' );
15 };
16 /**
17 * Label component
18 *
19 */
20 const Label = () => {
21 return (
22 <span style={{ width: '100%' }}>
23 {label}
24 <Icon />
25 </span>
26 )
27 }
28
29 const Icon = () => {
30 return (
31 <img src={settings?.icon.src} alt={settings?.icon.icon_alt} className="payplug-payment-icon" style={{float: 'right'}}/>
32 )
33 }
34
35 /**
36 * Payplug payment method config object.
37 */
38 const Scalapay = {
39 name: "scalapay",
40 label: <Label />,
41 content: <Content />,
42 edit: <Content />,
43 canMakePayment: () => true,
44 ariaLabel: label,
45 supports: {
46 features: settings.supports,
47 },
48 };
49
50 // Register the defined payment method object
51 registerPaymentMethod( Scalapay );
52