Class: WireClient::Transaction
- Inherits:
-
Object
- Object
- WireClient::Transaction
- Extended by:
- Converter
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/wire_client/transaction/transaction.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_REQUESTED_DATE =
Time.zone.now.to_date.freeze
Instance Attribute Summary collapse
-
#account_number ⇒ Object
Returns the value of attribute account_number.
-
#agent_name ⇒ Object
Returns the value of attribute agent_name.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#batch_booking ⇒ Object
Returns the value of attribute batch_booking.
-
#bic ⇒ Object
Returns the value of attribute bic.
-
#clear_system_code ⇒ Object
Returns the value of attribute clear_system_code.
-
#country ⇒ Object
Returns the value of attribute country.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#iban ⇒ Object
Returns the value of attribute iban.
-
#instruction ⇒ Object
Returns the value of attribute instruction.
-
#name ⇒ Object
Returns the value of attribute name.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#remittance_information ⇒ Object
Returns the value of attribute remittance_information.
-
#requested_date ⇒ Object
Returns the value of attribute requested_date.
-
#service_level ⇒ Object
Returns the value of attribute service_level.
-
#service_priority ⇒ Object
Returns the value of attribute service_priority.
-
#wire_routing_number ⇒ Object
Returns the value of attribute wire_routing_number.
Instance Method Summary collapse
- #error_messages ⇒ Object
-
#initialize(attributes = {}) ⇒ Transaction
constructor
A new instance of Transaction.
- #schema_compatible?(_schema_name) ⇒ Boolean
Methods included from Converter
Constructor Details
#initialize(attributes = {}) ⇒ Transaction
Returns a new instance of Transaction.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/wire_client/transaction/transaction.rb', line 47 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end @currency ||= 'USD' @country ||= 'US' @clear_system_code ||= 'USABA' @agent_name ||= 'NOTPROVIDED' @requested_date ||= DEFAULT_REQUESTED_DATE @reference ||= 'NOTPROVIDED' @batch_booking = true if @batch_booking.nil? @service_priority ||= 'NORM' @service_level ||= 'URGP' end |
Instance Attribute Details
#account_number ⇒ Object
Returns the value of attribute account_number.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def account_number @account_number end |
#agent_name ⇒ Object
Returns the value of attribute agent_name.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def agent_name @agent_name end |
#amount ⇒ Object
Returns the value of attribute amount.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def amount @amount end |
#batch_booking ⇒ Object
Returns the value of attribute batch_booking.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def batch_booking @batch_booking end |
#bic ⇒ Object
Returns the value of attribute bic.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def bic @bic end |
#clear_system_code ⇒ Object
Returns the value of attribute clear_system_code.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def clear_system_code @clear_system_code end |
#country ⇒ Object
Returns the value of attribute country.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def country @country end |
#currency ⇒ Object
Returns the value of attribute currency.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def currency @currency end |
#iban ⇒ Object
Returns the value of attribute iban.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def iban @iban end |
#instruction ⇒ Object
Returns the value of attribute instruction.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def instruction @instruction end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def name @name end |
#reference ⇒ Object
Returns the value of attribute reference.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def reference @reference end |
#remittance_information ⇒ Object
Returns the value of attribute remittance_information.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def remittance_information @remittance_information end |
#requested_date ⇒ Object
Returns the value of attribute requested_date.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def requested_date @requested_date end |
#service_level ⇒ Object
Returns the value of attribute service_level.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def service_level @service_level end |
#service_priority ⇒ Object
Returns the value of attribute service_priority.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def service_priority @service_priority end |
#wire_routing_number ⇒ Object
Returns the value of attribute wire_routing_number.
8 9 10 |
# File 'lib/wire_client/transaction/transaction.rb', line 8 def wire_routing_number @wire_routing_number end |
Instance Method Details
#error_messages ⇒ Object
63 64 65 |
# File 'lib/wire_client/transaction/transaction.rb', line 63 def errors..join("\n") end |
#schema_compatible?(_schema_name) ⇒ Boolean
67 68 69 70 71 |
# File 'lib/wire_client/transaction/transaction.rb', line 67 def schema_compatible?(_schema_name) # By default, transactions are compatible with any `schema_name`. # Could be used to implement schema compatibility check. true end |