Sha256: 6dedf825306e774c773e9699bfb5f6ca18a84e332a8fbe9f75ddab5be599be5c
Contents?: true
Size: 671 Bytes
Versions: 8
Compression:
Stored size: 671 Bytes
Contents
# frozen_string_literal: true module SolidusPaypalCommercePlatform class PaymentSource < SolidusSupport.payment_source_parent_class self.table_name = "paypal_commerce_platform_sources" validates :paypal_order_id, :payment_method_id, presence: true def actions %w(capture void credit) end def can_capture?(payment) payment.pending? || payment.checkout? end def can_void?(payment) can_capture?(payment) end def can_credit?(payment) payment.completed? && payment.credit_allowed > 0 && capture_id && payment_method.gateway.get_order(paypal_order_id).status == "COMPLETED" end end end
Version data entries
8 entries across 8 versions & 1 rubygems