update dinga and paymal
This commit is contained in:
@@ -23,6 +23,7 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
if (amount_due >= 0)
|
||||
payment_status = false
|
||||
membership_data = nil
|
||||
#route to payment type
|
||||
case payment_method
|
||||
when "cash"
|
||||
@@ -52,11 +53,11 @@ class SalePayment < ApplicationRecord
|
||||
when "foc"
|
||||
payment_status = foc_payment
|
||||
when "paymal"
|
||||
payment_status = paymal_payment
|
||||
payment_status,membership_data = paymal_payment
|
||||
when "JunctionPay"
|
||||
payment_status = junction_pay_payment
|
||||
when "dinga"
|
||||
payment_status = dinga_payment
|
||||
payment_status,membership_data = dinga_payment
|
||||
else
|
||||
puts "it was something else"
|
||||
end
|
||||
@@ -73,7 +74,7 @@ class SalePayment < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
return true, self.save
|
||||
return true, self.save,membership_data
|
||||
else
|
||||
#record an payment in sale-audit
|
||||
# remark = "No outstanding Amount - Grand Total [#{invoice.grand_total}] | Due [#{amount_due}] | Paid [#{invoice.amount_received}]"
|
||||
@@ -430,7 +431,7 @@ class SalePayment < ApplicationRecord
|
||||
sale_update_payment_status(0)
|
||||
end
|
||||
|
||||
return payment_status
|
||||
return payment_status,membership_data
|
||||
end
|
||||
|
||||
def junction_pay_payment
|
||||
@@ -480,7 +481,7 @@ class SalePayment < ApplicationRecord
|
||||
sale_update_payment_status(0)
|
||||
end
|
||||
|
||||
return payment_status
|
||||
return payment_status,membership_data
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user