Class: SpreeAvataxOfficial::Transactions::AmountRefundService

Inherits:
Base
  • Object
show all
Defined in:
app/services/spree_avatax_official/transactions/amount_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:, amount:) ⇒ Object



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

def call(order:, transaction_code:, amount:)
  response = send_request(order, transaction_code, amount)

  request_result(response, order) do
    create_transaction!(
      code:             response.body['code'],
      order:            order,
      transaction_type: SpreeAvataxOfficial::Transaction::RETURN_INVOICE
    )
  end
end