Init session with handlers

This commit is contained in:
carmenmaymo 2023-09-07 09:56:46 +02:00
parent cffdec846c
commit 7b3f3e8ead
No known key found for this signature in database
GPG key ID: 6023F686B0F3102E
16 changed files with 279 additions and 63 deletions

View file

@ -0,0 +1,28 @@
import Spinner from "../../../../ppcp-button/resources/js/modules/Helper/Spinner";
import CheckoutActionHandler
from "../../../../ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler";
import ErrorHandler from "../../../../ppcp-button/resources/js/modules/ErrorHandler";
import BaseHandler from "./BaseHandler";
class CheckoutHandler extends BaseHandler {
createOrder() {
const errorHandler = new ErrorHandler(
this.ppcpConfig.labels.error.generic,
document.querySelector('.woocommerce-notices-wrapper')
);
const spinner = new Spinner();
const actionHandler = new CheckoutActionHandler(
this.ppcpConfig,
errorHandler,
spinner
);
return actionHandler.configuration().createOrder(null, null);
}
}
export default CheckoutHandler;