From 87a95630bc8c6dc3106ecb2a024346358cd54fff Mon Sep 17 00:00:00 2001 From: Dan Hinze Date: Tue, 23 Apr 2024 21:38:16 -0500 Subject: [PATCH] Fixes to integrate with vets-website --- config/betamocks/services_config.yml | 4 ++++ modules/travel_pay/app/services/travel_pay/client.rb | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config/betamocks/services_config.yml b/config/betamocks/services_config.yml index 0c8d6f0e546..07aed046a63 100644 --- a/config/betamocks/services_config.yml +++ b/config/betamocks/services_config.yml @@ -21,6 +21,10 @@ :path: "/veis/api/btsss/travelclaim/api/v1/Auth/access-token" :file_path: "/travel_pay/token/default" :response_delay: 0.3 + - :method: :get + :path: "/veis/api/btsss/travelclaim/api/v1/claims" + :file_path: "/travel_pay/status/default" + :response_delay: 0.3 - :method: :post :path: <%= "/#{Settings.ask_va_api.crm_api.veis_api_path}/inquiries/new" %> :file_path: "/ask_va/crm_api/post_inquiries/default" diff --git a/modules/travel_pay/app/services/travel_pay/client.rb b/modules/travel_pay/app/services/travel_pay/client.rb index 24ef261c2c9..89ba2b4d00f 100644 --- a/modules/travel_pay/app/services/travel_pay/client.rb +++ b/modules/travel_pay/app/services/travel_pay/client.rb @@ -88,11 +88,14 @@ def get_claims(veis_token, btsss_token) end symbolized_body = response.body.deep_symbolize_keys - parse_claim_date = ->(c) { Date.parse(c[:modified_on]) } + parse_claim_date = ->(c) { Date.parse(c[:modifiedOn]) } symbolized_body[:data].sort_by(&parse_claim_date).reverse! + symbolized_body end def request_sts_token(user) + return nil if mock_enabled? + host_baseurl = build_host_baseurl({ ip_form: false }) private_key_file = Settings.sign_in.sts_client.key_path private_key = OpenSSL::PKey::RSA.new(File.read(private_key_file))