Class: FdxV660Api::PaymentMethodEntity

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/payment_method_entity.rb

Overview

A method of payment, also known as a payment type or payment rail

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_method_id: SKIP, external_local_instrument1_code: SKIP, external_clearing_system_identification1_code: SKIP, external_clearing_system_identification1_proprietary: SKIP, additional_properties: nil) ⇒ PaymentMethodEntity

Returns a new instance of PaymentMethodEntity.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 63

def initialize(payment_method_id: SKIP,
               external_local_instrument1_code: SKIP,
               external_clearing_system_identification1_code: SKIP,
               external_clearing_system_identification1_proprietary: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @payment_method_id = payment_method_id unless payment_method_id == SKIP
  unless external_local_instrument1_code == SKIP
    @external_local_instrument1_code =
      external_local_instrument1_code
  end
  unless external_clearing_system_identification1_code == SKIP
    @external_clearing_system_identification1_code =
      external_clearing_system_identification1_code
  end
  unless external_clearing_system_identification1_proprietary == SKIP
    @external_clearing_system_identification1_proprietary =
      external_clearing_system_identification1_proprietary
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#external_clearing_system_identification1_codeString

Unique identifier code of the external clearing system. This is aligned with ISO 20022 pacs.008 group level. It can be used to send the payment rail for the payment. ISO has already listed codes in the fields which indicates the payment rail like "ACH" for ACH, "ACS" for EFT Payments, "LVT" for Canada LVTS, "LYX" for Lynx Canada, etc.

Returns:

  • (String)


29
30
31
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 29

def external_clearing_system_identification1_code
  @external_clearing_system_identification1_code
end

#external_clearing_system_identification1_proprietaryString

For few examples where the payment rail is not part of the ISO 20022 scope

Returns:

  • (String)


33
34
35
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 33

def external_clearing_system_identification1_proprietary
  @external_clearing_system_identification1_proprietary
end

#external_local_instrument1_codeString

Unique identifier code of the payment method rail as documented internally to the FI. This is aligned with ISO 20022 pain.001, transaction level

Returns:

  • (String)


20
21
22
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 20

def external_local_instrument1_code
  @external_local_instrument1_code
end

#payment_method_idString

Unique identifier of the payment method

Returns:

  • (String)


14
15
16
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 14

def payment_method_id
  @payment_method_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 88

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_method_id =
    hash.key?('paymentMethodId') ? hash['paymentMethodId'] : SKIP
  external_local_instrument1_code =
    hash.key?('externalLocalInstrument1Code') ? hash['externalLocalInstrument1Code'] : SKIP
  external_clearing_system_identification1_code =
    hash.key?('externalClearingSystemIdentification1Code') ? hash['externalClearingSystemIdentification1Code'] : SKIP
  external_clearing_system_identification1_proprietary =
    hash.key?('externalClearingSystemIdentification1Proprietary') ? hash['externalClearingSystemIdentification1Proprietary'] : 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.
  PaymentMethodEntity.new(payment_method_id: payment_method_id,
                          external_local_instrument1_code: external_local_instrument1_code,
                          external_clearing_system_identification1_code: external_clearing_system_identification1_code,
                          external_clearing_system_identification1_proprietary: external_clearing_system_identification1_proprietary,
                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 36

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_method_id'] = 'paymentMethodId'
  @_hash['external_local_instrument1_code'] =
    'externalLocalInstrument1Code'
  @_hash['external_clearing_system_identification1_code'] =
    'externalClearingSystemIdentification1Code'
  @_hash['external_clearing_system_identification1_proprietary'] =
    'externalClearingSystemIdentification1Proprietary'
  @_hash
end

.nullablesObject

An array for nullable fields



59
60
61
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 59

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 49

def self.optionals
  %w[
    payment_method_id
    external_local_instrument1_code
    external_clearing_system_identification1_code
    external_clearing_system_identification1_proprietary
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



128
129
130
131
132
133
134
135
136
137
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 128

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

#to_sObject

Provides a human-readable string representation of the object.



117
118
119
120
121
122
123
124
125
# File 'lib/fdx_v660_api/models/payment_method_entity.rb', line 117

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