PluginProbe
Cashfree for WooCommerce / 4.8.1
Cashfree for WooCommerce v4.8.1
4.8.1 4.8.0 trunk 1.0 1.2 4.2.1 4.2.2 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.5.0 4.5.1 All 42 releases
cashfree / assets / js / index.js

index.js in Cashfree for WooCommerce 4.8.1, at assets/js/index.js

42 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const settings_cashfree = window.wc.wcSettings.getSetting('cashfree_data', {});
2 const label_cashfree = window.wp.htmlEntities.decodeEntities(settings_cashfree.title) || window.wp.i18n.__('Pay with Cashfree', 'cashfree');
3
4 /**
5 * Label component
6 *
7 * @param {*} props Props from payment API.
8 */
9 const LabelCashfree = (props) => {
10 var icon = React.createElement('img', {
11 src: 'https://cashfreelogo.cashfree.com/cashfreepayments/logopng1x/Cashfree_Payments_Logo.png',
12 style: {
13 display: 'inline',
14 marginLeft: '5px', // Adjust the value as needed
15 },
16 });
17 var span = React.createElement('span', {
18 className: 'wc-block-components-payment-method-label wc-block-components-payment-method-label--with-icon',
19 }, window.wp.htmlEntities.decodeEntities(settings_cashfree.title) || defaultLabel, icon);
20 return span;
21 };
22
23 const LabelDesc = (props) => {
24 var span = React.createElement('span', {
25 className: 'wc-block-components-payment-method-label wc-block-components-payment-method-label--with-icon',
26 }, window.wp.htmlEntities.decodeEntities(settings_cashfree.description));
27 return span;
28 };
29
30 const CashfreeCheckout = {
31 name: 'cashfree',
32 label: React.createElement(LabelCashfree, null),
33 content: React.createElement(LabelDesc, null),
34 edit: React.createElement(LabelCashfree, null),
35 icons: null,
36 canMakePayment: () => true,
37 ariaLabel: label_cashfree,
38 supports: {
39 features: settings_cashfree.supports,
40 },
41 };
42 window.wc.wcBlocksRegistry.registerPaymentMethod( CashfreeCheckout );