Class: SynapsePay::Card

Inherits:
APIResource show all
Defined in:
lib/synapse_pay/resources/card.rb

Instance Attribute Summary collapse

Attributes inherited from APIResource

#api_method, #client, #json

Instance Method Summary collapse

Methods inherited from APIResource

api_attribute_names, #api_attributes, api_subclass_fetch, api_subclasses, #changed_api_attributes, #clear_api_attributes, #determine_api_attribute_value, determine_api_attribute_value, #initialize, #inspect, #inspect_api_attributes, #inspect_nested, #refresh_from, register_api_subclass, #to_json

Constructor Details

This class inherits a constructor from SynapsePay::APIResource

Instance Attribute Details

#account_classObject

Returns the value of attribute account_class.



3
4
5
# File 'lib/synapse_pay/resources/card.rb', line 3

def 
  @account_class
end

#account_number_stringObject

Returns the value of attribute account_number_string.



4
5
6
# File 'lib/synapse_pay/resources/card.rb', line 4

def 
  @account_number_string
end

#account_typeObject

Returns the value of attribute account_type.



5
6
7
# File 'lib/synapse_pay/resources/card.rb', line 5

def 
  @account_type
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/synapse_pay/resources/card.rb', line 6

def id
  @id
end

#name_on_accountObject

Returns the value of attribute name_on_account.



7
8
9
# File 'lib/synapse_pay/resources/card.rb', line 7

def 
  @name_on_account
end

#resource_uriObject

Returns the value of attribute resource_uri.



8
9
10
# File 'lib/synapse_pay/resources/card.rb', line 8

def resource_uri
  @resource_uri
end

#routing_number_stringObject

Returns the value of attribute routing_number_string.



9
10
11
# File 'lib/synapse_pay/resources/card.rb', line 9

def routing_number_string
  @routing_number_string
end

Instance Method Details

#update(params = {}, headers = {}) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/synapse_pay/resources/card.rb', line 11

def update(params={}, headers={})
  params = ParamsBuilder.merge({
    :id => id,
  }, params)
  method = APIMethod.new(:post, "/card/edit", params, headers, self)
  json = @client.execute(method)
  self.refresh_from(json[:card], method, @client)
end