Update
This commit is contained in:
@@ -8,7 +8,7 @@ class Origami::PayparPaymentsController < BaseOrigamiController
|
|||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
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
|
||||||
@out = true, "Success!"
|
@out = true, "Success!"
|
||||||
else
|
else
|
||||||
@@ -19,4 +19,4 @@ class Origami::PayparPaymentsController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,13 +14,15 @@ class Settings::MembershipActionsController < ApplicationController
|
|||||||
if !membership_actions_data.nil?
|
if !membership_actions_data.nil?
|
||||||
url = params[:gateway_url].to_s + membership_actions_data.gateway_url.to_s
|
url = params[:gateway_url].to_s + membership_actions_data.gateway_url.to_s
|
||||||
puts url.to_json
|
puts url.to_json
|
||||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
if sale_data.customer_id
|
if sale_data.customer_id
|
||||||
customer_data= Customer.find_by_customer_id(sale_data.customer_id)
|
customer_data= Customer.find_by_customer_id(sale_data.customer_id)
|
||||||
|
puts customer_data.to_json
|
||||||
@membership_id = customer_data.membership_id
|
@membership_id = customer_data.membership_id
|
||||||
@campaign_type_id =1
|
@campaign_type_id =1
|
||||||
if !@membership_id.nil?
|
if !@membership_id.nil?
|
||||||
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
||||||
|
puts membership_setting
|
||||||
membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id)
|
membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id)
|
||||||
if membership_data["status"]==true
|
if membership_data["status"]==true
|
||||||
@membership_rebate_balance=membership_data["balance"]
|
@membership_rebate_balance=membership_data["balance"]
|
||||||
@@ -41,7 +43,7 @@ class Settings::MembershipActionsController < ApplicationController
|
|||||||
end
|
end
|
||||||
render :json => @out.to_json
|
render :json => @out.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /settings/membership_actions/1
|
# GET /settings/membership_actions/1
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<% @payment_method_setting.each do |payment_method|%>
|
<% @payment_method_setting.each do |payment_method|%>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<div class="col-md-12 long purple " id="<%= payment_method.payment_method%>" data-url="<%=payment_method.gateway_url%>" data-sale-id="<%= @sale_id%>"><%= payment_method.payment_method %></div>
|
<div class="col-md-12 long purple " id="<%= payment_method.payment_method%>" data-url="<%=payment_method.gateway_url%>" data-sale-id="<%= @sale_id%>"><%= payment_method.payment_method %></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-7 col-md-7 col-sm-7">
|
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||||
<div class="rebate-form" hidden="true">
|
<div class="rebate-form" hidden="true">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -18,14 +18,14 @@
|
|||||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="">
|
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="">
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
<label class="col-lg-4 col-md-4 col-sm-4">Used Amount</label>
|
<label class="col-lg-4 col-md-4 col-sm-4">Used Amount</label>
|
||||||
<div id="used_amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
<div id="used_amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@@ -86,16 +86,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<div class="col-md-12 cashier_number long purple" id="redeem" data-value="<%=@sale_id %>" data-member-value = "<%= @membership_id %>">PAY</div>
|
<div class="col-md-12 cashier_number long purple" id="redeem" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">PAY</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).on('click', '.cashier_number', function(event){
|
$(document).on('click', '.cashier_number', function(event){
|
||||||
@@ -121,7 +121,7 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
var input_value = $(this).attr("data-value");
|
var input_value = $(this).attr("data-value");
|
||||||
amount = parseInt(input_value) + parseInt(original_value);
|
amount = parseInt(input_value) + parseInt(original_value);
|
||||||
$('#used_amount').html(amount);
|
$('#used_amount').html(amount);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'clr':
|
case 'clr':
|
||||||
$('#used_amount').html("0.0");
|
$('#used_amount').html("0.0");
|
||||||
@@ -133,7 +133,6 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#REDIMREBATE").click(function(){
|
$("#REDIMREBATE").click(function(){
|
||||||
$('.rebate-form').removeAttr("hidden");
|
$('.rebate-form').removeAttr("hidden");
|
||||||
gateway_url = $(this).attr("data-url");
|
gateway_url = $(this).attr("data-url");
|
||||||
@@ -174,4 +173,4 @@ $("#redeem").click(function(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user