mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
24 lines
628 B
JavaScript
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,
|
|
} );
|