Sha256: 95a6baecc045b5a9ab0a7e7d55bba5614fd2c9c0df1d18162a379d0b06572fe2

Contents?: true

Size: 558 Bytes

Versions: 3

Compression:

Stored size: 558 Bytes

Contents

module Workarea
  decorate Checkout, with: :forter do

    # Forter has a post auth model of fraud analysis
    # This decorator removes the check for fraud.
    def place_order
      return false unless complete?
      return false unless shippable?
      return false unless payable?

      inventory.purchase
      return false unless inventory.captured?

      unless payment_collection.purchase
        inventory.rollback
        return false
      end

      result = order.place
      place_order_side_effects if result
      result
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-forter-1.3.2 app/models/workarea/checkout.decorator
workarea-forter-1.3.1 app/models/workarea/checkout.decorator
workarea-forter-1.3.0 app/models/workarea/checkout.decorator