Class: PriorityPayoutGateway::CustomerVault

Inherits:
Api
  • Object
show all
Defined in:
lib/priority_payout_gateway/customer_vault.rb

Constant Summary

Constants inherited from Api

Api::QUERY_URL, Api::TRANSACTION_URL

Instance Attribute Summary

Attributes inherited from Api

#password, #query, #username

Instance Method Summary collapse

Methods inherited from Api

#get, #initialize, #post

Constructor Details

This class inherits a constructor from PriorityPayoutGateway::Api

Instance Method Details

#create(options = {}) ⇒ Object

PriorityPayoutGateway::CustomerVault.new.create ccnumber: ‘4111111111111111’, ccexp: “0219”, first_name: “John”, last_name: “Doe”



5
6
7
8
9
10
11
# File 'lib/priority_payout_gateway/customer_vault.rb', line 5

def create(options = {})
  query = set_query(options)
  query[:customer_vault] = 'add_customer'

  require_fields(:ccnumber, :ccexp)
  response = post query
end

#destroy(options = {}) ⇒ Object

PriorityPayoutGateway::CustomerVault.new.destroy customer_vault_id: 481397475



22
23
24
25
26
27
# File 'lib/priority_payout_gateway/customer_vault.rb', line 22

def destroy(options = {})
  query = set_query(options)
  query[:customer_vault] = 'delete_customer'
  require_fields(:customer_vault_id)
  response = post query
end

#find(options = {}) ⇒ Object

PriorityPayoutGateway::CustomerVault.new.find customer_vault_id: 481397475



30
31
32
33
34
35
# File 'lib/priority_payout_gateway/customer_vault.rb', line 30

def find(options = {})
  query = set_query(options)
  query[:report_type] = 'customer_vault'
  require_fields(:customer_vault_id)
  response = get query
end

#update(options = {}) ⇒ Object

PriorityPayoutGateway::CustomerVault.new.update customer_vault_id: 481397475, ccnumber: ‘4111111111111111’, ccexp: “0220”, first_name: “Jane”, last_name: “Doe”



14
15
16
17
18
19
# File 'lib/priority_payout_gateway/customer_vault.rb', line 14

def update(options = {})
  query = set_query(options)
  query[:customer_vault] = 'update_customer'
  require_fields(:customer_vault_id)
  response = post query
end