Class: SpreeAvataxOfficial::Transactions::AdjustService

Inherits:
Base
  • Object
show all
Defined in:
app/services/spree_avatax_official/transactions/adjust_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:, adjustment_reason:, adjustment_description: '', options: {}) ⇒ Object



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

def call(order:, adjustment_reason:, adjustment_description: '', options: {})
  response = send_request(order, adjustment_reason, adjustment_description, options)

  request_result(response, order) do
    if order.avatax_sales_invoice_transaction.nil?
      create_transaction!(
        order: order
      )
    end
  end
end