Class: CyberSourceMergedSpec::Account6
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::Account6
- Defined in:
- lib/cyber_source_merged_spec/models/account6.rb
Overview
Account6 Model.
Instance Attribute Summary collapse
-
#funds_source ⇒ String
Source of funds for the sender.
-
#number ⇒ String
Account number of the sender of the funds.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.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(number: SKIP, funds_source: SKIP, additional_properties: nil) ⇒ Account6
constructor
A new instance of Account6.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ 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(number: SKIP, funds_source: SKIP, additional_properties: nil) ⇒ Account6
Returns a new instance of Account6.
58 59 60 61 62 63 64 65 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 58 def initialize(number: SKIP, funds_source: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @number = number unless number == SKIP @funds_source = funds_source unless funds_source == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#funds_source ⇒ String
Source of funds for the sender. For Gaming Payment of Winnings transactions this is the merchant account type.
- Required for Mastercard Payment of Winnings (POW) transactions.
- Valid values:
- 00 - Other
- 01 - RTN + Bank Account
- 02 - IBAN
- 03 - Card Account
- 04 - Email
- 05 - PhoneNumber
- 06 - Bank account number (BAN) + Bank Identification Code (BIC)
- 07 - Wallet ID
- 08 - Social Network ID
35 36 37 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 35 def funds_source @funds_source end |
#number ⇒ String
Account number of the sender of the funds. For Gaming Payment of Winnings transactions this is the merchant account number.
- Required for Mastercard Payment of Winnings (POW) transactions.
- Must contain only ASCII characters in range 32-122.
- Must not be greater than 50 characters.
- Required for POW on Barclays.
19 20 21 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 19 def number @number end |
Class Method Details
.from_element(root) ⇒ Object
88 89 90 91 92 93 94 95 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 88 def self.from_element(root) number = XmlUtilities.from_element(root, 'number', String) funds_source = XmlUtilities.from_element(root, 'fundsSource', String) new(number: number, funds_source: funds_source, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 68 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. number = hash.key?('number') ? hash['number'] : SKIP funds_source = hash.key?('fundsSource') ? hash['fundsSource'] : 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. Account6.new(number: number, funds_source: funds_source, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['number'] = 'number' @_hash['funds_source'] = 'fundsSource' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 46 def self.optionals %w[ number funds_source ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
116 117 118 119 120 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 116 def inspect class_name = self.class.name.split('::').last "<#{class_name} number: #{@number.inspect}, funds_source: #{@funds_source.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
109 110 111 112 113 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 109 def to_s class_name = self.class.name.split('::').last "<#{class_name} number: #{@number}, funds_source: #{@funds_source}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/cyber_source_merged_spec/models/account6.rb', line 97 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'number', number) XmlUtilities.add_as_subelement(doc, root, 'fundsSource', funds_source) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |