class GlimrApiClient::PayByAccount
Attributes
request_body[R]
Public Class Methods
new(params)
click to toggle source
# File lib/glimr_api_client/pay_by_account.rb, line 13 def initialize(params) @request_body = params end
Private Instance Methods
check_request!()
click to toggle source
# File lib/glimr_api_client/pay_by_account.rb, line 19 def check_request! errors = [] [ :feeLiabilityId, :pbaAccountNumber, :pbaConfirmationCode, :pbaTransactionReference ].each do |required| errors << required if request_body.fetch(required, nil).nil? end if request_body.fetch(:pbaTransactionReference, '').size > 240 errors << :pbaTransactionReferenceTooLong end raise RequestError, errors unless errors.empty? end
endpoint()
click to toggle source
# File lib/glimr_api_client/pay_by_account.rb, line 36 def endpoint '/pbapaymentrequest' end
re_raise_error(body)
click to toggle source
rubocop:disable Metrics/CyclomaticComplexity
Calls superclass method
GlimrApiClient::Api#re_raise_error
# File lib/glimr_api_client/pay_by_account.rb, line 41 def re_raise_error(body) error = body.fetch(:message, nil) case body.fetch(:glimrerrorcode, nil) when 511 # FeeLiability not found for FeeLiabilityID raise FeeLiabilityNotFound, error when 512 # PBA account \w+ not found raise AccountNotFound, error when 513 # Invalid PBAAccountNumber/PBAConfirmationCode combination raise InvalidAccountAndConfirmation, error when 514 # Invalid AmountToPay raise InvalidAmount, error when 521 # PBAGlobalStatus is inactive raise GlobalStatusInactive, error when 522 # PBAJurisdictionStatus is inactive raise JurisdictionStatusInactive, error end super(message: error) end