add junctionpay(vaap)
This commit is contained in:
@@ -36,8 +36,20 @@ class Origami::JunctionPayController < BaseOrigamiController
|
||||
end
|
||||
|
||||
def create
|
||||
cash = params[:amount]
|
||||
gift_amount = params[:gift_amount]
|
||||
voucher_amount = params[:voucher_amount]
|
||||
voucher_no = params[:voucher_no]
|
||||
sale_id = params[:sale_id]
|
||||
|
||||
# Gift card or Voucher classified and add for payment_reference
|
||||
remarks = ''
|
||||
cash = (gift_amount.to_f + voucher_amount.to_f)
|
||||
if gift_amount.to_f > 0
|
||||
remarks = "Junciton Gift Card Payment. RefNo-" + voucher_no
|
||||
else
|
||||
remarks = "Junciton Voucher Payment. RefNo-" + voucher_no
|
||||
end
|
||||
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
shop_details = Shop::ShopDetail
|
||||
@@ -51,7 +63,7 @@ class Origami::JunctionPayController < BaseOrigamiController
|
||||
|
||||
# saleObj = Sale.find(sale_id)
|
||||
sale_payment = SalePayment.new
|
||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "JunctionPay")
|
||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "JunctionPay", remarks)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -334,8 +334,8 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
@mastercount += spay.payment_amount
|
||||
elsif spay.payment_method == "unionpay"
|
||||
@unionpaycount += spay.payment_amount
|
||||
elsif spay.payment_method == "junctionpay"
|
||||
@unionpaycount += spay.payment_amount
|
||||
elsif spay.payment_method == "JunctionPay"
|
||||
@junctionpaycount += spay.payment_amount
|
||||
elsif spay.payment_method == "creditnote"
|
||||
@credit += spay.payment_amount
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user