Add p24 gateway

This commit is contained in:
Emili Castells Guasch 2024-08-21 15:47:23 +02:00
parent cf97f0becd
commit 83cb9d607a
15 changed files with 378 additions and 49 deletions

View file

@ -1,4 +1,4 @@
export function EPS( { config, components } ) {
export function APM( { config, components } ) {
const { PaymentMethodIcons } = components;
return (

View file

@ -1,9 +0,0 @@
export function Bancontact( { config, components } ) {
const { PaymentMethodIcons } = components;
return (
<div>
<PaymentMethodIcons icons={ [ config.icon ] } align="right" />
</div>
);
}

View file

@ -1,12 +1,12 @@
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { Bancontact } from './bancontact-block';
import { APM } from './apm-block';
const config = wc.wcSettings.getSetting( 'ppcp-bancontact_data' );
registerPaymentMethod( {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: <Bancontact config={ config } />,
content: <APM config={ config } />,
edit: <div></div>,
ariaLabel: config.title,
canMakePayment: () => {

View file

@ -1,9 +0,0 @@
export function Blik( { config, components } ) {
const { PaymentMethodIcons } = components;
return (
<div>
<PaymentMethodIcons icons={ [ config.icon ] } align="right" />
</div>
);
}

View file

@ -1,12 +1,12 @@
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { Blik } from './blik-block';
import { APM } from './apm-block';
const config = wc.wcSettings.getSetting( 'ppcp-blik_data' );
registerPaymentMethod( {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: <Blik config={ config } />,
content: <APM config={ config } />,
edit: <div></div>,
ariaLabel: config.title,
canMakePayment: () => {

View file

@ -1,12 +1,12 @@
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { EPS } from './eps-block';
import { APM } from './apm-block';
const config = wc.wcSettings.getSetting( 'ppcp-eps_data' );
registerPaymentMethod( {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: <EPS config={ config } />,
content: <APM config={ config } />,
edit: <div></div>,
ariaLabel: config.title,
canMakePayment: () => {

View file

@ -1,9 +0,0 @@
export function IDeal( { config, components } ) {
const { PaymentMethodIcons } = components;
return (
<div>
<PaymentMethodIcons icons={ [ config.icon ] } align="right" />
</div>
);
}

View file

@ -1,12 +1,12 @@
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { IDeal } from './ideal-block';
import { APM } from './apm-block';
const config = wc.wcSettings.getSetting( 'ppcp-ideal_data' );
registerPaymentMethod( {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: <IDeal config={ config } />,
content: <APM config={ config } />,
edit: <div></div>,
ariaLabel: config.title,
canMakePayment: () => {

View file

@ -1,9 +0,0 @@
export function MyBank( { config, components } ) {
const { PaymentMethodIcons } = components;
return (
<div>
<PaymentMethodIcons icons={ [ config.icon ] } align="right" />
</div>
);
}

View file

@ -1,12 +1,12 @@
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { MyBank } from './mybank-block';
import { APM } from './apm-block';
const config = wc.wcSettings.getSetting( 'ppcp-mybank_data' );
registerPaymentMethod( {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: <MyBank config={ config } />,
content: <APM config={ config } />,
edit: <div></div>,
ariaLabel: config.title,
canMakePayment: () => {

View file

@ -0,0 +1,18 @@
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
import { APM } from './apm-block';
const config = wc.wcSettings.getSetting( 'ppcp-p24_data' );
registerPaymentMethod( {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: <APM config={ config } />,
edit: <div></div>,
ariaLabel: config.title,
canMakePayment: () => {
return true;
},
supports: {
features: config.supports,
},
} );