Class: SpreeCmCommissioner::VotingCredits::DeAllocate
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::VotingCredits::DeAllocate
- Defined in:
- app/services/spree_cm_commissioner/voting_credits/de_allocate.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(order) ⇒ DeAllocate
constructor
A new instance of DeAllocate.
Constructor Details
#initialize(order) ⇒ DeAllocate
Returns a new instance of DeAllocate.
6 7 8 |
# File 'app/services/spree_cm_commissioner/voting_credits/de_allocate.rb', line 6 def initialize(order) @order = order end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
4 5 6 |
# File 'app/services/spree_cm_commissioner/voting_credits/de_allocate.rb', line 4 def order @order end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/services/spree_cm_commissioner/voting_credits/de_allocate.rb', line 10 def call return true if already_canceled? # DeAllocate#call # → purchase_transaction_exists? → false # → raise RuntimeError # → bubbles up to VotingCreditDeAllocationJob # → Sidekiq retries raise "Vote credits not yet allocated for order #{order.number}" unless purchase_transaction_exists? process_refunds end |