Skip to content

Commit

Permalink
Merge pull request #97 from degica/payins-sending-shipping-address-wh…
Browse files Browse the repository at this point in the history
…en-default-billing

Add shipping_address to the API request when the default shipping_address is the billing_address
  • Loading branch information
Resonious authored Jan 18, 2024
2 parents 1b26fcf + 57c7b7f commit 6586adc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions class-wc-gateway-komoju.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ public function create_session_for_order($order_id, $payment_type = null)
}

$shipping_address = null;
$ship_to_billing = get_option('woocommerce_ship_to_destination') === 'billing';

if ($order->has_shipping_address()) {
$shipping_address = [
'zipcode' => $order->get_shipping_postcode(),
Expand All @@ -182,6 +184,8 @@ public function create_session_for_order($order_id, $payment_type = null)
'state' => $order->get_shipping_state(),
'city' => $order->get_shipping_city(),
];
} elseif ($ship_to_billing) {
$shipping_address = $billing_address;
}

// new session
Expand Down

0 comments on commit 6586adc

Please sign in to comment.