Class: Raas::DepositRequestModel

Inherits:
BaseModel show all
Defined in:
lib/raas/models/deposit_request_model.rb

Overview

Represents the request to deposit funds via credit card

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(customer_identifier = nil, account_identifier = nil, credit_card_token = nil, amount = nil) ⇒ DepositRequestModel

Returns a new instance of DepositRequestModel.



33
34
35
36
37
38
39
40
41
# File 'lib/raas/models/deposit_request_model.rb', line 33

def initialize(customer_identifier = nil,
                = nil,
               credit_card_token = nil,
               amount = nil)
  @customer_identifier = customer_identifier
  @account_identifier = 
  @credit_card_token = credit_card_token
  @amount = amount
end

Instance Attribute Details

#account_identifierString

The account identifier

Returns:



13
14
15
# File 'lib/raas/models/deposit_request_model.rb', line 13

def 
  @account_identifier
end

#amountFloat

The amount to fund

Returns:

  • (Float)


21
22
23
# File 'lib/raas/models/deposit_request_model.rb', line 21

def amount
  @amount
end

#credit_card_tokenString

The credit card token

Returns:



17
18
19
# File 'lib/raas/models/deposit_request_model.rb', line 17

def credit_card_token
  @credit_card_token
end

#customer_identifierString

The customer identifier

Returns:



9
10
11
# File 'lib/raas/models/deposit_request_model.rb', line 9

def customer_identifier
  @customer_identifier
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/raas/models/deposit_request_model.rb', line 44

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  customer_identifier = hash['customerIdentifier']
   = hash['accountIdentifier']
  credit_card_token = hash['creditCardToken']
  amount = hash['amount']

  # Create object from extracted values.
  DepositRequestModel.new(customer_identifier,
                          ,
                          credit_card_token,
                          amount)
end

.namesObject

A mapping from model property names to API property names.



24
25
26
27
28
29
30
31
# File 'lib/raas/models/deposit_request_model.rb', line 24

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['customer_identifier'] = 'customerIdentifier'
  @_hash['account_identifier'] = 'accountIdentifier'
  @_hash['credit_card_token'] = 'creditCardToken'
  @_hash['amount'] = 'amount'
  @_hash
end