mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
🔊 Console error when button init fails
This commit is contained in:
parent
e80b81da72
commit
843403cbdc
1 changed files with 12 additions and 3 deletions
|
@ -59,9 +59,18 @@ class GooglepayManager {
|
|||
this.transactionInfo = await this.fetchTransactionInfo();
|
||||
}
|
||||
|
||||
for ( const button of this.buttons ) {
|
||||
button.configure( this.googlePayConfig, this.transactionInfo );
|
||||
button.init();
|
||||
if ( ! this.googlePayConfig ) {
|
||||
console.error( 'No GooglePayConfig received during init' );
|
||||
} else if ( ! this.transactionInfo ) {
|
||||
console.error( 'No transactionInfo found during init' );
|
||||
} else {
|
||||
for ( const button of this.buttons ) {
|
||||
button.configure(
|
||||
this.googlePayConfig,
|
||||
this.transactionInfo
|
||||
);
|
||||
button.init();
|
||||
}
|
||||
}
|
||||
} catch ( error ) {
|
||||
console.error( 'Error during initialization:', error );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue