Sha256: 6f4e24f724880ea74fa4861662cc383f3e0c536f1f51129215e10deb15fb103c
Contents?: true
Size: 625 Bytes
Versions: 7
Compression:
Stored size: 625 Bytes
Contents
# frozen_string_literal: true require 'stripe' module SolidusStripe class PaymentSource < ::Spree::PaymentSource def stripe_payment_method return if stripe_payment_method_id.blank? @stripe_payment_method ||= payment_method.gateway.request do Stripe::PaymentMethod.retrieve(stripe_payment_method_id) end end def actions %w[capture void credit] end def can_capture?(payment) payment.pending? end def can_void?(payment) payment.pending? end def can_credit?(payment) payment.completed? && payment.credit_allowed > 0 end end end
Version data entries
7 entries across 7 versions & 1 rubygems