Skip to content

Commit

Permalink
Remove filtering of billing address details (#8257)
Browse files Browse the repository at this point in the history
Co-authored-by: Francesco <[email protected]>
  • Loading branch information
gpressutto5 and frosso authored Feb 23, 2024
1 parent efb21dc commit d20b82f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog/fix-billing-address-update
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fixed billing address line 2 not being updated for saved payment methods
1 change: 0 additions & 1 deletion includes/class-wc-payments-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ public static function get_billing_details_from_order( $order ) {
'phone' => $order->get_billing_phone(),
];

$billing_details['address'] = array_filter( $billing_details['address'] );
return array_filter( $billing_details );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ function ( $data ): bool {
'city' => $order->get_billing_city(),
'country' => $order->get_billing_country(),
'line1' => $order->get_billing_address_1(),
'line2' => $order->get_billing_address_2(),
'postal_code' => $order->get_billing_postcode(),
'state' => $order->get_billing_state(),
],
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test-class-wc-payments-customer-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ public function test_update_payment_method_with_billing_details_from_order() {
'city' => 'WooCity',
'country' => Country_Code::UNITED_STATES,
'line1' => 'WooAddress',
'line2' => '',
'postal_code' => '12345',
'state' => 'NY',
],
Expand Down

0 comments on commit d20b82f

Please sign in to comment.