mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 02:09:39 +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
|
begin
|
||||||
response = @client.call :paringesindus_v4, message: body(
|
response = @client.call :paringesindus_v4, message: body(
|
||||||
'fyysilise_isiku_kood' => ident,
|
'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
|
content = extract response, :paringesindus_v4_response
|
||||||
unless content.blank?
|
unless content.blank?
|
||||||
|
@ -139,6 +139,12 @@ module Soap
|
||||||
{keha: args}
|
{keha: args}
|
||||||
end
|
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)
|
def extract(response, element)
|
||||||
# response envelope body has again header/body under element; header is user and password returned
|
# response envelope body has again header/body under element; header is user and password returned
|
||||||
response.hash[:envelope][:body][element][:keha]
|
response.hash[:envelope][:body][element][:keha]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue