Class: BMLConnect::Transactions

Inherits:
Object
  • Object
show all
Defined in:
lib/bml_connect/transactions.rb

Constant Summary collapse

END_POINT =
'transactions'

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Transactions

Returns a new instance of Transactions.



11
12
13
# File 'lib/bml_connect/transactions.rb', line 11

def initialize(client)
  @client = client
end

Instance Method Details

#create(params) ⇒ Object



15
16
17
18
19
20
# File 'lib/bml_connect/transactions.rb', line 15

def create(params)
  transaction = BMLConnect::Models::Transaction.new(params)
  # generate signature
  transaction.sign(@client.api_key)
  @client.post(END_POINT, transaction.to_hash)
end

#get(id) ⇒ Object



22
23
24
# File 'lib/bml_connect/transactions.rb', line 22

def get(id)
  @client.get(END_POINT + "/#{id}")
end

#list(params = {}) ⇒ Object



26
27
28
# File 'lib/bml_connect/transactions.rb', line 26

def list(params = {})
  @client.get(END_POINT, params)
end