mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Story #105846070 - support for country code remapping will be required
This commit is contained in:
parent
310002f006
commit
38c43d6279
1 changed files with 8 additions and 2 deletions
|
@ -89,7 +89,7 @@ module Soap
|
|||
begin
|
||||
response = @client.call :paringesindus_v4, message: body(
|
||||
'fyysilise_isiku_kood' => ident,
|
||||
'fyysilise_isiku_koodi_riik' => ident_cc
|
||||
'fyysilise_isiku_koodi_riik' => country_code_3(ident_cc)
|
||||
)
|
||||
content = extract response, :paringesindus_v4_response
|
||||
unless content.blank?
|
||||
|
@ -138,7 +138,13 @@ module Soap
|
|||
end
|
||||
{keha: args}
|
||||
end
|
||||
|
||||
|
||||
# TLA --- three letter acronym required not two letter acronyms, transform
|
||||
def country_code_3(code)
|
||||
# FIXME: need service class for this data
|
||||
code.length == 3 ? code : {'EE' => 'EST', 'SE' => 'SWE', 'FI' => 'FIN', 'DK' => 'DEN'}[code]
|
||||
end
|
||||
|
||||
def extract(response, element)
|
||||
# response envelope body has again header/body under element; header is user and password returned
|
||||
response.hash[:envelope][:body][element][:keha]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue