Class: Payify::Payment

Inherits:
ApplicationRecord show all
Includes:
StripePaymentConcern
Defined in:
app/models/payify/payment.rb

Instance Method Summary collapse

Methods included from StripePaymentConcern

#stripe_client, #stripe_confirm_payment, #stripe_init_intent, #tax_id

Instance Method Details

#can_destroy?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/models/payify/payment.rb', line 23

def can_destroy?
  !paid?
end

#make_payment(transaction_id) ⇒ Object



17
18
19
20
21
# File 'app/models/payify/payment.rb', line 17

def make_payment(transaction_id)
  self.transaction_id = transaction_id
  self.paid_at = Time.current
  self.status = :paid
end

#paid?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/models/payify/payment.rb', line 27

def paid?
  paid_at.present?
end