Sha256: 5cc2fdae2a0f1560ae93ecea106aebd2510c648c4ca564d32b77b5f153ce2b57

Contents?: true

Size: 793 Bytes

Versions: 10

Compression:

Stored size: 793 Bytes

Contents

# frozen_string_literal: true

module SolidusBolt
  module Transactions
    class DetailService < SolidusBolt::Transactions::BaseService
      attr_reader :transaction_reference

      def initialize(transaction_reference:, payment_method:)
        @transaction_reference = transaction_reference
        super
      end

      def call
        detail
      end

      private

      def detail
        options = build_options
        handle_result(
          HTTParty.get(
            "#{api_base_url}/#{api_version}/merchant/transactions/#{transaction_reference}",
            options
          )
        )
      end

      def build_options
        {
          headers: {
            'X-Nonce' => generate_nonce
          }.merge(authentication_header)
        }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_bolt-0.7.2 app/services/solidus_bolt/transactions/detail_service.rb
solidus_bolt-0.7.1 app/services/solidus_bolt/transactions/detail_service.rb
solidus_bolt-0.7.0 app/services/solidus_bolt/transactions/detail_service.rb
solidus_bolt-0.6.0 app/services/solidus_bolt/transactions/detail_service.rb
solidus_bolt-0.5.0 app/services/solidus_bolt/transactions/detail_service.rb
solidus_bolt-0.4.0 app/services/solidus_bolt/transactions/detail_service.rb
solidus_bolt-0.3.0 app/services/solidus_bolt/transactions/detail_service.rb
solidus_bolt-0.2.0 app/services/solidus_bolt/transactions/detail_service.rb
solidus_bolt-0.1.0 app/services/solidus_bolt/transactions/detail_service.rb
solidus_bolt-0.0.1 app/services/solidus_bolt/transactions/detail_service.rb