Class: VisaAcceptanceMergedSpec::Balance
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::Balance
- Defined in:
- lib/visa_acceptance_merged_spec/models/balance.rb
Overview
Balance Model.
Instance Attribute Summary collapse
-
#account_type ⇒ String
Type of account.
-
#amount ⇒ String
Remaining balance on the account.
-
#amount_type ⇒ String
Type of amount.
-
#currency ⇒ String
Currency of the remaining balance on the account.
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(account_type: SKIP, amount: SKIP, amount_type: SKIP, currency: SKIP, additional_properties: nil) ⇒ Balance
constructor
A new instance of Balance.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(account_type: SKIP, amount: SKIP, amount_type: SKIP, currency: SKIP, additional_properties: nil) ⇒ Balance
Returns a new instance of Balance.
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 76 def initialize(account_type: SKIP, amount: SKIP, amount_type: SKIP, currency: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_type = account_type unless account_type == SKIP @amount = amount unless amount == SKIP @amount_type = amount_type unless amount_type == SKIP @currency = currency unless currency == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_type ⇒ String
Type of account. This value is returned only if you request a balance inquiry. Possible values:
00: Not applicable or not specified10: Savings account20: Checking account30: Credit card account40: Universal account Balance Account Types returned on EBT Debit card transactions:96: Cash Benefits Account (PIN Debit Gateway EBT only)98: Food Stamp Account (PIN Debit Gateway EBT only)
24 25 26 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 24 def account_type @account_type end |
#amount ⇒ String
Remaining balance on the account. If the processor returns the sign, positive or negative, this sign is prefixed to the amount value as (+/-).
30 31 32 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 30 def amount @amount end |
#amount_type ⇒ String
Type of amount. This value is returned only if you request a balance inquiry. The issuer determines the value that is returned. Possible values for deposit accounts:
01: Current ledger (posted) balance.02: Current available balance, which is typically the ledger balance minus outstanding authorizations. Some depository institutions also include pending deposits and the credit or overdraft line associated with the account. Possible values for credit card accounts:01: Credit amount remaining for customer (open to buy).02: Credit limit.
45 46 47 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 45 def amount_type @amount_type end |
#currency ⇒ String
Currency of the remaining balance on the account.
49 50 51 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 49 def currency @currency end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 89 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_type = hash.key?('accountType') ? hash['accountType'] : SKIP amount = hash.key?('amount') ? hash['amount'] : SKIP amount_type = hash.key?('amountType') ? hash['amountType'] : SKIP currency = hash.key?('currency') ? hash['currency'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. Balance.new(account_type: account_type, amount: amount, amount_type: amount_type, currency: currency, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
52 53 54 55 56 57 58 59 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 52 def self.names @_hash = {} if @_hash.nil? @_hash['account_type'] = 'accountType' @_hash['amount'] = 'amount' @_hash['amount_type'] = 'amountType' @_hash['currency'] = 'currency' @_hash end |
.nullables ⇒ Object
An array for nullable fields
72 73 74 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 72 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
62 63 64 65 66 67 68 69 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 62 def self.optionals %w[ account_type amount amount_type currency ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
122 123 124 125 126 127 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_type: #{@account_type.inspect}, amount: #{@amount.inspect},"\ " amount_type: #{@amount_type.inspect}, currency: #{@currency.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 119 |
# File 'lib/visa_acceptance_merged_spec/models/balance.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_type: #{@account_type}, amount: #{@amount}, amount_type:"\ " #{@amount_type}, currency: #{@currency}, additional_properties:"\ " #{@additional_properties}>" end |