Class: Spree::Admin::TaxjarTransactionsController

Inherits:
BaseController
  • Object
show all
Includes:
SuperGood::SolidusTaxjar::Reportable
Defined in:
app/controllers/spree/admin/taxjar_transactions_controller.rb

Constant Summary

Constants included from SuperGood::SolidusTaxjar::Reportable

SuperGood::SolidusTaxjar::Reportable::ORDER_TOO_OLD_MESSAGE

Instance Method Summary collapse

Methods included from SuperGood::SolidusTaxjar::Reportable

included, #order_reportable?, #transaction_replaceable?, #with_replaceable, #with_reportable

Instance Method Details

#retryObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/spree/admin/taxjar_transactions_controller.rb', line 6

def retry
  order = Spree::Order.find_by number: params[:order_id]

  if transaction_replaceable? order
    replace_transaction order
    flash[:notice] = "Queued transaction sync job"
  elsif order_reportable? order
    report_transaction order
    flash[:notice] = "Queued transaction sync job"
  else
    flash[:error] = "Could not retry sync successfully"
  end

  redirect_to taxjar_transactions_admin_order_path(params[:order_id])
end