class Omise::Charge

Public Class Methods

create(attributes = {}) click to toggle source
# File lib/omise/charge.rb, line 27
def self.create(attributes = {})
  new resource(location, attributes).post(attributes)
end
list(attributes = {}) click to toggle source
# File lib/omise/charge.rb, line 23
def self.list(attributes = {})
  List.new resource(location, attributes).get(attributes)
end
retrieve(id, attributes = {}) click to toggle source
# File lib/omise/charge.rb, line 19
def self.retrieve(id, attributes = {})
  new resource(location(id), attributes).get(attributes)
end
schedule(attributes = {}) click to toggle source
# File lib/omise/charge.rb, line 15
def self.schedule(attributes = {})
  Scheduler.new(:charge, attributes)
end

Public Instance Methods

capture(options = {}) click to toggle source
# File lib/omise/charge.rb, line 39
def capture(options = {})
  assign_attributes nested_resource("capture", options).post
end
captured() click to toggle source
# File lib/omise/charge.rb, line 83
def captured
  lookup_attribute_value :captured, :paid
end
customer(options = {}) click to toggle source
# File lib/omise/charge.rb, line 51
def customer(options = {})
  if !defined?(Customer)
    require "omise/customer"
  end

  expand_attribute Customer, "customer", options
end
dispute(options = {}) click to toggle source
# File lib/omise/charge.rb, line 59
def dispute(options = {})
  if !defined?(Dispute)
    require "omise/dispute"
  end

  expand_attribute Dispute, "dispute", options
end
events(attributes = {}) click to toggle source
# File lib/omise/charge.rb, line 75
def events(attributes = {})
  List.new nested_resource("events", attributes).get(attributes)
end
expire(options = {}) click to toggle source
# File lib/omise/charge.rb, line 47
def expire(options = {})
  assign_attributes nested_resource("expire", options).post
end
paid() click to toggle source
refunds() click to toggle source
# File lib/omise/charge.rb, line 79
def refunds
  list_attribute RefundList, "refunds"
end
reload(attributes = {}) click to toggle source
# File lib/omise/charge.rb, line 31
def reload(attributes = {})
  assign_attributes resource(attributes).get(attributes)
end
reverse(options = {}) click to toggle source
# File lib/omise/charge.rb, line 43
def reverse(options = {})
  assign_attributes nested_resource("reverse", options).post
end
transaction(options = {}) click to toggle source
# File lib/omise/charge.rb, line 67
def transaction(options = {})
  if !defined?(Transaction)
    require "omise/transaction"
  end

  expand_attribute Transaction, "transaction", options
end
update(attributes = {}) click to toggle source
# File lib/omise/charge.rb, line 35
def update(attributes = {})
  assign_attributes resource(attributes).patch(attributes)
end