mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-26 01:14:19 +08:00
36 lines
761 B
JavaScript
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,
|
|
},
|
|
} );
|