mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Add bancontact component
This commit is contained in:
parent
60885b2ad9
commit
ce25dee734
4 changed files with 17 additions and 7 deletions
|
@ -0,0 +1,9 @@
|
|||
export function Bancontact( { config, components } ) {
|
||||
const { PaymentMethodIcons } = components;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<PaymentMethodIcons icons={ [ config.icon ] } align="right" />
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
import { registerPaymentMethod } from '@woocommerce/blocks-registry';
|
||||
import { Bancontact } from './bancontact-block';
|
||||
|
||||
const config = wc.wcSettings.getSetting( 'ppcp-bancontact_data' );
|
||||
console.log( config );
|
||||
|
||||
registerPaymentMethod( {
|
||||
name: config.id,
|
||||
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
|
||||
content: <div>Hi there!</div>,
|
||||
content: <Bancontact config={ config } />,
|
||||
edit: <div></div>,
|
||||
ariaLabel: config.title,
|
||||
canMakePayment: () => {
|
|
@ -63,14 +63,14 @@ class BancontactPaymentMethod extends AbstractPaymentMethodType {
|
|||
*/
|
||||
public function get_payment_method_script_handles() {
|
||||
wp_register_script(
|
||||
'ppcp-bancontact-checkout-block',
|
||||
trailingslashit( $this->module_url ) . 'assets/js/bancontact-checkout-block.js',
|
||||
'ppcp-bancontact-payment-method',
|
||||
trailingslashit( $this->module_url ) . 'assets/js/bancontact-payment-method.js',
|
||||
array(),
|
||||
$this->version,
|
||||
true
|
||||
);
|
||||
|
||||
return array( 'ppcp-bancontact-checkout-block' );
|
||||
return array( 'ppcp-bancontact-payment-method' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -81,6 +81,7 @@ class BancontactPaymentMethod extends AbstractPaymentMethodType {
|
|||
'id' => $this->name,
|
||||
'title' => $this->gateway->title,
|
||||
'description' => $this->gateway->description,
|
||||
'icon' => esc_url( 'https://www.paypalobjects.com/images/checkout/alternative_payments/paypal_bancontact_color.svg' ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ module.exports = {
|
|||
target: 'web',
|
||||
plugins: [ new DependencyExtractionWebpackPlugin() ],
|
||||
entry: {
|
||||
'bancontact-checkout-block': path.resolve(
|
||||
'./resources/js/bancontact-checkout-block.js'
|
||||
'bancontact-payment-method': path.resolve(
|
||||
'./resources/js/bancontact-payment-method.js'
|
||||
),
|
||||
},
|
||||
output: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue