Class: Frame::Refund

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Defined in:
lib/frame/resources/refund.rb

Constant Summary collapse

OBJECT_NAME =
"refund"

Instance Attribute Summary

Attributes inherited from FrameObject

#id, #original_values

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods inherited from APIResource

class_name, #refresh, resource_url, #resource_url

Methods included from APIOperations::Request

included

Methods inherited from FrameObject

#[], #[]=, construct_from, #each, #initialize, #initialize_from, #inspect, #keys, #serialize_params, #to_hash, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Frame::FrameObject

Class Method Details

.cancel(id, params = {}, opts = {}) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/frame/resources/refund.rb', line 51

def self.cancel(id, params = {}, opts = {})
  request_object(
    :post,
    "/v1/refunds/#{CGI.escape(id)}/cancel",
    params,
    opts
  )
end

.create(params = {}, opts = {}) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/frame/resources/refund.rb', line 14

def self.create(params = {}, opts = {})
  request_object(
    :post,
    "/v1/refunds",
    params,
    opts
  )
end

.list(params = {}, opts = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/frame/resources/refund.rb', line 23

def self.list(params = {}, opts = {})
  request_object(
    :get,
    "/v1/refunds",
    params,
    opts
  )
end

.object_nameObject



10
11
12
# File 'lib/frame/resources/refund.rb', line 10

def self.object_name
  OBJECT_NAME
end

.retrieve(id, opts = {}) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/frame/resources/refund.rb', line 32

def self.retrieve(id, opts = {})
  id = Util.normalize_id(id)
  request_object(
    :get,
    "/v1/refunds/#{CGI.escape(id)}",
    {},
    opts
  )
end

Instance Method Details

#cancel(params = {}, opts = {}) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/frame/resources/refund.rb', line 42

def cancel(params = {}, opts = {})
  request_object(
    :post,
    "/v1/refunds/#{CGI.escape(self["id"])}/cancel",
    params,
    opts
  )
end