Merge pull request #3524 from woocommerce/PCP-4484-apple-pay-does-not-reflect-updated-shipping-method-or-address-changes-on-checkout

Apple Pay does not update shipping method or address changes on Classic Checkout (4484)
This commit is contained in:
Niklas Gutberlet 2025-08-04 19:31:40 +02:00 committed by GitHub
commit 0b6046ad73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -334,12 +334,22 @@ class ApplePayButton extends PaymentButton {
this.checkEligibility();
}
reinit() {
async reinit() {
// Missing (invalid) configuration indicates, that the first `init()` call did not happen yet.
if ( ! this.validateConfiguration( true ) ) {
return;
}
// Ensures transaction info is updated when cart or checkout update events are triggered.
await this.contextHandler
.transactionInfo()
.then( ( transactionInfo ) => {
this.transactionInfo = transactionInfo;
} )
.catch( ( error ) => {
console.error( 'Failed to get transaction info:', error );
} );
super.reinit();
this.init();