Skip to content

Commit

Permalink
fix: prevent camel cased options from breaking order detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
joerivanveen committed Apr 18, 2024
1 parent 37944b1 commit 4cc83aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Factory/DeliveryOptionsAdapterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class DeliveryOptionsAdapterFactory
*/
public static function create(array $deliveryOptionsData): AbstractDeliveryOptionsAdapter
{
$deliveryOptionsData = Arr::fromObject($deliveryOptionsData);

/**
* To ensure backwards compatibility in consuming applications, we convert camelCase to snake_case here,
* only for shipmentOptions and pickupLocation. Everything else should remain camelCased.
Expand All @@ -48,7 +46,9 @@ public static function create(array $deliveryOptionsData): AbstractDeliveryOptio

if (array_key_exists('time', $deliveryOptionsData) && is_array($deliveryOptionsData['time'])) {
return new DeliveryOptionsV2Adapter($deliveryOptionsData);
} elseif (array_key_exists('deliveryType', $deliveryOptionsData)) {
}

if (array_key_exists('deliveryType', $deliveryOptionsData)) {
return new DeliveryOptionsV3Adapter($deliveryOptionsData);
}

Expand Down

0 comments on commit 4cc83aa

Please sign in to comment.