Class: CyberSourceMergedSpec::PayoutInformation

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

Overview

PayoutInformation 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(push_funds: SKIP, pull_funds: SKIP, geo_restriction_indicator: SKIP, additional_properties: nil) ⇒ PayoutInformation

Returns a new instance of PayoutInformation.



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 51

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

  @push_funds = push_funds unless push_funds == SKIP
  @pull_funds = pull_funds unless pull_funds == SKIP
  unless geo_restriction_indicator == SKIP
    @geo_restriction_indicator =
      geo_restriction_indicator
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#geo_restriction_indicatorString

This field indicates if the recipient issuer can accept transactions from the originator country. Possible values:

- `Y`
- `N`

Returns:

  • (String)


26
27
28
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 26

def geo_restriction_indicator
  @geo_restriction_indicator
end

#pull_fundsPullFunds

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 18

def pull_funds
  @pull_funds
end

#push_fundsPushFunds

TODO: Write general description for this method

Returns:



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

def push_funds
  @push_funds
end

Class Method Details

.from_element(root) ⇒ Object



89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 89

def self.from_element(root)
  push_funds = XmlUtilities.from_element(root, 'PushFunds', PushFunds)
  pull_funds = XmlUtilities.from_element(root, 'PullFunds', PullFunds)
  geo_restriction_indicator = XmlUtilities.from_element(
    root, 'geoRestrictionIndicator', String
  )

  new(push_funds: push_funds,
      pull_funds: pull_funds,
      geo_restriction_indicator: geo_restriction_indicator,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 66

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  push_funds = PushFunds.from_hash(hash['pushFunds']) if hash['pushFunds']
  pull_funds = PullFunds.from_hash(hash['pullFunds']) if hash['pullFunds']
  geo_restriction_indicator =
    hash.key?('geoRestrictionIndicator') ? hash['geoRestrictionIndicator'] : 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.
  PayoutInformation.new(push_funds: push_funds,
                        pull_funds: pull_funds,
                        geo_restriction_indicator: geo_restriction_indicator,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['push_funds'] = 'pushFunds'
  @_hash['pull_funds'] = 'pullFunds'
  @_hash['geo_restriction_indicator'] = 'geoRestrictionIndicator'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    push_funds
    pull_funds
    geo_restriction_indicator
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



124
125
126
127
128
129
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 124

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

#to_sObject

Provides a human-readable string representation of the object.



116
117
118
119
120
121
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 116

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

#to_xml_element(doc, root_name) ⇒ Object



102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/cyber_source_merged_spec/models/payout_information.rb', line 102

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

  XmlUtilities.add_as_subelement(doc, root, 'PushFunds', push_funds)
  XmlUtilities.add_as_subelement(doc, root, 'PullFunds', pull_funds)
  XmlUtilities.add_as_subelement(doc, root, 'geoRestrictionIndicator',
                                 geo_restriction_indicator)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end