check payment method

This commit is contained in:
phyusin
2018-03-30 15:24:51 +06:30
parent 75f3377d75
commit 6a9fd67bff
17 changed files with 456 additions and 53 deletions

View File

@@ -51,6 +51,8 @@ class SalePayment < ApplicationRecord
payment_status = foc_payment
when "JunctionPay"
payment_status = junction_pay_payment
when "alipay"
payment_status = external_terminal_card_payment(:alipay)
else
puts "it was something else"
end
@@ -230,7 +232,7 @@ class SalePayment < ApplicationRecord
payment_status = false
self.payment_method = method
self.payment_amount = self.received_amount
self.payment_reference = self.card_payment_reference
# self.payment_reference = self.card_payment_reference
self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f
self.payment_status = "paid"
payment_method = self.save!