Class: SynapsePayRest::CardUsNode

Inherits:
BaseNode
  • Object
show all
Defined in:
lib/synapse_pay_rest/models/node/card_us_node.rb

Instance Attribute Summary

Attributes inherited from BaseNode

#access_token, #account_class, #account_id, #account_number, #account_type, #address, #address_city, #address_country_code, #address_postal_code, #address_street, #address_subdivision, #allow_foreign_transactions, #atm_withdrawal_limit, #balance, #bank_id, #bank_long_name, #bank_name, #bank_pw, #card_hash, #card_style_id, #card_type, #correspondent_address, #correspondent_bank_name, #correspondent_routing_number, #correspondent_swift, #currency, #document_id, #email_match, #gateway_restricted, #id, #ifsc, #interchange_type, #is_active, #is_international, #max_pin_attempts, #monthly_withdrawals_remaining, #name_match, #name_on_account, #network, #nickname, #other, #payee_address, #payee_name, #permission, #phonenumber_match, #portfolio_BTC, #portfolio_ETH, #pos_withdrawal_limit, #routing_number, #security_alerts, #supp_id, #swift, #type, #user

Instance Method Summary collapse

Methods inherited from BaseNode

#==, all, create, #create_subnet, #create_transaction, #deactivate, #find_subnet, #find_transaction, from_response, #get_statement, #initialize, multiple_from_response, #subnets, #transactions

Constructor Details

This class inherits a constructor from SynapsePayRest::BaseNode

Instance Method Details

#reissue_cardSynapsePayRest::CardUsNode

Reissues Debit Card on a node Use Reissue if you wish to change the card number associated with the debit card. This is meant to be used in instances where the user wishes to change their existing card number (due to fraud or any other reason).

Returns:

Raises:



45
46
47
48
# File 'lib/synapse_pay_rest/models/node/card_us_node.rb', line 45

def reissue_card()
  response = user.client.nodes.reissue_card(user_id: user.id, node_id: id)
  self.class.from_response(user, response)
end

#reorder_cardSynapsePayRest::cardUsNode

Reorders Debit Card on a node Use Reorder if the user wishes to keep the same card number but want to order a new plastic. Can be used in scenarios where the user’s card was destroyed.

Returns:

  • (SynapsePayRest::cardUsNode)

Raises:



57
58
59
60
# File 'lib/synapse_pay_rest/models/node/card_us_node.rb', line 57

def reorder_card()
  response = user.client.nodes.reorder_card(user_id: user.id, node_id: id)
  self.class.from_response(user, response)
end

#update_allowed(allowed:) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/synapse_pay_rest/models/node/card_us_node.rb', line 28

def update_allowed(allowed:)
  if allowed.empty?
    raise ArgumentError, 'must provide some key-value pairs to update'
  end
  payload = { 'allowed': allowed }
  response = user.client.nodes.patch(user_id: user.id, node_id: id, payload: payload)
  self.class.from_response(user, response)
end

#update_preferences(**options) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/synapse_pay_rest/models/node/card_us_node.rb', line 19

def update_preferences(**options)
  if options.empty?
    raise ArgumentError, 'must provide some key-value pairs to update'
  end
  payload = payload_for_preferences(options)
  response = user.client.nodes.patch(user_id: user.id, node_id: id, payload: payload)
  self.class.from_response(user, response)
end