mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Merge pull request #3535 from woocommerce/PCP-5012-address-mapping-for-non-us-non-ca-countries-fails-in-fastlane-ryan-flow
Axo: Make the state address data optional to fix non US-CA compatibility (5012)
This commit is contained in:
commit
ff38eb06ec
3 changed files with 8 additions and 9 deletions
|
@ -121,7 +121,7 @@ export const populateWooFields = (
|
|||
address_1: address.addressLine1,
|
||||
address_2: address.addressLine2 || '',
|
||||
city: address.adminArea2,
|
||||
state: address.adminArea1,
|
||||
state: address.adminArea1 || '',
|
||||
postcode: address.postalCode,
|
||||
country: address.countryCode,
|
||||
phone: phoneNumber.nationalNumber,
|
||||
|
|
|
@ -32,7 +32,7 @@ export const useShippingAddressChange = ( fastlaneSdk, setShippingAddress ) => {
|
|||
address_1: address.addressLine1,
|
||||
address_2: address.addressLine2 || '',
|
||||
city: address.adminArea2,
|
||||
state: address.adminArea1,
|
||||
state: address.adminArea1 || '',
|
||||
postcode: address.postalCode,
|
||||
country: address.countryCode,
|
||||
phone: phoneNumber.nationalNumber,
|
||||
|
|
|
@ -44,7 +44,7 @@ class ShippingView {
|
|||
? this.states[ countryCode ][ stateCode ]
|
||||
: stateCode;
|
||||
|
||||
if ( this.hasEmptyValues( data, stateName ) ) {
|
||||
if ( this.hasEmptyValues( data ) ) {
|
||||
return `
|
||||
<div style="margin-bottom: 20px;">
|
||||
<div class="axo-checkout-header-section">
|
||||
|
@ -71,9 +71,9 @@ class ShippingView {
|
|||
) }</div>
|
||||
<div>${ data.value( 'street1' ) }</div>
|
||||
<div>${ data.value( 'street2' ) }</div>
|
||||
<div>${ data.value(
|
||||
'city'
|
||||
) }, ${ stateName } ${ data.value( 'postCode' ) }</div>
|
||||
<div>${ data.value( 'city' ) }${
|
||||
stateName ? ', ' + stateName : ''
|
||||
} ${ data.value( 'postCode' ) }</div>
|
||||
<div>${ valueOfSelect(
|
||||
'#billing_country',
|
||||
countryCode
|
||||
|
@ -158,14 +158,13 @@ class ShippingView {
|
|||
} );
|
||||
}
|
||||
|
||||
hasEmptyValues( data, stateName ) {
|
||||
hasEmptyValues( data ) {
|
||||
return (
|
||||
! data.value( 'email' ) ||
|
||||
! data.value( 'firstName' ) ||
|
||||
! data.value( 'lastName' ) ||
|
||||
! data.value( 'street1' ) ||
|
||||
! data.value( 'city' ) ||
|
||||
! stateName
|
||||
! data.value( 'city' )
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue