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'
|
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
||||||
|
|
||||||
#Use PosgreSQL
|
#Use PosgreSQL
|
||||||
gem 'pg'
|
# gem 'pg'
|
||||||
|
|
||||||
# redis server for cable
|
# redis server for cable
|
||||||
# gem 'redis', '~> 3.0'
|
# gem 'redis', '~> 3.0'
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ GEM
|
|||||||
nokogiri (1.7.2)
|
nokogiri (1.7.2)
|
||||||
mini_portile2 (~> 2.1.0)
|
mini_portile2 (~> 2.1.0)
|
||||||
pdf-core (0.7.0)
|
pdf-core (0.7.0)
|
||||||
pg (0.20.0)
|
|
||||||
prawn (2.2.2)
|
prawn (2.2.2)
|
||||||
pdf-core (~> 0.7.0)
|
pdf-core (~> 0.7.0)
|
||||||
ttfunk (~> 1.5)
|
ttfunk (~> 1.5)
|
||||||
@@ -247,7 +246,6 @@ DEPENDENCIES
|
|||||||
kaminari (~> 0.16.3)
|
kaminari (~> 0.16.3)
|
||||||
listen (~> 3.0.5)
|
listen (~> 3.0.5)
|
||||||
mysql2 (>= 0.3.18, < 0.5)
|
mysql2 (>= 0.3.18, < 0.5)
|
||||||
pg
|
|
||||||
prawn
|
prawn
|
||||||
prawn-table
|
prawn-table
|
||||||
puma (~> 3.0)
|
puma (~> 3.0)
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
|
|||||||
if member_actions.gateway_url
|
if member_actions.gateway_url
|
||||||
@campaign_type_id = member_actions.additional_parameter["campaign_type_id"]
|
@campaign_type_id = member_actions.additional_parameter["campaign_type_id"]
|
||||||
url = membership_setting.gateway_url.to_s + member_actions.gateway_url.to_s
|
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
|
if membership_data["status"]==true
|
||||||
@membership_rebate_balance=membership_data["balance"]
|
@membership_rebate_balance=membership_data["balance"]
|
||||||
@out = true, @membership_rebate_balance,@membership_id
|
@out = true, @membership_rebate_balance,@membership_id
|
||||||
|
|||||||
@@ -66,9 +66,9 @@ class SalePayment < ApplicationRecord
|
|||||||
|
|
||||||
end
|
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,
|
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 => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json'
|
'Accept' => 'application/json'
|
||||||
@@ -85,7 +85,7 @@ class SalePayment < ApplicationRecord
|
|||||||
merchant_uid = membership_actions_data.merchant_account_id
|
merchant_uid = membership_actions_data.merchant_account_id
|
||||||
campaign_type_id = membership_actions_data.additional_parameter["campaign_type_id"]
|
campaign_type_id = membership_actions_data.additional_parameter["campaign_type_id"]
|
||||||
response = HTTParty.post(url,
|
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 => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json'
|
'Accept' => 'application/json'
|
||||||
|
|||||||
@@ -140,13 +140,14 @@ $("#redeem").click(function(){
|
|||||||
membership_id = $("#valid_amount").attr('data-member-value');
|
membership_id = $("#valid_amount").attr('data-member-value');
|
||||||
redeem_amount = parseInt($("#used_amount").text());
|
redeem_amount = parseInt($("#used_amount").text());
|
||||||
if(redeem_amount<=0 ){
|
if(redeem_amount<=0 ){
|
||||||
alert(" Insufficient Amount!")
|
|
||||||
}else if(valid_amount< redeem_amount || redeem_amount == ""){
|
|
||||||
alert("Please type valid amount");
|
alert("Please type valid amount");
|
||||||
|
|
||||||
|
}else if(valid_amount< redeem_amount){
|
||||||
|
alert(" Insufficient Amount!")
|
||||||
}else{
|
}else{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
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},
|
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
if(result.status == true){
|
if(result.status == true){
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ Rails.application.routes.draw do
|
|||||||
#--------- Payment ------------#
|
#--------- Payment ------------#
|
||||||
get 'sale/:sale_id/payment' => 'payments#show'
|
get 'sale/:sale_id/payment' => 'payments#show'
|
||||||
post 'payment/cash' => 'payments#create'
|
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/credit_payment' => "credit_payments#index"
|
||||||
get 'sale/:sale_id/payment/others_payment' => "others_payments#index"
|
get 'sale/:sale_id/payment/others_payment' => "others_payments#index"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user