class StarkitBanking::YBL::Account::GetBalance

Constants

AccountNumber

Private Instance Methods

credentials(payment_account) click to toggle source
# File lib/starkit_banking/api/ybl/account/balance.rb, line 21
def credentials(payment_account)
  payment_account.credentials
end
invoke(env, req, callbacks) click to toggle source
# File lib/starkit_banking/api/ybl/account/balance.rb, line 13
def invoke(env, req, callbacks)
  ApiBanking::FundsTransferByCustomerService2.get_balance(env, req, callbacks)
end
request(subscription, payment_account) click to toggle source
# File lib/starkit_banking/api/ybl/account/balance.rb, line 25
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
response(rep) click to toggle source
# File lib/starkit_banking/api/ybl/account/balance.rb, line 17
def response(rep)
  Money.from_amount(rep.accountBalanceAmount, rep.accountCurrencyCode)
end
service_name() click to toggle source
# File lib/starkit_banking/api/ybl/account/balance.rb, line 9
def service_name
  'BALANCE ENQUIRY'
end
subscription(payment_account) click to toggle source
# File lib/starkit_banking/api/ybl/account/balance.rb, line 36
def subscription(payment_account)
  payment_account.service_subscriptions.find_by(service_name: service_name)
end