mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Add the UnifiedScriptLoader and usePayPalCommerceGateway hook
This commit is contained in:
parent
5e1c2a22d2
commit
07bedc4460
4 changed files with 111 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
import AxoManager from './AxoManager';
|
||||
import UnifiedScriptLoader from '../../../ppcp-button/resources/js/modules/Helper/UnifiedScriptLoader';
|
||||
import { log } from './Helper/Debug';
|
||||
|
||||
( function ( { axoConfig, ppcpConfig, jQuery } ) {
|
||||
const namespace = 'ppcpPaypalClassicAxo';
|
||||
|
@ -16,11 +17,10 @@ import UnifiedScriptLoader from '../../../ppcp-button/resources/js/modules/Helpe
|
|||
// Load PayPal
|
||||
UnifiedScriptLoader.loadPayPalScript( namespace, ppcpConfig )
|
||||
.then( () => {
|
||||
console.log( 'PayPal script loaded successfully' );
|
||||
bootstrap();
|
||||
} )
|
||||
.catch( ( error ) => {
|
||||
console.error( 'Failed to load PayPal script:', error );
|
||||
log( `Failed to load PayPal script: ${ error }`, 'error' );
|
||||
} );
|
||||
} );
|
||||
} )( {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue