Class: CyberSourceMergedSpec::InvoiceDetails2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::InvoiceDetails2
- Defined in:
- lib/cyber_source_merged_spec/models/invoice_details2.rb
Overview
InvoiceDetails2 Model.
Instance Attribute Summary collapse
-
#level3_transmission_status ⇒ String
Indicates whether CyberSource sent the Level III information to the processor.
-
#sales_slip_number ⇒ Integer
Transaction identifier that is generated.
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(level3_transmission_status: SKIP, sales_slip_number: SKIP, additional_properties: nil) ⇒ InvoiceDetails2
constructor
A new instance of InvoiceDetails2.
-
#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(level3_transmission_status: SKIP, sales_slip_number: SKIP, additional_properties: nil) ⇒ InvoiceDetails2
Returns a new instance of InvoiceDetails2.
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 64 def initialize(level3_transmission_status: SKIP, sales_slip_number: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? unless level3_transmission_status == SKIP @level3_transmission_status = level3_transmission_status end @sales_slip_number = sales_slip_number unless sales_slip_number == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#level3_transmission_status ⇒ String
Indicates whether CyberSource sent the Level III information to the processor. The possible values are: If your account is not enabled for Level III data or if you did not include the purchasing level field in your request, CyberSource does not include the Level III data in the request sent to the processor. Possible values:
- Y for true
- N for false
22 23 24 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 22 def level3_transmission_status @level3_transmission_status end |
#sales_slip_number ⇒ Integer
Transaction identifier that is generated. You have the option of printing the sales slip number on the receipt. This field is supported only on Cybersource through Visanet and JCN gateway. Optional field.
Card Present processing message
If you included this field in the request, the returned value is the value
that you sent in the request.
If you did not include this field in the request, the system generated
this value for you.
The difference between this reply field and the
processorInformation.systemTraceAuditNumber field is that the
system generates the system trace audit number (STAN), and you must print
the receipt number on the receipt;
whereas you can generate the sales slip number, and you can choose to
print the sales slip number on the receipt.
41 42 43 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 41 def sales_slip_number @sales_slip_number end |
Class Method Details
.from_element(root) ⇒ Object
100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 100 def self.from_element(root) level3_transmission_status = XmlUtilities.from_element( root, 'level3TransmissionStatus', String ) sales_slip_number = XmlUtilities.from_element(root, 'salesSlipNumber', Integer) new(level3_transmission_status: level3_transmission_status, sales_slip_number: sales_slip_number, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. level3_transmission_status = hash.key?('level3TransmissionStatus') ? hash['level3TransmissionStatus'] : SKIP sales_slip_number = hash.key?('salesSlipNumber') ? hash['salesSlipNumber'] : 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. InvoiceDetails2.new(level3_transmission_status: level3_transmission_status, sales_slip_number: sales_slip_number, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
44 45 46 47 48 49 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 44 def self.names @_hash = {} if @_hash.nil? @_hash['level3_transmission_status'] = 'level3TransmissionStatus' @_hash['sales_slip_number'] = 'salesSlipNumber' @_hash end |
.nullables ⇒ Object
An array for nullable fields
60 61 62 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 60 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
52 53 54 55 56 57 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 52 def self.optionals %w[ level3_transmission_status sales_slip_number ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
134 135 136 137 138 139 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 134 def inspect class_name = self.class.name.split('::').last "<#{class_name} level3_transmission_status: #{@level3_transmission_status.inspect},"\ " sales_slip_number: #{@sales_slip_number.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
126 127 128 129 130 131 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 126 def to_s class_name = self.class.name.split('::').last "<#{class_name} level3_transmission_status: #{@level3_transmission_status},"\ " sales_slip_number: #{@sales_slip_number}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/cyber_source_merged_spec/models/invoice_details2.rb', line 112 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'level3TransmissionStatus', level3_transmission_status) XmlUtilities.add_as_subelement(doc, root, 'salesSlipNumber', sales_slip_number) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |