Class: WireClient::Transaction
- Inherits:
-
Object
- Object
- WireClient::Transaction
- Extended by:
- Converter
- Includes:
- ActiveModel::Validations, AccountTransactionHelpers
- Defined in:
- lib/wire_client/transaction/transaction.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account_number ⇒ Object
Returns the value of attribute account_number.
-
#address_line ⇒ Object
Returns the value of attribute address_line.
-
#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.
-
#city ⇒ Object
Returns the value of attribute city.
-
#clear_system_code ⇒ Object
Returns the value of attribute clear_system_code.
-
#country ⇒ Object
Returns the value of attribute country.
-
#country_subdivision ⇒ Object
Returns the value of attribute country_subdivision.
-
#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.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#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
Methods included from AccountTransactionHelpers
#country_subdivision_abbr, #country_subdivision_name
Constructor Details
#initialize(attributes = {}) ⇒ Transaction
Returns a new instance of Transaction.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/wire_client/transaction/transaction.rb', line 53 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end @currency ||= 'USD' @postal_code ||= 'NA' @address_line ||= 'NA' @city ||= 'NA' @country ||= 'US' @country_subdivision ||= 'MA' if self.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.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def account_number @account_number end |
#address_line ⇒ Object
Returns the value of attribute address_line.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def address_line @address_line end |
#agent_name ⇒ Object
Returns the value of attribute agent_name.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def agent_name @agent_name end |
#amount ⇒ Object
Returns the value of attribute amount.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def amount @amount end |
#batch_booking ⇒ Object
Returns the value of attribute batch_booking.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def batch_booking @batch_booking end |
#bic ⇒ Object
Returns the value of attribute bic.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def bic @bic end |
#city ⇒ Object
Returns the value of attribute city.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def city @city end |
#clear_system_code ⇒ Object
Returns the value of attribute clear_system_code.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def clear_system_code @clear_system_code end |
#country ⇒ Object
Returns the value of attribute country.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def country @country end |
#country_subdivision ⇒ Object
Returns the value of attribute country_subdivision.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def country_subdivision @country_subdivision end |
#currency ⇒ Object
Returns the value of attribute currency.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def currency @currency end |
#iban ⇒ Object
Returns the value of attribute iban.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def iban @iban end |
#instruction ⇒ Object
Returns the value of attribute instruction.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def instruction @instruction end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def name @name end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def postal_code @postal_code end |
#reference ⇒ Object
Returns the value of attribute reference.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def reference @reference end |
#remittance_information ⇒ Object
Returns the value of attribute remittance_information.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def remittance_information @remittance_information end |
#requested_date ⇒ Object
Returns the value of attribute requested_date.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def requested_date @requested_date end |
#service_level ⇒ Object
Returns the value of attribute service_level.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def service_level @service_level end |
#service_priority ⇒ Object
Returns the value of attribute service_priority.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def service_priority @service_priority end |
#wire_routing_number ⇒ Object
Returns the value of attribute wire_routing_number.
7 8 9 |
# File 'lib/wire_client/transaction/transaction.rb', line 7 def wire_routing_number @wire_routing_number end |
Instance Method Details
#error_messages ⇒ Object
73 74 75 |
# File 'lib/wire_client/transaction/transaction.rb', line 73 def errors..join("\n") end |
#schema_compatible?(_schema_name) ⇒ Boolean
77 78 79 80 81 |
# File 'lib/wire_client/transaction/transaction.rb', line 77 def schema_compatible?(_schema_name) # By default, transactions are compatible with any `schema_name`. # Could be used to implement schema compatibility check. true end |