woocommerce-paypal-payments/modules/ppcp-axo/resources/js/boot.js
Emili Castells Guasch 11105d913b Run eslint autofix
2024-07-12 12:58:34 +02:00

24 lines
628 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,
} );