Add mybank gateway

This commit is contained in:
Emili Castells Guasch 2024-08-21 15:05:11 +02:00
parent 2350a87f6c
commit cf97f0becd
6 changed files with 373 additions and 0 deletions

View file

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

View file

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