mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
33 lines
763 B
JavaScript
33 lines
763 B
JavaScript
import AxoManager from "./AxoManager";
|
|
import {loadPaypalScript} from "../../../ppcp-button/resources/js/modules/Helper/ScriptLoading";
|
|
|
|
(function ({
|
|
axoConfig,
|
|
ppcpConfig,
|
|
jQuery
|
|
}) {
|
|
|
|
const bootstrap = () => {
|
|
new AxoManager(axoConfig, ppcpConfig);
|
|
}
|
|
|
|
document.addEventListener(
|
|
'DOMContentLoaded',
|
|
() => {
|
|
if (!typeof (PayPalCommerceGateway)) {
|
|
console.error('AXO could not be configured.');
|
|
return;
|
|
}
|
|
|
|
// Load PayPal
|
|
loadPaypalScript(ppcpConfig, () => {
|
|
bootstrap();
|
|
});
|
|
},
|
|
);
|
|
|
|
})({
|
|
axoConfig: window.wc_ppcp_axo,
|
|
ppcpConfig: window.PayPalCommerceGateway,
|
|
jQuery: window.jQuery
|
|
});
|