mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Init session with handlers
This commit is contained in:
parent
cffdec846c
commit
7b3f3e8ead
16 changed files with 279 additions and 63 deletions
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue