Sha256: ccb6abdcb286698a747998ec20899b3ad62ab305db5425dddecbb5747f0400e6

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

module StarkitBanking
  module YBL
    module Account
      class GetBalance
        include ApiClient
      
        private 
        
        def service_name
          'BALANCE ENQUIRY'
        end
      
        def invoke(env, req)
          ApiBanking::FundsTransferByCustomerService2.get_balance(env, req)          
        end
        
        def response(rep)
          Money.new(rep.accountBalanceAmount, rep.accountCurrencyCode)
        end
      
        def credentials(payment_account)
          payment_account.credentials
        end
      
        def request(subscription, payment_account)
        
          request = ApiBanking::FundsTransferByCustomerService2::GetBalance::Request.new()

          request.appID = subscription.app_id
          request.customerID = payment_account.customer_id
          request.AccountNumber = payment_account.account_number
        
          request       
        end
      
        def subscription(payment_account)
          payment_account.service_subscriptions.find_by(service_name: service_name)
        end
  
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
starkit_banking-0.1.9 lib/starkit_banking/api/ybl/account/balance.rb
starkit_banking-0.1.8 lib/starkit_banking/api/ybl/account/balance.rb
starkit_banking-0.1.7 lib/starkit_banking/api/ybl/account/balance.rb
starkit_banking-0.1.6 lib/starkit_banking/api/ybl/account/balance.rb
starkit_banking-0.1.5 lib/starkit_banking/api/ybl/account/balance.rb
starkit_banking-0.1.4 lib/starkit_banking/api/ybl/account/balance.rb