Pass PayPalCommerceGateway as a dependency

This commit is contained in:
Mészáros Róbert 2020-04-09 12:56:05 +03:00
parent 493ae20d91
commit d31987ed46
5 changed files with 53 additions and 28 deletions

View file

@ -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);
}
}