Payment Method

This commit is contained in:
yarzar_code
2019-12-18 15:05:28 +06:30
parent 358fbcd134
commit 41d9c1375c
3 changed files with 26 additions and 6 deletions

View File

@@ -1,4 +1,23 @@
class PaymentMethodSetting < ApplicationRecord
# validations
validates_presence_of :payment_method , :gateway_communication_type #, :gateway_url, :auth_token, :merchant_account_id
validates_presence_of :payment_method , :gateway_communication_type #, :gateway_url, :auth_token, :merchant_account_id
def self.cash_exist
temp = PaymentMethodSetting.where(payment_method: "Cash", is_active: true)
if temp.present?
return true
else
return false
end
end
def self.credit_exist
temp = PaymentMethodSetting.where(payment_method: "Credit", is_active: true)
if temp.present?
return true
else
return false
end
end
end