Edit Redim

This commit is contained in:
Moe Su
2017-06-12 18:18:24 +06:30
parent e6647dd494
commit b47c983886
7 changed files with 11 additions and 11 deletions

View File

@@ -16,7 +16,8 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
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)
merchant_uid= member_actions.merchant_account_id
membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid)
if membership_data["status"]==true
@membership_rebate_balance=membership_data["balance"]
@out = true, @membership_rebate_balance,@membership_id

View File

@@ -66,9 +66,9 @@ class SalePayment < ApplicationRecord
end
def self.get_paypar_account(url,token,membership_id,campaign_type_id)
def self.get_paypar_account(url,token,membership_id,campaign_type_id,merchant_uid)
response = HTTParty.get(url,
:body => { app_token: token,membership_id:membership_id,campaign_type_id:campaign_type_id}.to_json,
:body => { app_token: token,membership_id:membership_id,campaign_type_id:campaign_type_id,merchant_uid:merchant_uid}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
@@ -85,7 +85,7 @@ class SalePayment < ApplicationRecord
merchant_uid = membership_actions_data.merchant_account_id
campaign_type_id = membership_actions_data.additional_parameter["campaign_type_id"]
response = HTTParty.post(url,
:body => { generic_customer_id:membership_id,total_amount:received_amount,receipet_no:sale_id,campaign_type_id:campaign_type_id,account_no:"",merchant_uid:merchant_uid}.to_json,
:body => { generic_customer_id:membership_id,redeem_amount:received_amount,receipet_no:sale_id,campaign_type_id:campaign_type_id,account_no:"",merchant_uid:merchant_uid}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'

View File

@@ -140,13 +140,14 @@ $("#redeem").click(function(){
membership_id = $("#valid_amount").attr('data-member-value');
redeem_amount = parseInt($("#used_amount").text());
if(redeem_amount<=0 ){
alert(" Insufficient Amount!")
}else if(valid_amount< redeem_amount || redeem_amount == ""){
alert("Please type valid amount");
}else if(valid_amount< redeem_amount){
alert(" Insufficient Amount!")
}else{
$.ajax({
type: "POST",
url: "<%=origami_paypar_payment_process_path%>",
url: "<%=origami_payment_paypar_path%>",
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
success: function(result){
if(result.status == true){