mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-29 04:59:01 +08:00
Some checks failed
CI / PHP 7.4 (push) Has been cancelled
CI / PHP 8.0 (push) Has been cancelled
CI / PHP 8.1 (push) Has been cancelled
CI / PHP 8.2 (push) Has been cancelled
CI / PHP 8.3 (push) Has been cancelled
CI / PHP 8.4 (push) Has been cancelled
PR Playground Demo / prepare_version (push) Has been cancelled
PR Playground Demo / build_plugin (push) Has been cancelled
PR Playground Demo / create_archive (push) Has been cancelled
PR Playground Demo / Comment on PR with Playground details (push) Has been cancelled
34 lines
875 B
JavaScript
34 lines
875 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 } } />,
|
|
content: (
|
|
<>
|
|
{ config.description && (
|
|
<div
|
|
dangerouslySetInnerHTML={ { __html: config.description } }
|
|
/>
|
|
) }
|
|
{ config.icon && (
|
|
<div className="wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right">
|
|
<img
|
|
className={ `wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${ config.id }` }
|
|
src={ config.icon }
|
|
alt={ config.title }
|
|
/>
|
|
</div>
|
|
) }
|
|
</>
|
|
),
|
|
edit: <div></div>,
|
|
ariaLabel: config.title,
|
|
canMakePayment: () => {
|
|
return true;
|
|
},
|
|
supports: {
|
|
features: config.supports,
|
|
},
|
|
} );
|