Class: Raas::DepositRequestModel
- Defined in:
- lib/raas/models/deposit_request_model.rb
Overview
Represents the request to deposit funds via credit card
Instance Attribute Summary collapse
-
#account_identifier ⇒ String
The account identifier.
-
#amount ⇒ Float
The amount to fund.
-
#credit_card_token ⇒ String
The credit card token.
-
#customer_identifier ⇒ String
The customer identifier.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(customer_identifier = nil, account_identifier = nil, credit_card_token = nil, amount = nil) ⇒ DepositRequestModel
constructor
A new instance of DepositRequestModel.
Methods inherited from BaseModel
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, account_identifier = nil, credit_card_token = nil, amount = nil) @customer_identifier = customer_identifier @account_identifier = account_identifier @credit_card_token = credit_card_token @amount = amount end |
Instance Attribute Details
#account_identifier ⇒ String
The account identifier
13 14 15 |
# File 'lib/raas/models/deposit_request_model.rb', line 13 def account_identifier @account_identifier end |
#amount ⇒ Float
The amount to fund
21 22 23 |
# File 'lib/raas/models/deposit_request_model.rb', line 21 def amount @amount end |
#credit_card_token ⇒ String
The credit card token
17 18 19 |
# File 'lib/raas/models/deposit_request_model.rb', line 17 def credit_card_token @credit_card_token end |
#customer_identifier ⇒ String
The customer identifier
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'] account_identifier = hash['accountIdentifier'] credit_card_token = hash['creditCardToken'] amount = hash['amount'] # Create object from extracted values. DepositRequestModel.new(customer_identifier, account_identifier, credit_card_token, amount) end |
.names ⇒ Object
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 |