Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Check for address on shippingData (#8878)
Browse files Browse the repository at this point in the history
  • Loading branch information
opr authored and Aljullu committed Mar 28, 2023
1 parent b874995 commit 9185529
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions assets/js/data/payment/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down

0 comments on commit 9185529

Please sign in to comment.