woocommerce-paypal-payments/modules/ppcp-local-alternative-payment-methods/resources/js/pwc-payment-method.js
Daniel Dudzic 6e227bb177
Some checks failed
CI / PHP 7.4 (push) Has been cancelled
CI / PHP 8.0 (push) Has been cancelled
CI / PHP 8.1 (push) Has been cancelled
CI / PHP 8.2 (push) Has been cancelled
CI / PHP 8.3 (push) Has been cancelled
CI / PHP 8.4 (push) Has been cancelled
PR Playground Demo / prepare_version (push) Has been cancelled
PR Playground Demo / build_plugin (push) Has been cancelled
PR Playground Demo / create_archive (push) Has been cancelled
PR Playground Demo / Comment on PR with Playground details (push) Has been cancelled
🌐 Update PwC copy in the onboarding section and in both checkouts
2025-10-27 16:02:14 +01:00

34 lines
875 B
JavaScript

import { registerPaymentMethod } from '@woocommerce/blocks-registry';
const config = wc.wcSettings.getSetting( 'ppcp-pwc_data' );
registerPaymentMethod( {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: (
<>
{ config.description && (
<div
dangerouslySetInnerHTML={ { __html: config.description } }
/>
) }
{ config.icon && (
<div className="wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right">
<img
className={ `wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${ config.id }` }
src={ config.icon }
alt={ config.title }
/>
</div>
) }
</>
),
edit: <div></div>,
ariaLabel: config.title,
canMakePayment: () => {
return true;
},
supports: {
features: config.supports,
},
} );