woocommerce-paypal-payments/modules/ppcp-local-alternative-payment-methods/resources/js/pwc-payment-method.js

36 lines
761 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 } } />
{ config.icon && (
<img
className={ `wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${ config.id }` }
src={ config.icon }
alt={ config.title }
/>
) }
</>
),
content: (
<>
{ config.description && (
<div
dangerouslySetInnerHTML={ { __html: config.description } }
/>
) }
</>
),
edit: <div></div>,
ariaLabel: config.title,
canMakePayment: () => {
return true;
},
supports: {
features: config.supports,
},
} );