Sha256: 76dbb1938928e61c49b1bf3decdd02c77de7acd69abd4944fa72a9f9924b8e1d

Contents?: true

Size: 1.46 KB

Versions: 11

Compression:

Stored size: 1.46 KB

Contents

# typed: true
# frozen_string_literal: true

module EML
  module UK
    module Models
      module TNS
        class Transaction < ::EML::Model
          extend T::Sig

          fields(
            "AuthorizationRequestId" => :authorizationRequestId,
            "Card" => :card,
            "Cards" => :cards,
            "EmlId" => :emlId,
            "MerchantCategoryCode" => :merchantCategoryCode,
            "MerchantCountry" => :merchantCountry,
            "Note" => :note,
            "OriginalTransactionDate" => :originalDate,
            "PosTransactionTime" => :posTime,
            "Reason" => :reason,
            "Result" => :result,
            "RetrievalReferenceNumber" => :retrievalReferenceNumber,
            "TransactionAmount" => :amount,
            "TransactionCurrency" => :currency,
            "TransactionDescription" => :description,
            "TransactionId" => :transactionId,
            "TransactionLocation" => :location,
            "TransactionTime" => :time
          )

          sig { params(raw_values: T::Hash[String, T.untyped]).void }
          def initialize(raw_values)
            super
            initialize_cards
          end

          private

          sig { void }
          def initialize_cards
            @card = Card.new(@card) unless @card.nil?
            @cards = (@cards || []).each_with_object([]) do |card, cards|
              cards << Card.new(card)
            end
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
eml-3.0.0 lib/eml/uk/models/tns/transaction.rb
eml-2.2.0 lib/eml/uk/models/tns/transaction.rb
eml-2.1.8 lib/eml/uk/models/tns/transaction.rb
eml-2.1.7 lib/eml/uk/models/tns/transaction.rb
eml-2.1.6 lib/eml/uk/models/tns/transaction.rb
eml-2.1.5 lib/eml/uk/models/tns/transaction.rb
eml-2.1.4 lib/eml/uk/models/tns/transaction.rb
eml-2.1.3 lib/eml/uk/models/tns/transaction.rb
eml-2.1.2 lib/eml/uk/models/tns/transaction.rb
eml-2.1.1 lib/eml/uk/models/tns/transaction.rb
eml-2.1.0 lib/eml/uk/models/tns/transaction.rb