Class: FdxV660Api::Remittance
- Defined in:
- lib/fdx_v660_api/models/remittance.rb
Overview
Remittance details for a transaction
Instance Attribute Summary collapse
-
#creditor ⇒ RemittanceParty1
Identification of the creditor party to the transaction for the funds received, can include
accountNumberwhich is sensitive data and should be encrypted. -
#debtor ⇒ RemittanceParty3
Identification of the debtor party to the transaction for the funds source, can include
accountNumberwhich is sensitive data and should be encrypted. -
#exchange_rate ⇒ Float
Exchange rate used to convert the instructed amount, if the source currency is different from the received currency.
-
#fi_attributes ⇒ Array[FiAttributeEntity]
Array of additional remittance attributes.
-
#payment_id ⇒ String
An ID for the payment from the external payment rail.
-
#payment_status ⇒ RemittanceStatus2
Status of the transaction from the payment rail, including one of
IN_PROGRESS,FAILED,CANCELLED,REJECTEDorCOMPLETED. -
#source_currency ⇒ Iso4217CurrencyCode2
The ISO 4217 code of the currency of the source account.
-
#type ⇒ PaymentNetworkType1
The payment rail of the transaction, such as
SWIFT_WIRE. -
#value_date ⇒ Date
Date that the payment is executed.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(payment_id: SKIP, type: SKIP, value_date: SKIP, payment_status: SKIP, exchange_rate: SKIP, source_currency: SKIP, debtor: SKIP, creditor: SKIP, fi_attributes: SKIP, additional_properties: nil) ⇒ Remittance
constructor
A new instance of Remittance.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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_id: SKIP, type: SKIP, value_date: SKIP, payment_status: SKIP, exchange_rate: SKIP, source_currency: SKIP, debtor: SKIP, creditor: SKIP, fi_attributes: SKIP, additional_properties: nil) ⇒ Remittance
Returns a new instance of Remittance.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 92 def initialize(payment_id: SKIP, type: SKIP, value_date: SKIP, payment_status: SKIP, exchange_rate: SKIP, source_currency: SKIP, debtor: SKIP, creditor: SKIP, fi_attributes: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @payment_id = payment_id unless payment_id == SKIP @type = type unless type == SKIP @value_date = value_date unless value_date == SKIP @payment_status = payment_status unless payment_status == SKIP @exchange_rate = exchange_rate unless exchange_rate == SKIP @source_currency = source_currency unless source_currency == SKIP @debtor = debtor unless debtor == SKIP @creditor = creditor unless creditor == SKIP @fi_attributes = fi_attributes unless fi_attributes == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#creditor ⇒ RemittanceParty1
Identification of the creditor party to the transaction for the funds
received, can include accountNumber which is sensitive data and should
be encrypted
49 50 51 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 49 def creditor @creditor end |
#debtor ⇒ RemittanceParty3
Identification of the debtor party to the transaction for the funds
source, can include accountNumber which is sensitive data and should be
encrypted
43 44 45 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 43 def debtor @debtor end |
#exchange_rate ⇒ Float
Exchange rate used to convert the instructed amount, if the source currency is different from the received currency
33 34 35 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 33 def exchange_rate @exchange_rate end |
#fi_attributes ⇒ Array[FiAttributeEntity]
Array of additional remittance attributes. This can include SWIFT tags such as '20', '70', '71A', '72' and etc, or similar custom fields from other rails
55 56 57 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 55 def fi_attributes @fi_attributes end |
#payment_id ⇒ String
An ID for the payment from the external payment rail. For SWIFT wires this will be Unique End-to-End Transaction Reference (UETR)
15 16 17 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 15 def payment_id @payment_id end |
#payment_status ⇒ RemittanceStatus2
Status of the transaction from the payment rail, including one of
IN_PROGRESS, FAILED, CANCELLED, REJECTED or COMPLETED
28 29 30 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 28 def payment_status @payment_status end |
#source_currency ⇒ Iso4217CurrencyCode2
The ISO 4217 code of the currency of the source account
37 38 39 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 37 def source_currency @source_currency end |
#type ⇒ PaymentNetworkType1
The payment rail of the transaction, such as SWIFT_WIRE
19 20 21 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 19 def type @type end |
#value_date ⇒ Date
Date that the payment is executed
23 24 25 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 23 def value_date @value_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 112 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. payment_id = hash.key?('paymentId') ? hash['paymentId'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP value_date = hash.key?('valueDate') ? hash['valueDate'] : SKIP payment_status = hash.key?('paymentStatus') ? hash['paymentStatus'] : SKIP exchange_rate = hash.key?('exchangeRate') ? hash['exchangeRate'] : SKIP source_currency = hash.key?('sourceCurrency') ? hash['sourceCurrency'] : SKIP debtor = RemittanceParty3.from_hash(hash['debtor']) if hash['debtor'] creditor = RemittanceParty1.from_hash(hash['creditor']) if hash['creditor'] # Parameter is an array, so we need to iterate through it fi_attributes = nil unless hash['fiAttributes'].nil? fi_attributes = [] hash['fiAttributes'].each do |structure| fi_attributes << (FiAttributeEntity.from_hash(structure) if structure) end end fi_attributes = SKIP unless hash.key?('fiAttributes') # 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. Remittance.new(payment_id: payment_id, type: type, value_date: value_date, payment_status: payment_status, exchange_rate: exchange_rate, source_currency: source_currency, debtor: debtor, creditor: creditor, fi_attributes: fi_attributes, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 58 def self.names @_hash = {} if @_hash.nil? @_hash['payment_id'] = 'paymentId' @_hash['type'] = 'type' @_hash['value_date'] = 'valueDate' @_hash['payment_status'] = 'paymentStatus' @_hash['exchange_rate'] = 'exchangeRate' @_hash['source_currency'] = 'sourceCurrency' @_hash['debtor'] = 'debtor' @_hash['creditor'] = 'creditor' @_hash['fi_attributes'] = 'fiAttributes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
88 89 90 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 88 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 73 def self.optionals %w[ payment_id type value_date payment_status exchange_rate source_currency debtor creditor fi_attributes ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
166 167 168 169 170 171 172 173 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 166 def inspect class_name = self.class.name.split('::').last "<#{class_name} payment_id: #{@payment_id.inspect}, type: #{@type.inspect}, value_date:"\ " #{@value_date.inspect}, payment_status: #{@payment_status.inspect}, exchange_rate:"\ " #{@exchange_rate.inspect}, source_currency: #{@source_currency.inspect}, debtor:"\ " #{@debtor.inspect}, creditor: #{@creditor.inspect}, fi_attributes:"\ " #{@fi_attributes.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
157 158 159 160 161 162 163 |
# File 'lib/fdx_v660_api/models/remittance.rb', line 157 def to_s class_name = self.class.name.split('::').last "<#{class_name} payment_id: #{@payment_id}, type: #{@type}, value_date: #{@value_date},"\ " payment_status: #{@payment_status}, exchange_rate: #{@exchange_rate}, source_currency:"\ " #{@source_currency}, debtor: #{@debtor}, creditor: #{@creditor}, fi_attributes:"\ " #{@fi_attributes}, additional_properties: #{@additional_properties}>" end |