woocommerce-paypal-payments/modules/ppcp-blocks/resources/js/advanced-card-checkout-block.js

20 lines
525 B
JavaScript
Raw Normal View History

import { registerPaymentMethod } from '@woocommerce/blocks-registry';
2024-07-12 12:58:34 +02:00
import { CardFields } from './Components/card-fields';
2024-07-12 12:58:34 +02:00
const config = wc.wcSettings.getSetting( 'ppcp-credit-card-gateway_data' );
2024-07-12 12:58:34 +02:00
registerPaymentMethod( {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: <CardFields config={ config } />,
edit: <div></div>,
ariaLabel: config.title,
canMakePayment: () => {
return true;
},
supports: {
showSavedCards: true,
features: config.supports,
},
} );