Edit Redim
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -12,7 +12,7 @@ gem 'rails', '~> 5.1.0'
|
||||
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
||||
|
||||
#Use PosgreSQL
|
||||
gem 'pg'
|
||||
# gem 'pg'
|
||||
|
||||
# redis server for cable
|
||||
# gem 'redis', '~> 3.0'
|
||||
|
||||
@@ -110,7 +110,6 @@ GEM
|
||||
nokogiri (1.7.2)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
pdf-core (0.7.0)
|
||||
pg (0.20.0)
|
||||
prawn (2.2.2)
|
||||
pdf-core (~> 0.7.0)
|
||||
ttfunk (~> 1.5)
|
||||
@@ -247,7 +246,6 @@ DEPENDENCIES
|
||||
kaminari (~> 0.16.3)
|
||||
listen (~> 3.0.5)
|
||||
mysql2 (>= 0.3.18, < 0.5)
|
||||
pg
|
||||
prawn
|
||||
prawn-table
|
||||
puma (~> 3.0)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -87,7 +87,7 @@ Rails.application.routes.draw do
|
||||
#--------- Payment ------------#
|
||||
get 'sale/:sale_id/payment' => 'payments#show'
|
||||
post 'payment/cash' => 'payments#create'
|
||||
post 'paypar_payment_process' => 'paypar_payments#create'
|
||||
post 'payment/paypar' => 'paypar_payments#create'
|
||||
get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index"
|
||||
get 'sale/:sale_id/payment/others_payment' => "others_payments#index"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user