Add spinner to pay now bootsptrap

This commit is contained in:
dinamiko 2021-01-05 17:12:26 +01:00
parent fc05378dbb
commit 8562fb7f58
2 changed files with 8 additions and 5 deletions

View file

@ -60,7 +60,8 @@ const bootstrap = () => {
const payNowBootstrap = new PayNowBootstrap(
PayPalCommerceGateway,
renderer,
messageRenderer
messageRenderer,
spinner
);
payNowBootstrap.init();
}
@ -95,4 +96,4 @@ document.addEventListener(
document.body.append(script);
},
);
);

View file

@ -2,10 +2,11 @@ import ErrorHandler from '../ErrorHandler';
import CheckoutActionHandler from '../ActionHandler/CheckoutActionHandler';
class PayNowBootstrap {
constructor(gateway, renderer, messages) {
constructor(gateway, renderer, messages, spinner) {
this.gateway = gateway;
this.renderer = renderer;
this.messages = messages
this.messages = messages;
this.spinner = spinner;
}
init() {
@ -41,6 +42,7 @@ class PayNowBootstrap {
const actionHandler = new CheckoutActionHandler(
PayPalCommerceGateway,
new ErrorHandler(this.gateway.labels.error.generic),
this.spinner
);
this.renderer.render(
@ -77,4 +79,4 @@ class PayNowBootstrap {
}
}
export default PayNowBootstrap;
export default PayNowBootstrap;