Class: CyberSourceMergedSpec::PaymentInformation3

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

Overview

PaymentInformation3 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(payment_type: SKIP, merchant_limited_acceptance_indicator: SKIP, additional_properties: nil) ⇒ PaymentInformation3

Returns a new instance of PaymentInformation3.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/cyber_source_merged_spec/models/payment_information3.rb', line 59

def initialize(payment_type: SKIP,
               merchant_limited_acceptance_indicator: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @payment_type = payment_type unless payment_type == SKIP
  unless merchant_limited_acceptance_indicator == SKIP
    @merchant_limited_acceptance_indicator =
      merchant_limited_acceptance_indicator
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#merchant_limited_acceptance_indicatorString

Mastercard One Credential merchant limited acceptance indicator. Mastercard One Credential connects multiple Mastercard payment methods and allows cardhollers to access various options and set payment preferences. This field indicates which Mastercard One Credential funding PAN acceptance brands should NOT be assigned for this transaction. This field flows in ISO field 34, DSID 02 tag DB, mapped to Mastercard Data Element (DE) 48, Sub element 02, Subfield 01. Possible values:

  • C: Do not assign a Mastercard One Credential funding PAN containing the Mastercard Credit Acceptance Brand for this transaction
  • D: Do not assign a Mastercard One Credential funding PAN containing the Debit Mastercard Acceptance Brand for this transaction
  • M: Do not assign a Mastercard One Credential funding PAN containing the Maestro Acceptance Brand for this transaction This field is supported for Authorization reversal request.

Used by

Authorization Reversal Request Optional field.

Returns:

  • (String)


35
36
37
# File 'lib/cyber_source_merged_spec/models/payment_information3.rb', line 35

def merchant_limited_acceptance_indicator
  @merchant_limited_acceptance_indicator
end

#payment_typePaymentType1

TODO: Write general description for this method

Returns:



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

def payment_type
  @payment_type
end

Class Method Details

.from_element(root) ⇒ Object



95
96
97
98
99
100
101
102
103
104
105
# File 'lib/cyber_source_merged_spec/models/payment_information3.rb', line 95

def self.from_element(root)
  payment_type = XmlUtilities.from_element(root, 'PaymentType1',
                                           PaymentType1)
  merchant_limited_acceptance_indicator = XmlUtilities.from_element(
    root, 'merchantLimitedAcceptanceIndicator', String
  )

  new(payment_type: payment_type,
      merchant_limited_acceptance_indicator: merchant_limited_acceptance_indicator,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_type = PaymentType1.from_hash(hash['paymentType']) if hash['paymentType']
  merchant_limited_acceptance_indicator =
    hash.key?('merchantLimitedAcceptanceIndicator') ? hash['merchantLimitedAcceptanceIndicator'] : 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.
  PaymentInformation3.new(payment_type: payment_type,
                          merchant_limited_acceptance_indicator: merchant_limited_acceptance_indicator,
                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
# File 'lib/cyber_source_merged_spec/models/payment_information3.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_type'] = 'paymentType'
  @_hash['merchant_limited_acceptance_indicator'] =
    'merchantLimitedAcceptanceIndicator'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/cyber_source_merged_spec/models/payment_information3.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



47
48
49
50
51
52
# File 'lib/cyber_source_merged_spec/models/payment_information3.rb', line 47

def self.optionals
  %w[
    payment_type
    merchant_limited_acceptance_indicator
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



129
130
131
132
133
134
# File 'lib/cyber_source_merged_spec/models/payment_information3.rb', line 129

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_type: #{@payment_type.inspect},"\
  " merchant_limited_acceptance_indicator: #{@merchant_limited_acceptance_indicator.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



121
122
123
124
125
126
# File 'lib/cyber_source_merged_spec/models/payment_information3.rb', line 121

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_type: #{@payment_type}, merchant_limited_acceptance_indicator:"\
  " #{@merchant_limited_acceptance_indicator}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/cyber_source_merged_spec/models/payment_information3.rb', line 107

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

  XmlUtilities.add_as_subelement(doc, root, 'PaymentType1', payment_type)
  XmlUtilities.add_as_subelement(doc, root,
                                 'merchantLimitedAcceptanceIndicator',
                                 merchant_limited_acceptance_indicator)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end