Class: WindcaveRest::Session

Inherits:
Base
  • Object
show all
Defined in:
lib/windcave_rest/models/session.rb

Instance Method Summary collapse

Methods inherited from Base

#_deserialize, #_to_hash, api_attribute, attribute_map, #build_from_hash, #initialize, #to_body, #to_hash, #to_s, windcave_types

Constructor Details

This class inherits a constructor from WindcaveRest::Base

Instance Method Details

#select_card_id(session_id, merchant_id, purchase_type) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/windcave_rest/models/session.rb', line 14

def select_card_id(session_id, merchant_id, purchase_type)
  transactions.detect do |x| 
    x.session_id == session_id &&
    x.merchant_reference == merchant_id &&
    x.type == purchase_type
  end&.card&.id
end