mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Pass PayPalCommerceGateway as a dependency
This commit is contained in:
parent
493ae20d91
commit
d31987ed46
5 changed files with 53 additions and 28 deletions
|
@ -1,5 +1,6 @@
|
|||
class MiniCartBootstap {
|
||||
constructor(renderer, configurator) {
|
||||
constructor(gateway, renderer, configurator) {
|
||||
this.gateway = gateway;
|
||||
this.renderer = renderer;
|
||||
this.configurator = configurator;
|
||||
}
|
||||
|
@ -15,13 +16,13 @@ class MiniCartBootstap {
|
|||
});
|
||||
|
||||
this.renderer.render(
|
||||
PayPalCommerceGateway.button.mini_cart_wrapper,
|
||||
this.gateway.button.mini_cart_wrapper,
|
||||
this.configurator.configuration(),
|
||||
);
|
||||
}
|
||||
|
||||
shouldRender() {
|
||||
return document.querySelector(PayPalCommerceGateway.button.mini_cart_wrapper);
|
||||
return document.querySelector(this.gateway.button.mini_cart_wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue