Class: CyberSourceMergedSpec::Mandate1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::Mandate1
- Defined in:
- lib/cyber_source_merged_spec/models/mandate1.rb
Overview
Mandate1 Model.
Instance Attribute Summary collapse
-
#id ⇒ String
The mandate ID.
-
#recurring_type ⇒ String
Whether the direct debit is the first or last direct debit associated with the mandate, or one in between.
-
#reference_number ⇒ String
Unique value generated by CyberSource that identifies the transaction.
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(reference_number: SKIP, recurring_type: SKIP, id: SKIP, additional_properties: nil) ⇒ Mandate1
constructor
A new instance of Mandate1.
-
#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(reference_number: SKIP, recurring_type: SKIP, id: SKIP, additional_properties: nil) ⇒ Mandate1
Returns a new instance of Mandate1.
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 69 def initialize(reference_number: SKIP, recurring_type: SKIP, id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @reference_number = reference_number unless reference_number == SKIP @recurring_type = recurring_type unless recurring_type == SKIP @id = id unless id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#id ⇒ String
The mandate ID. Required only for the United Kingdom.
For details, see the mandate_id request field description in [Ingenico
ePayments Developer Guide For Direct
Debits.](https://apps.cybersource.com/library/documentation/dev_guides/Ing
enico_ePayments_Dev/html/)
44 45 46 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 44 def id @id end |
#recurring_type ⇒ String
Whether the direct debit is the first or last direct debit associated with the mandate, or one in between. Required only for the United Kingdom. Possible values:
001: First direct debit associated with this mandate. Use this value if a one-time direct debit).002: Subsequent direct debits associated with this mandate.003: Last direct debit associated with this mandate. For details, see thedirect_debit_recurring_typerequest field description in [Ingenico ePayments Developer Guide For Direct Debits.](https://apps.cybersource.com/library/documentation/dev_guides/Ing enico_ePayments_Dev/html/)
36 37 38 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 36 def recurring_type @recurring_type end |
#reference_number ⇒ String
Unique value generated by CyberSource that identifies the transaction. Use
this value to identify transactions in the Collections Report, which
provides settlement
information.
For details, see the direct_debit_reconciliation_reference_number reply
field description in [Ingenico ePayments Developer Guide For Direct
Debits.](https://apps.cybersource.com/library/documentation/dev_guides/Ing
enico_ePayments_Dev/html/)
21 22 23 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 21 def reference_number @reference_number end |
Class Method Details
.from_element(root) ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 104 def self.from_element(root) reference_number = XmlUtilities.from_element(root, 'referenceNumber', String) recurring_type = XmlUtilities.from_element(root, 'recurringType', String) id = XmlUtilities.from_element(root, 'id', String) new(reference_number: reference_number, recurring_type: recurring_type, id: id, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reference_number = hash.key?('referenceNumber') ? hash['referenceNumber'] : SKIP recurring_type = hash.key?('recurringType') ? hash['recurringType'] : SKIP id = hash.key?('id') ? hash['id'] : 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. Mandate1.new(reference_number: reference_number, recurring_type: recurring_type, id: id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
47 48 49 50 51 52 53 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 47 def self.names @_hash = {} if @_hash.nil? @_hash['reference_number'] = 'referenceNumber' @_hash['recurring_type'] = 'recurringType' @_hash['id'] = 'id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 59 60 61 62 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 56 def self.optionals %w[ reference_number recurring_type id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
137 138 139 140 141 142 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 137 def inspect class_name = self.class.name.split('::').last "<#{class_name} reference_number: #{@reference_number.inspect}, recurring_type:"\ " #{@recurring_type.inspect}, id: #{@id.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
130 131 132 133 134 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 130 def to_s class_name = self.class.name.split('::').last "<#{class_name} reference_number: #{@reference_number}, recurring_type: #{@recurring_type},"\ " id: #{@id}, additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/cyber_source_merged_spec/models/mandate1.rb', line 116 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'referenceNumber', reference_number) XmlUtilities.add_as_subelement(doc, root, 'recurringType', recurring_type) XmlUtilities.add_as_subelement(doc, root, 'id', id) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |