Module: Payify::HasPaymentConcern

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/payify/has_payment_concern.rb

Instance Method Summary collapse

Instance Method Details

#amount_to_payObject

Raises:

  • (NotImplementedError)


20
21
22
# File 'app/models/concerns/payify/has_payment_concern.rb', line 20

def amount_to_pay
  raise NotImplementedError, "The 'amount_to_pay' method must be implemented in the including model."
end

#cancel_paymentObject



16
17
18
# File 'app/models/concerns/payify/has_payment_concern.rb', line 16

def cancel_payment
  payment.destroy if payment.present?
end

#create_paymentObject



9
10
11
12
13
14
# File 'app/models/concerns/payify/has_payment_concern.rb', line 9

def create_payment
  build_payment(amount: amount_to_pay)

  payment.save
  payment
end

#tax_rates_idObject



24
25
26
# File 'app/models/concerns/payify/has_payment_concern.rb', line 24

def tax_rates_id
  nil
end