Uniformize ApplePay javascript coding style.

Add support for checkout form data to ApplePay.
Add checkout shipping mode option in ApplePay settings.
This commit is contained in:
Pedro Silva 2023-11-09 17:50:57 +00:00
parent 3a39bccc54
commit 2f5f51e518
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
9 changed files with 292 additions and 248 deletions

View file

@ -1,28 +1,17 @@
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(
actionHandler() {
return new CheckoutActionHandler(
this.ppcpConfig,
errorHandler,
spinner
this.errorHandler(),
new Spinner()
);
return actionHandler.configuration().createOrder(null, null);
}
}
export default CheckoutHandler;