mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
29 lines
870 B
JavaScript
29 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;
|