Class: Workarea::Payment::Tender::StoreCredit

Inherits:
Workarea::Payment::Tender show all
Defined in:
app/models/workarea/payment/tender/store_credit.rb

Instance Method Summary collapse

Methods inherited from Workarea::Payment::Tender

#authorized_amount, #build_transaction, #capturable?, #capturable_amount, #captured_amount, #has_amount?, #name, #refundable?, #refundable_amount, #refunded_amount, #uncaptured_amount

Methods included from GuardNegativePrice

#guard_negative_price

Methods included from ApplicationDocument

#releasable?

Methods included from Sidekiq::Callbacks

add_worker, assert_valid_config!, async, caching_classes?, disable, enable, inline, #run_callbacks, workers, workers_list

Methods included from Mongoid::Document

#embedded_children

Instance Method Details

#amount=(amount) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'app/models/workarea/payment/tender/store_credit.rb', line 9

def amount=(amount)
  if amount.blank? || profile.blank?
    super
  elsif balance >= amount
    super(amount)
  else
    super(balance)
  end
end

#slugObject



5
6
7
# File 'app/models/workarea/payment/tender/store_credit.rb', line 5

def slug
  :store_credit
end