This commit is contained in:
Thomas Roberts 2023-03-27 17:33:18 +01:00 committed by GitHub
parent 3d1caca059
commit be2ba748be
1 changed files with 5 additions and 2 deletions

View File

@ -109,10 +109,13 @@ export const __internalEmitPaymentProcessingEvent: emitProcessingEventType = (
);
}
if ( shippingDataFromResponse ) {
if (
objectHasProp( shippingDataFromResponse, 'address' ) &&
shippingDataFromResponse.address
) {
// Set this here so that old extensions still using shippingData can set the shippingAddress.
shippingAddress =
shippingDataFromResponse as ShippingAddress;
shippingDataFromResponse.address as ShippingAddress;
deprecated(
'returning shippingData from an onPaymentProcessing observer in WooCommerce Blocks',
{