Class: CyberSourceMergedSpec::PayoutOptions

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

Overview

Payout fields request parameters

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(payout_inquiry: SKIP, network_id: SKIP, acquirer_bin: SKIP, additional_properties: nil) ⇒ PayoutOptions

Returns a new instance of PayoutOptions.



71
72
73
74
75
76
77
78
79
80
# File 'lib/cyber_source_merged_spec/models/payout_options.rb', line 71

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

  @payout_inquiry = payout_inquiry unless payout_inquiry == SKIP
  @network_id = network_id unless network_id == SKIP
  @acquirer_bin = acquirer_bin unless acquirer_bin == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#acquirer_binString

BIN under which the Funds Transfer application is registered. This must match the information provided during enrollment.

Returns:

  • (String)


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

def acquirer_bin
  @acquirer_bin
end

#network_idString

The networks specified in this field must be a subset of the information provided during program enrollment

Possible values:

  • 0020 : Accel/Exchange
  • 0024 : CU24
  • 0003 : Interlink
  • 0016 : Maestro
  • 0018 : NYCE
  • 0027 : NYCE
  • 0009 : Pulse
  • 0017 : Pulse
  • 0019 : Pulse
  • 0008 : Star
  • 0010 : Star
  • 0011 : Star
  • 0012 : Star
  • 0015 : Star
  • 0002 : Visa/PLUS

Returns:

  • (String)


41
42
43
# File 'lib/cyber_source_merged_spec/models/payout_options.rb', line 41

def network_id
  @network_id
end

#payout_inquiryTrueClass | FalseClass

If true then provide attributes related to fund transfer/payouts. If payout information not found then response will have standard account lookup. Possible values:

  • true
  • false

Returns:

  • (TrueClass | FalseClass)


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

def payout_inquiry
  @payout_inquiry
end

Class Method Details

.from_element(root) ⇒ Object



105
106
107
108
109
110
111
112
113
114
115
# File 'lib/cyber_source_merged_spec/models/payout_options.rb', line 105

def self.from_element(root)
  payout_inquiry = XmlUtilities.from_element(root, 'payoutInquiry',
                                             TrueClass)
  network_id = XmlUtilities.from_element(root, 'networkId', String)
  acquirer_bin = XmlUtilities.from_element(root, 'acquirerBin', String)

  new(payout_inquiry: payout_inquiry,
      network_id: network_id,
      acquirer_bin: acquirer_bin,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/cyber_source_merged_spec/models/payout_options.rb', line 83

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payout_inquiry = hash.key?('payoutInquiry') ? hash['payoutInquiry'] : SKIP
  network_id = hash.key?('networkId') ? hash['networkId'] : SKIP
  acquirer_bin = hash.key?('acquirerBin') ? hash['acquirerBin'] : 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.
  PayoutOptions.new(payout_inquiry: payout_inquiry,
                    network_id: network_id,
                    acquirer_bin: acquirer_bin,
                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payout_inquiry'] = 'payoutInquiry'
  @_hash['network_id'] = 'networkId'
  @_hash['acquirer_bin'] = 'acquirerBin'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/cyber_source_merged_spec/models/payout_options.rb', line 67

def self.nullables
  []
end

.optionalsObject

An array for optional fields



58
59
60
61
62
63
64
# File 'lib/cyber_source_merged_spec/models/payout_options.rb', line 58

def self.optionals
  %w[
    payout_inquiry
    network_id
    acquirer_bin
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



137
138
139
140
141
142
# File 'lib/cyber_source_merged_spec/models/payout_options.rb', line 137

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

#to_sObject

Provides a human-readable string representation of the object.



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

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

#to_xml_element(doc, root_name) ⇒ Object



117
118
119
120
121
122
123
124
125
126
127
# File 'lib/cyber_source_merged_spec/models/payout_options.rb', line 117

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

  XmlUtilities.add_as_subelement(doc, root, 'payoutInquiry', payout_inquiry)
  XmlUtilities.add_as_subelement(doc, root, 'networkId', network_id)
  XmlUtilities.add_as_subelement(doc, root, 'acquirerBin', acquirer_bin)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end