Class: CyberSourceMergedSpec::ProcessorInformation35

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/processor_information35.rb

Overview

ProcessorInformation35 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(processor: SKIP, provider_transaction_id: SKIP, approval_code: SKIP, event_status: SKIP, retrieval_reference_number: SKIP, additional_properties: nil) ⇒ ProcessorInformation35

Returns a new instance of ProcessorInformation35.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 75

def initialize(processor: SKIP, provider_transaction_id: SKIP,
               approval_code: SKIP, event_status: SKIP,
               retrieval_reference_number: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @processor = processor unless processor == SKIP
  @provider_transaction_id = provider_transaction_id unless provider_transaction_id == SKIP
  @approval_code = approval_code unless approval_code == SKIP
  @event_status = event_status unless event_status == SKIP
  unless retrieval_reference_number == SKIP
    @retrieval_reference_number =
      retrieval_reference_number
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#approval_codeString

Authorization code. Returned only when the processor returns this value. The length of this value depends on your processor. Returned by authorization service.

PIN debit

Authorization code that is returned by the processor. Returned by PIN debit credit.

Elavon Encrypted Account Number Program

The returned value is OFFLINE.

TSYS Acquiring Solutions

The returned value for a successful zero amount authorization is 000000.

Returns:

  • (String)


32
33
34
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 32

def approval_code
  @approval_code
end

#event_statusString

The event status.

Returns:

  • (String)


36
37
38
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 36

def event_status
  @event_status
end

#processorProcessor

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 14

def processor
  @processor
end

#provider_transaction_idString

Unique ID [codigo] generated by the processor for real-time payments processed directly by the Iugu processor.

Returns:

  • (String)


19
20
21
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 19

def provider_transaction_id
  @provider_transaction_id
end

#retrieval_reference_numberString

Ingenico ePayments

Unique number that CyberSource generates to identify the transaction. You can use this value to identify transactions in the Ingenico ePayments Collections Report, which provides settlement information. Contact customer support for information about the report.

CyberSource through VisaNet

Retrieval request number.

Returns:

  • (String)


46
47
48
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 46

def retrieval_reference_number
  @retrieval_reference_number
end

Class Method Details

.from_element(root) ⇒ Object



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 121

def self.from_element(root)
  processor = XmlUtilities.from_element(root, 'Processor', Processor)
  provider_transaction_id = XmlUtilities.from_element(
    root, 'providerTransactionId', String
  )
  approval_code = XmlUtilities.from_element(root, 'approvalCode', String)
  event_status = XmlUtilities.from_element(root, 'eventStatus', String)
  retrieval_reference_number = XmlUtilities.from_element(
    root, 'retrievalReferenceNumber', String
  )

  new(processor: processor,
      provider_transaction_id: provider_transaction_id,
      approval_code: approval_code,
      event_status: event_status,
      retrieval_reference_number: retrieval_reference_number,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 93

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  processor = Processor.from_hash(hash['processor']) if hash['processor']
  provider_transaction_id =
    hash.key?('providerTransactionId') ? hash['providerTransactionId'] : SKIP
  approval_code = hash.key?('approvalCode') ? hash['approvalCode'] : SKIP
  event_status = hash.key?('eventStatus') ? hash['eventStatus'] : SKIP
  retrieval_reference_number =
    hash.key?('retrievalReferenceNumber') ? hash['retrievalReferenceNumber'] : 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.
  ProcessorInformation35.new(processor: processor,
                             provider_transaction_id: provider_transaction_id,
                             approval_code: approval_code,
                             event_status: event_status,
                             retrieval_reference_number: retrieval_reference_number,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



49
50
51
52
53
54
55
56
57
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 49

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['processor'] = 'processor'
  @_hash['provider_transaction_id'] = 'providerTransactionId'
  @_hash['approval_code'] = 'approvalCode'
  @_hash['event_status'] = 'eventStatus'
  @_hash['retrieval_reference_number'] = 'retrievalReferenceNumber'
  @_hash
end

.nullablesObject

An array for nullable fields



71
72
73
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 71

def self.nullables
  []
end

.optionalsObject

An array for optional fields



60
61
62
63
64
65
66
67
68
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 60

def self.optionals
  %w[
    processor
    provider_transaction_id
    approval_code
    event_status
    retrieval_reference_number
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



166
167
168
169
170
171
172
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 166

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} processor: #{@processor.inspect}, provider_transaction_id:"\
  " #{@provider_transaction_id.inspect}, approval_code: #{@approval_code.inspect},"\
  " event_status: #{@event_status.inspect}, retrieval_reference_number:"\
  " #{@retrieval_reference_number.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



157
158
159
160
161
162
163
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 157

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} processor: #{@processor}, provider_transaction_id:"\
  " #{@provider_transaction_id}, approval_code: #{@approval_code}, event_status:"\
  " #{@event_status}, retrieval_reference_number: #{@retrieval_reference_number},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/cyber_source_merged_spec/models/processor_information35.rb', line 140

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'Processor', processor)
  XmlUtilities.add_as_subelement(doc, root, 'providerTransactionId',
                                 provider_transaction_id)
  XmlUtilities.add_as_subelement(doc, root, 'approvalCode', approval_code)
  XmlUtilities.add_as_subelement(doc, root, 'eventStatus', event_status)
  XmlUtilities.add_as_subelement(doc, root, 'retrievalReferenceNumber',
                                 retrieval_reference_number)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end