Class: SpreeAvataxOfficial::Transactions::CreatePresenter
- Inherits:
-
Object
- Object
- SpreeAvataxOfficial::Transactions::CreatePresenter
- Defined in:
- app/presenters/spree_avatax_official/transactions/create_presenter.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(order:, transaction_type:, transaction_code: order.number) ⇒ CreatePresenter
constructor
A new instance of CreatePresenter.
- #to_json ⇒ Object
Constructor Details
#initialize(order:, transaction_type:, transaction_code: order.number) ⇒ CreatePresenter
Returns a new instance of CreatePresenter.
4 5 6 7 8 |
# File 'app/presenters/spree_avatax_official/transactions/create_presenter.rb', line 4 def initialize(order:, transaction_type:, transaction_code: order.number) @order = order @transaction_type = transaction_type @transaction_code = transaction_code end |
Instance Method Details
#to_json ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/presenters/spree_avatax_official/transactions/create_presenter.rb', line 11 def to_json # rubocop:disable Metrics/MethodLength { type: transaction_type, code: transaction_code, referenceCode: order.number, companyCode: company_code, date: formatted_date(order_date), customerCode: customer_code, lines: items_payload, commit: completed?(order), discount: order.avatax_discount_amount, currencyCode: currency_code, purchaseOrderNo: order.number, entityUseCode: entity_use_code, exemptionNo: exemption_no, businessIdentificationNo: business_identification_no } end |