Class: CyberSourceMergedSpec::TokenizedInformation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::TokenizedInformation
- Defined in:
- lib/cyber_source_merged_spec/models/tokenized_information.rb
Overview
TokenizedInformation Model.
Instance Attribute Summary collapse
-
#requestor_id ⇒ String
Value that identifies your business and indicates that the cardholder’s account number is tokenized.
-
#transaction_type ⇒ String
Type of transaction that provided the token data.
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(requestor_id: SKIP, transaction_type: SKIP, additional_properties: nil) ⇒ TokenizedInformation
constructor
A new instance of TokenizedInformation.
-
#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(requestor_id: SKIP, transaction_type: SKIP, additional_properties: nil) ⇒ TokenizedInformation
Returns a new instance of TokenizedInformation.
50 51 52 53 54 55 56 57 58 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 50 def initialize(requestor_id: SKIP, transaction_type: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @requestor_id = requestor_id unless requestor_id == SKIP @transaction_type = transaction_type unless transaction_type == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#requestor_id ⇒ String
Value that identifies your business and indicates that the cardholder’s account number is tokenized. This value is assigned by the token service provider and is unique within the token service provider’s database. Note This field is supported only through VisaNet and FDC Nashville Global.
19 20 21 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 19 def requestor_id @requestor_id end |
#transaction_type ⇒ String
Type of transaction that provided the token data. This value does not specify the token service provider; it specifies the entity that provided you with information about the token. Set the value for this field to 1. An application on the customer’s mobile device provided the token data.
27 28 29 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 27 def transaction_type @transaction_type end |
Class Method Details
.from_element(root) ⇒ Object
82 83 84 85 86 87 88 89 90 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 82 def self.from_element(root) requestor_id = XmlUtilities.from_element(root, 'requestorID', String) transaction_type = XmlUtilities.from_element(root, 'transactionType', String) new(requestor_id: requestor_id, transaction_type: transaction_type, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. requestor_id = hash.key?('requestorID') ? hash['requestorID'] : SKIP transaction_type = hash.key?('transactionType') ? hash['transactionType'] : 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. TokenizedInformation.new(requestor_id: requestor_id, transaction_type: transaction_type, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['requestor_id'] = 'requestorID' @_hash['transaction_type'] = 'transactionType' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 46 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
38 39 40 41 42 43 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 38 def self.optionals %w[ requestor_id transaction_type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
112 113 114 115 116 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 112 def inspect class_name = self.class.name.split('::').last "<#{class_name} requestor_id: #{@requestor_id.inspect}, transaction_type:"\ " #{@transaction_type.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
105 106 107 108 109 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 105 def to_s class_name = self.class.name.split('::').last "<#{class_name} requestor_id: #{@requestor_id}, transaction_type: #{@transaction_type},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/cyber_source_merged_spec/models/tokenized_information.rb', line 92 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'requestorID', requestor_id) XmlUtilities.add_as_subelement(doc, root, 'transactionType', transaction_type) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |