Sha256: 3ee3de480f5326985dfba6ee51224882ff76b7e95c0bd0c311d7513754a7d177

Contents?: true

Size: 595 Bytes

Versions: 26

Compression:

Stored size: 595 Bytes

Contents

module Spree
  module Api
    module Webhooks
      module PaymentDecorator
        def self.prepended(base)
          def base.custom_webhook_events
            %w[payment.paid payment.voided]
          end
        end

        def after_void
          super
          queue_webhooks_requests!('payment.voided')
        end

        def after_completed
          super
          queue_webhooks_requests!('payment.paid')
          order.queue_webhooks_requests!('order.paid') if order.paid?
        end
      end
    end
  end
end

Spree::Payment.prepend(Spree::Api::Webhooks::PaymentDecorator)

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
spree_api-4.8.3 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.8.2 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.7.3 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.6.6 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.5.5 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.4.1 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.5.4 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.6.5 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.7.2 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.7.1 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.6.4 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.7.0 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.6.3 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.6.2 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.6.1 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.6.0 app/models/spree/api/webhooks/payment_decorator.rb
spree_api-4.5.3 app/models/spree/api/webhooks/payment_decorator.rb
atkhayar-dev-spree-api-0.0.1 app/models/spree/api/webhooks/payment_decorator.rb
atkhayar-dev-spree-api-0.0.0 app/models/spree/api/webhooks/payment_decorator.rb
atkhayar-spree-dev-api-0.0.0 app/models/spree/api/webhooks/payment_decorator.rb