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