mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Axo Blocks: Migrate console logs to the Axo log function
This commit is contained in:
parent
b44dd0a8d9
commit
70676468b8
15 changed files with 82 additions and 94 deletions
|
@ -1,3 +1,4 @@
|
|||
import { log } from '../../../../ppcp-axo/resources/js/Helper/Debug';
|
||||
import { populateWooFields } from '../helpers/fieldHelpers';
|
||||
import { injectShippingChangeButton } from '../components/Shipping';
|
||||
import { injectCardChangeButton } from '../components/Card';
|
||||
|
@ -17,7 +18,7 @@ export const createEmailLookupHandler = (
|
|||
) => {
|
||||
return async ( email ) => {
|
||||
try {
|
||||
console.log( 'Email value being looked up:', email );
|
||||
log( `Email value being looked up: ${ email }` );
|
||||
|
||||
if ( ! fastlaneSdk ) {
|
||||
throw new Error( 'FastlaneSDK is not initialized' );
|
||||
|
@ -32,7 +33,7 @@ export const createEmailLookupHandler = (
|
|||
const lookup =
|
||||
await fastlaneSdk.identity.lookupCustomerByEmail( email );
|
||||
|
||||
console.log( 'Lookup response:', lookup );
|
||||
log( `Lookup response: ${ JSON.stringify( lookup ) }` );
|
||||
|
||||
// Gary flow
|
||||
if ( lookup && lookup.customerContextId === '' ) {
|
||||
|
@ -40,7 +41,7 @@ export const createEmailLookupHandler = (
|
|||
}
|
||||
|
||||
if ( ! lookup || ! lookup.customerContextId ) {
|
||||
console.warn( 'No customerContextId found in the response' );
|
||||
log( 'No customerContextId found in the response', 'warn' );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -71,7 +72,7 @@ export const createEmailLookupHandler = (
|
|||
setCardDetails( profileData.card );
|
||||
}
|
||||
|
||||
console.log( 'Profile Data:', profileData );
|
||||
log( `Profile Data: ${ JSON.stringify( profileData ) }` );
|
||||
|
||||
populateWooFields(
|
||||
profileData,
|
||||
|
@ -82,12 +83,12 @@ export const createEmailLookupHandler = (
|
|||
injectShippingChangeButton( onChangeShippingAddressClick );
|
||||
injectCardChangeButton( onChangeCardButtonClick );
|
||||
} else {
|
||||
console.warn( 'Authentication failed or did not succeed' );
|
||||
log( 'Authentication failed or did not succeed', 'warn' );
|
||||
}
|
||||
} catch ( error ) {
|
||||
console.error(
|
||||
'Error during email lookup or authentication:',
|
||||
error
|
||||
log(
|
||||
`Error during email lookup or authentication:
|
||||
${ error }`
|
||||
);
|
||||
throw error;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue