Class: SpreeAvataxOfficial::Transactions::AdjustPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/spree_avatax_official/transactions/adjust_presenter.rb

Instance Method Summary collapse

Constructor Details

#initialize(order:, adjustment_reason:, adjustment_description:) ⇒ AdjustPresenter

Returns a new instance of AdjustPresenter.



4
5
6
7
8
# File 'app/presenters/spree_avatax_official/transactions/adjust_presenter.rb', line 4

def initialize(order:, adjustment_reason:, adjustment_description:)
  @order                  = order
  @adjustment_reason      = adjustment_reason
  @adjustment_description = adjustment_description
end

Instance Method Details

#to_jsonObject



11
12
13
14
15
16
17
# File 'app/presenters/spree_avatax_official/transactions/adjust_presenter.rb', line 11

def to_json
  {
    adjustmentReason:      adjustment_reason,
    adjustmentDescription: adjustment_description,
    newTransaction:        transaction_payload
  }
end