-
-
Notifications
You must be signed in to change notification settings - Fork 278
Open
Description
The NetSuite::Support::Country initializer only maps uppercase ISO country codes (e.g., "IN"), but fails silently for lowercase inputs (e.g., "in"), resulting in an invalid @id.
Steps to Reproduce:
NetSuite::Records::Address.new(
addressee: "Test Company",
country: "IN"
)
# => @id = "_india"
NetSuite::Records::Address.new(
addressee: "Test Company",
country: "in"
)
# => @id = "in" (invalid)
Expected Behavior:
The country input should be normalized (e.g., upcase) before lookup, so both "IN" and "in" map to "_india".
Suggested Fix:
In NetSuite::Support::Country#initialize:
if iso_or_name.to_s.upcase =~ /^[A-Z]{2}/
@id = iso_to_netsuite.fetch(iso_or_name.to_s.upcase)
Gem Version - netsuite (0.9.3)
Ruby Version - ruby 2.7.8p225 (2023-03-30 revision 1f4d455848)
Metadata
Metadata
Assignees
Labels
No labels
