Skip to content

Commit

Permalink
Merge pull request #109 from paynl/feature/PLUG-3313
Browse files Browse the repository at this point in the history
PLUG-3313 - Fix address for postNL plugin
  • Loading branch information
woutse authored May 21, 2024
2 parents dba9fac + 5980a1f commit 230357d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion includes/classes/PPMFWC/Gateway/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,16 @@ protected function startTransaction(WC_Order $order)
# Retrieve order data
$shippingAddress = $order->get_shipping_address_1() . ' ' . $order->get_shipping_address_2();
$billingAddress = $order->get_billing_address_1() . ' ' . $order->get_billing_address_2();
$aBillingAddress = \Paynl\Helper::splitAddress($billingAddress);

# Check order meta for postNL plugin house number
if (!empty($order->get_meta('_shipping_house_number'))) {
$shippingAddress = $order->get_shipping_address_1() . ' ' . $order->get_meta('_shipping_house_number') . $order->get_shipping_address_2();
}
if (!empty($order->get_meta('_billing_house_number'))) {
$billingAddress = $order->get_billing_address_1() . ' ' . $order->get_meta('_billing_house_number') . $order->get_billing_address_2();
}

$aBillingAddress = \Paynl\Helper::splitAddress($billingAddress);
$aShippingAddress = \Paynl\Helper::splitAddress($shippingAddress);
$address = array(
'streetName' => $aShippingAddress[0],
Expand Down

0 comments on commit 230357d

Please sign in to comment.