Sha256: bb0dd782fb06a832209f88556225424fc8eb23c02ed3105c14f3f198252cf97a

Contents?: true

Size: 540 Bytes

Versions: 3

Compression:

Stored size: 540 Bytes

Contents

module SolidusInter
  class PixPaymentSource < Spree::PaymentSource
    def actions
      %w[]
    end

    def can_capture?(payment)
      payment.pending? || payment.checkout?
    end

    def can_void?(payment)
      payment.can_void?
    end

    def can_credit?(payment)
      payment.completed? && payment.credit_allowed > 0
    end

    def usable?
      txid.present? && expiration.future?
    end

    def expired?
      expiration.past?
    end

    def retrieve_from_api
      payment_method.find_payment(txid)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_inter-1.4.4 app/models/solidus_inter/pix_payment_source.rb
solidus_inter-1.4.3 app/models/solidus_inter/pix_payment_source.rb
solidus_inter-1.4.2 app/models/solidus_inter/pix_payment_source.rb