Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/hushed/documents/request/hash_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def ship_to_hash
'Address1' => ship_address.address1,
'Address2' => ship_address.address2,
'City' => ship_address.city,
'State' => ship_address.state.name,
'State' => state(ship_address),
'PostalCode' => ship_address.zipcode,
'Country' => ship_address.country.name
}
Expand All @@ -32,7 +32,7 @@ def bill_to_hash
'Address1' => bill_address.address1,
'Address2' => bill_address.address2,
'City' => bill_address.city,
'State' => bill_address.state.name,
'State' => state(bill_address),
'PostalCode' => bill_address.zipcode,
'Country' => bill_address.country.name
}
Expand All @@ -42,6 +42,10 @@ def bill_to_hash
def normalize_sku(sku)
sku.chomp("-SET")
end

def state(address)
address.state ? address.state.name : address.state_name
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I did this very change in another shipping implementation that utilizes XML! Eerily familiar. Anyway, looks 👍

end
end
end
end
Expand Down