Class: Frame::ChargeIntent

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

Constant Summary collapse

OBJECT_NAME =
"charge_intent"
DEPRECATED_METHODS =
%i[create retrieve list confirm capture cancel void_remaining save].freeze

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 included from APIOperations::Save

#serialize_params

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

Deprecated.

Removed at v2. No canonical transfer equivalent yet (FRA-4463).



99
100
101
102
103
104
105
106
# File 'lib/frame/resources/charge_intent.rb', line 99

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

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

Deprecated.

Removed at v2. No canonical transfer equivalent yet (FRA-4463).



79
80
81
82
83
84
85
86
# File 'lib/frame/resources/charge_intent.rb', line 79

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

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

Deprecated.

Use Frame::Transfer.confirm instead. Removed at v2.



59
60
61
62
63
64
65
66
# File 'lib/frame/resources/charge_intent.rb', line 59

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

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

Deprecated.

Use Frame::Transfer.create instead. Removed at v2.



18
19
20
21
22
23
24
25
# File 'lib/frame/resources/charge_intent.rb', line 18

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

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

Deprecated.

Use Frame::Transfer.list instead. Removed at v2.



28
29
30
31
32
33
34
35
# File 'lib/frame/resources/charge_intent.rb', line 28

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

.object_nameObject



11
12
13
# File 'lib/frame/resources/charge_intent.rb', line 11

def self.object_name
  OBJECT_NAME
end

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

Deprecated.

Use Frame::Transfer.retrieve instead. Removed at v2.



38
39
40
41
42
43
44
45
46
# File 'lib/frame/resources/charge_intent.rb', line 38

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

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

Deprecated.

Removed at v2. No canonical transfer equivalent yet (FRA-4463).



119
120
121
122
123
124
125
126
# File 'lib/frame/resources/charge_intent.rb', line 119

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

Instance Method Details

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

Deprecated.

Removed at v2. No canonical transfer equivalent yet (FRA-4463).



89
90
91
92
93
94
95
96
# File 'lib/frame/resources/charge_intent.rb', line 89

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

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

Deprecated.

Removed at v2. No canonical transfer equivalent yet (FRA-4463).



69
70
71
72
73
74
75
76
# File 'lib/frame/resources/charge_intent.rb', line 69

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

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

Deprecated.

Use Frame::Transfer.confirm instead. Removed at v2.



49
50
51
52
53
54
55
56
# File 'lib/frame/resources/charge_intent.rb', line 49

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

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

Deprecated.

Removed at v2. No canonical transfer equivalent yet (FRA-4463).



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/frame/resources/charge_intent.rb', line 129

def save(params = {}, opts = {})
  values = serialize_params(self).merge(params)

  if values.empty?
    return self
  end

  updated = request_object(
    :patch,
    "/v1/charge_intents/#{CGI.escape(self["id"])}",
    values,
    opts
  )

  initialize_from(updated)
  self
end

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

Deprecated.

Removed at v2. No canonical transfer equivalent yet (FRA-4463).



109
110
111
112
113
114
115
116
# File 'lib/frame/resources/charge_intent.rb', line 109

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