3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/lolita-bank-link/billing.rb', line 3
def self.included(base)
base.has_many :bank_link_transactions, as: :paymentable, class_name: "LolitaBankLink::Transaction", dependent: :destroy
base.class_eval do
def description
raise NotImplementedError, 'Redefine this method in your billing model.'
end
def price
raise NotImplementedError, 'Redefine this method in your billing model.'
end
def currency
raise NotImplementedError, 'Redefine this method in your billing model.'
end
def bank_link_trx_saved trx
raise NotImplementedError, "Redefine this method in your billing model."
end
def bank_link_return_path
raise NotImplementedError, 'This should be inplemented on your paymentable class'
end
def bank_link_paid?
self.bank_link_transactions.where(status: "completed").count >= 1
end
end
end
|