Class: FormProfiles::VA1990s
- Inherits:
-
FormProfile
- Object
- FormProfile
- FormProfiles::VA1990s
- Defined in:
- app/models/form_profiles/va_1990s.rb
Instance Method Summary collapse
- #initialize_payment_information ⇒ Object private
- #mask(number) ⇒ Object private
- #metadata ⇒ Object
- #prefill ⇒ Object
Instance Method Details
#initialize_payment_information ⇒ Object (private)
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/models/form_profiles/va_1990s.rb', line 34 def initialize_payment_information return {} unless user.(:ppiu, :access?) && user.(:evss, :access?) service = EVSS::PPIU::Service.new(user) response = service.get_payment_information raw_account = response.responses.first&.payment_account if raw_account VA1990s::FormPaymentAccountInformation.new( account_type: raw_account&.account_type&.capitalize, account_number: raw_account&.account_number, routing_number: raw_account&.financial_institution_routing_number, bank_name: raw_account&.financial_institution_name ) else {} end rescue => e Rails.logger.error "Failed to retrieve PPIU data: #{e.}" {} end |
#mask(number) ⇒ Object (private)
56 57 58 |
# File 'app/models/form_profiles/va_1990s.rb', line 56 def mask(number) number.gsub(/.(?=.{4})/, '*') end |
#metadata ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/models/form_profiles/va_1990s.rb', line 24 def { version: 0, prefill: true, returnUrl: '/apply' } end |
#prefill ⇒ Object
19 20 21 22 |
# File 'app/models/form_profiles/va_1990s.rb', line 19 def prefill @payment_information = initialize_payment_information super end |