class Zoop::Transaction

Attributes

capture[RW]

Public Class Methods

new(response = {}) click to toggle source
Calls superclass method
# File lib/zoop/resources/transaction.rb, line 7
def initialize(response = {})
  super(response)

  self.currency         ||= 'BRL'
  self.payment_type     ||= 'credit'
  self.capture          ||= true
end

Public Instance Methods

capture!() click to toggle source
# File lib/zoop/resources/transaction.rb, line 15
def capture!
  params = { amount: amount.convert_to_cents, on_behalf_of: on_behalf_of }
  update_model Zoop::Request.post(url('capture'), params: params).run
  self
end
destroy() click to toggle source
# File lib/zoop/resources/transaction.rb, line 35
def destroy
  raise NotImplementedError
end
receivables() click to toggle source
# File lib/zoop/resources/transaction.rb, line 27
def receivables
  Zoop::Request.get( url 'receivables' ).call
end
refund() click to toggle source
# File lib/zoop/resources/transaction.rb, line 21
def refund
  params = { amount: amount.convert_to_cents, on_behalf_of: on_behalf_of }
  update_model Zoop::Request.post(url('void'), params: params).run
  self
end
split_rules() click to toggle source
# File lib/zoop/resources/transaction.rb, line 31
def split_rules
  Zoop::Request.get( url 'split_rules' ).call
end