Class: Afterbanks::Transaction
- Defined in:
- lib/afterbanks/resources/transaction.rb
Class Method Summary collapse
Methods inherited from Resource
fields_information, #fields_information, has_fields, #initialize
Constructor Details
This class inherits a constructor from Afterbanks::Resource
Class Method Details
.list(service:, username:, password:, password2: nil, document_type: nil, account_id: nil, products:, check_products_presence: false, startdate:, session_id: nil, otp: nil, counter_id: nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/afterbanks/resources/transaction.rb', line 14 def list(service:, username:, password:, password2: nil, document_type: nil, account_id: nil, products:, check_products_presence: false, startdate:, session_id: nil, otp: nil, counter_id: nil) params = { servicekey: Afterbanks.configuration.servicekey, service: service, user: username, pass: password, products: products, startdate: startdate.strftime("%d-%m-%Y") } params.merge!(pass2: password2) unless password2.nil? params.merge!(documentType: document_type) unless document_type.nil? params.merge!(account_id: account_id) unless account_id.nil? params.merge!(session_id: session_id) unless session_id.nil? params.merge!(OTP: otp) unless otp.nil? params.merge!(counterId: counter_id) unless counter_id.nil? response, debug_id = Afterbanks.api_call( method: :post, path: '/V3/', params: params ) if check_products_presence ensure_no_product_is_missing( response: response, debug_id: debug_id, products: products ) end Response.new( result: Collection.new( transactions_information_for( service: service, response: response, products: products ), self ), debug_id: debug_id ) end |