Class: SpreeAvataxOfficial::Transactions::FullRefundService

Inherits:
Base
  • Object
show all
Defined in:
app/services/spree_avatax_official/transactions/full_refund_service.rb

Constant Summary

Constants inherited from Base

Base::APP_NAME, Base::APP_VERSION, Base::CONNECTION_OPTIONS, Base::SUCCESS_STATUSES

Instance Method Summary collapse

Instance Method Details

#call(order:, transaction_code:) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'app/services/spree_avatax_official/transactions/full_refund_service.rb', line 4

def call(order:, transaction_code:)
  create_refund(order, transaction_code).tap do |response|
    return request_result(response, order) do
      create_transaction!(
        code:             response.body['code'],
        order:            order,
        transaction_type: SpreeAvataxOfficial::Transaction::RETURN_INVOICE
      )
    end
  end
end