add rounding adj in paypar payment
This commit is contained in:
@@ -6,6 +6,15 @@ class Origami::PayparPaymentsController < BaseOrigamiController
|
|||||||
payment_method = "paypar"
|
payment_method = "paypar"
|
||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
|
shop_details = Shop::ShopDetail
|
||||||
|
|
||||||
|
# rounding adjustment
|
||||||
|
if shop_details.is_rounding_adj
|
||||||
|
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||||
|
rounding_adj = new_total-saleObj.grand_total
|
||||||
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
||||||
|
end
|
||||||
|
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
status,msg =sale_payment.process_payment(saleObj, @user, redeem_amount,payment_method)
|
status,msg =sale_payment.process_payment(saleObj, @user, redeem_amount,payment_method)
|
||||||
if status == true
|
if status == true
|
||||||
|
|||||||
Reference in New Issue
Block a user