woocommerce-paypal-payments/modules/ppcp-applepay/resources/js/Context/CheckoutHandler.js
2023-09-07 09:56:46 +02:00

28 lines
870 B
JavaScript

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;