Class: SynapsePay::CardEndpoint
Instance Attribute Summary
Attributes inherited from APIEndpoint
#client
Instance Method Summary
collapse
Methods inherited from APIEndpoint
#initialize
Instance Method Details
#all(params = {}, headers = {}) ⇒ Object
4
5
6
7
8
|
# File 'lib/synapse_pay/endpoints/card_endpoint.rb', line 4
def all(params={}, ={})
method = APIMethod.new(:post, "/card/show", params, , self)
json = @client.execute(method)
APIList.new(:Card, json[:cards], method, @client)
end
|
#create(params = {}, headers = {}) ⇒ Object
10
11
12
13
14
|
# File 'lib/synapse_pay/endpoints/card_endpoint.rb', line 10
def create(params={}, ={})
method = APIMethod.new(:post, "/card/add", params, , self)
json = @client.execute(method)
Card.new(json[:card], method, @client)
end
|
#update(id, params = {}, headers = {}) ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'lib/synapse_pay/endpoints/card_endpoint.rb', line 16
def update(id, params={}, ={})
params = ParamsBuilder.merge({
:id => id,
}, params)
method = APIMethod.new(:post, "/card/edit", params, , self)
json = @client.execute(method)
Card.new(json[:card], method, @client)
end
|