fixed conflict
This commit is contained in:
17
app/controllers/origami/mpu_controller.rb
Normal file
17
app/controllers/origami/mpu_controller.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class Origami::MpuController < BaseOrigamiController
|
||||
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
end
|
||||
|
||||
def create
|
||||
cash = params[:amount]
|
||||
sale_id = params[:sale_id]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
sale_payment = SalePayment.new
|
||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -5,6 +5,7 @@ class Origami::OthersPaymentsController < BaseOrigamiController
|
||||
@membership_rebate_balance = 0
|
||||
@sale_id = params[:sale_id]
|
||||
@payment_method_setting = PaymentMethodSetting.all
|
||||
|
||||
# @sale_id = params[:sale_id]
|
||||
# sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
|
||||
|
||||
@@ -17,7 +17,17 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
def show
|
||||
sale_id = params[:sale_id]
|
||||
if Sale.exists?(sale_id)
|
||||
@cash = 0.0
|
||||
@other = 0.0
|
||||
@sale_data = Sale.find_by_sale_id(sale_id)
|
||||
@sale_data.sale_payments.each do |spay|
|
||||
if spay.payment_method == "cash"
|
||||
@cash = spay.payment_amount
|
||||
end
|
||||
if spay.payment_method == "mpu"
|
||||
@other = spay.payment_amount
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ class Origami::PayparPaymentsController < BaseOrigamiController
|
||||
saleObj = Sale.find(sale_id)
|
||||
sale_payment = SalePayment.new
|
||||
status,msg =sale_payment.process_payment(saleObj, @user, redeem_amount,payment_method)
|
||||
|
||||
if status == true
|
||||
@out = true, "Success!"
|
||||
else
|
||||
@@ -19,4 +18,4 @@ class Origami::PayparPaymentsController < BaseOrigamiController
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
46
app/controllers/origami/redeem_payments_controller.rb
Normal file
46
app/controllers/origami/redeem_payments_controller.rb
Normal file
@@ -0,0 +1,46 @@
|
||||
class Origami::RedeemPaymentsController < BaseOrigamiController
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
payment_method = params[:payment_method]
|
||||
@membership_rebate_balance=0
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
if sale_data
|
||||
if sale_data.customer_id
|
||||
customer_data= Customer.find_by_customer_id(sale_data.customer_id)
|
||||
if customer_data
|
||||
@membership_id = customer_data.membership_id
|
||||
if !@membership_id.nil?
|
||||
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
if membership_setting.gateway_url
|
||||
member_actions =MembershipAction.find_by_membership_type("get_account_balance")
|
||||
if member_actions.gateway_url
|
||||
@campaign_type_id = member_actions.additional_parameter["campaign_type_id"]
|
||||
url = membership_setting.gateway_url.to_s + member_actions.gateway_url.to_s
|
||||
membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id)
|
||||
if membership_data["status"]==true
|
||||
@membership_rebate_balance=membership_data["balance"]
|
||||
@out = true, @membership_rebate_balance,@membership_id
|
||||
end
|
||||
else
|
||||
@out =false,0
|
||||
end
|
||||
else
|
||||
@out = false,0
|
||||
end
|
||||
|
||||
|
||||
else
|
||||
@out = false, 0
|
||||
end
|
||||
else
|
||||
@out = false, 0
|
||||
end
|
||||
else
|
||||
@out = false, 0
|
||||
end
|
||||
else
|
||||
@out = false, 0
|
||||
end
|
||||
@out = false, 0
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user