Server IP : 104.21.14.103 / Your IP : 3.14.130.230 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/thietke365.net/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/extensions/payment-methods/bacs/ |
Upload File : |
/** * External dependencies */ import { registerPaymentMethod } from '@woocommerce/blocks-registry'; import { __ } from '@wordpress/i18n'; import { getSetting } from '@woocommerce/settings'; import { decodeEntities } from '@wordpress/html-entities'; /** * Internal dependencies */ import { PAYMENT_METHOD_NAME } from './constants'; const settings = getSetting( 'bacs_data', {} ); const defaultLabel = __( 'Direct bank transfer', 'woocommerce' ); const label = decodeEntities( settings.title ) || defaultLabel; /** * Content component */ const Content = () => { return decodeEntities( settings.description || '' ); }; /** * Label component * * @param {*} props Props from payment API. */ const Label = ( props ) => { const { PaymentMethodLabel } = props.components; return <PaymentMethodLabel text={ label } />; }; /** * Bank transfer (BACS) payment method config object. */ const bankTransferPaymentMethod = { name: PAYMENT_METHOD_NAME, label: <Label />, content: <Content />, edit: <Content />, canMakePayment: () => true, ariaLabel: label, supports: { features: settings?.supports ?? [], }, }; registerPaymentMethod( bankTransferPaymentMethod );