Class: Spree::OrderCommissionSubscriber
- Inherits:
-
Subscriber
- Object
- Subscriber
- Spree::OrderCommissionSubscriber
- Defined in:
- app/subscribers/spree/order_commission_subscriber.rb
Overview
Charges commission once an order is placed.
Synchronous, like the other placement side effects, because the commission lines are what a seller is told they owe: a marketplace that showed an order before its commission existed would be showing an incomplete book, and the work is a handful of rows against already-loaded records.
Idempotency is the service's own — an order that already carries commission is left alone — so a replayed event cannot charge a seller twice.