Skip to content

Commit

Permalink
LPD-31640 Fix UPS CX
Browse files Browse the repository at this point in the history
  • Loading branch information
alessiorendina authored and brianchandotcom committed Jul 17, 2024
1 parent e0bf497 commit a4a89b3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,32 +278,34 @@ private JSONObject _postRate(
shippingAddressJSONObject.getString("regionISOCode")
)
)
)
).put(
"Shipper",
new JSONObject(
).put(
"Address",
"Shipper",
new JSONObject(
).put(
"AddressLine",
new JSONArray(
"Address",
new JSONObject(
).put(
typeSettingsJSONObject.getString(
"shipperAddressLine1")
"AddressLine",
new JSONArray(
).put(
typeSettingsJSONObject.getString(
"shipperAddressLine1")
).put(
typeSettingsJSONObject.getString(
"shipperAddressLine2")
).put(
typeSettingsJSONObject.getString(
"shipperAddressLine3")
)
).put(
"CountryCode",
typeSettingsJSONObject.getString(
"shipperAddressLine2")
"shipperCountryCode")
).put(
"PostalCode",
typeSettingsJSONObject.getString(
"shipperAddressLine3")
"shipperPostalCode")
)
).put(
"CountryCode",
typeSettingsJSONObject.getString("shipperCountryCode")
).put(
"PostalCode",
typeSettingsJSONObject.getString("shipperPostalCode")
)
)
)
Expand Down Expand Up @@ -339,7 +341,7 @@ private JSONObject _postRate(
}
}

return new JSONObject(StringPool.BLANK);
return new JSONObject();
}

private JSONArray _toShippingOptionsJSONArray(JSONArray jsonArray) {
Expand All @@ -348,6 +350,10 @@ private JSONArray _toShippingOptionsJSONArray(JSONArray jsonArray) {
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);

if (!jsonObject.has("RateResponse")) {
continue;
}

JSONObject rateResponseJSONObject = jsonObject.getJSONObject(
"RateResponse");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#
# LXC
#

com.liferay.lxc.dxp.domains=localhost:8080
com.liferay.lxc.dxp.mainDomain=localhost:8080
com.liferay.lxc.dxp.server.protocol=http

#
# OAuth
#
Expand Down

0 comments on commit a4a89b3

Please sign in to comment.