From d122fec29cd021a6d7981e3e933236567755ea7e Mon Sep 17 00:00:00 2001 From: palak Date: Fri, 13 Oct 2017 18:35:04 +0530 Subject: [PATCH] modify --- script.js | 239 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 119 insertions(+), 120 deletions(-) diff --git a/script.js b/script.js index 565d5b0..fd37c92 100644 --- a/script.js +++ b/script.js @@ -247,126 +247,125 @@ console.log("result", result) $scope.detail = result; data.applicantId = result.data.id; - $scope.userId = result.data.id; - - }, function myError(error) {}); - } - - if ($scope.data.stage == "Idea") { - console.log("$scope.data", $scope.data) - $scope.ticketAmnt = 500; - } - - if ($scope.data.stage == "Product") { - $scope.ticketAmnt = 1000; - } - - if ($scope.data.stage == "Growth") { - $scope.ticketAmnt = 1000; - } - var amount = $scope.ticketAmnt * 100 - if($scope.tokencheck == true){ - var amount = $scope.ticketAmnt - // $scope.discountAmount = (amount * 10)/100 - console.log("finalAmount====>",$scope.payingAmnt) - } - - var taxAmount = $scope.ticketAmnt - // $scope.taxTotal = (taxAmount * 18)/100 - $scope.payingAmnt = taxAmount - console.log("taxincludedamount----", $scope.payingAmnt) - // } - - /*****THIS IS FOR STEP THREE FORM ******/ - // $scope.create = function() { - // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { - // var x = document.getElementById("snackbar") - // x.className = "show"; - // setTimeout(function() { - // x.className = x.className.replace("show", ""); - // }, 3000); - // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { - // $scope.infoForm = true; - // console.log("sdasdasdsa"); - // $scope.data.stage = $scope.data.stage; - // $scope.detail = {}; - // $scope.data.phone = "+91" + $scope.data.number; - // $http({ - // method: 'POST', - // url: BASE_URL + '/applicants', - // data: $scope.data, - // headers: {} - // }).then(function mySuccess(result) { - - // console.log("=====result=====", result) - // $scope.detail = result; - // data.applicantId = result.data.id; - // $scope.userId = result.data.id; - // console.log("=====data=====", data) - data.amount = $scope.payingAmnt; - if ($scope.detail != null) { - $http({ - method: 'POST', - url: BASE_URL + '/payments', - data: data, - headers: {} - }).then(function mySuccess(paymentResult) { - Analytics.trackEvent('payments', 'click', 'django.mp4'); - console.log("paymentResult",paymentResult) - $scope.paymentResult = paymentResult; - }, function myError(error) {}); - } - var i = 0; - $scope.payingAmnt = $scope.payingAmnt * 100; - var options = { - "key": "rzp_live_mhSE1uOBlXvFyJ", - "amount": $scope.payingAmnt, - - "name": "Startup Jalsa", - "description": "amount", - "currency": "INR", - "status": "done", - - "theme": { - "color": "#2196f3 ", - "image_padding": "NO" - }, - "modal": { - "ondismiss": function() {} - }, - "handler": function(response) { - createPayment(response); - } - }; - var rzp1 = new Razorpay(options); - rzp1.open(); - $scope.paymentResponse = {}; - - function createPayment(response) { - Analytics.trackEvent('payments', 'click', 'django.mp4'); - console.log("response====from===razorpay",response) - $route.reload(); - $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; - $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; - $scope.paymentResponse.amount = data.amount; - $scope.paymentResponse.currency = "INR"; - $scope.paymentResponse.status = $scope.paymentResult.data.status; - $http({ - method: 'PUT', - url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, - data: $scope.paymentResponse, - headers: {} - }).then(function mySuccess(searchResult) { - Analytics.trackEvent('payments', 'click', 'django.mp4'); - console.log("searchResult", searchResult) - $location.path("/confirmation") - //$scope.showToastr() - //toaster.success("Registration done successfully"); - - }, function myError(error) {}); - } - - } + //$scope.userId = result.data.id; + + if ($scope.data.stage == "Idea") { + console.log("$scope.data", $scope.data) + $scope.ticketAmnt = 500; + } + + if ($scope.data.stage == "Product") { + $scope.ticketAmnt = 1000; + } + + if ($scope.data.stage == "Growth") { + $scope.ticketAmnt = 1000; + } + var amount = $scope.ticketAmnt * 100 + if($scope.tokencheck == true){ + var amount = $scope.ticketAmnt + // $scope.discountAmount = (amount * 10)/100 + console.log("finalAmount====>",$scope.payingAmnt) + } + + var taxAmount = $scope.ticketAmnt + // $scope.taxTotal = (taxAmount * 18)/100 + $scope.payingAmnt = taxAmount + console.log("taxincludedamount----", $scope.payingAmnt) + // } + + /*****THIS IS FOR STEP THREE FORM ******/ + // $scope.create = function() { + // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { + // var x = document.getElementById("snackbar") + // x.className = "show"; + // setTimeout(function() { + // x.className = x.className.replace("show", ""); + // }, 3000); + // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { + // $scope.infoForm = true; + // console.log("sdasdasdsa"); + // $scope.data.stage = $scope.data.stage; + // $scope.detail = {}; + // $scope.data.phone = "+91" + $scope.data.number; + // $http({ + // method: 'POST', + // url: BASE_URL + '/applicants', + // data: $scope.data, + // headers: {} + // }).then(function mySuccess(result) { + + // console.log("=====result=====", result) + // $scope.detail = result; + // data.applicantId = result.data.id; + // $scope.userId = result.data.id; + // console.log("=====data=====", data) + data.amount = $scope.payingAmnt; + if ($scope.detail != null) { + $http({ + method: 'POST', + url: BASE_URL + '/payments', + data: data, + headers: {} + }).then(function mySuccess(paymentResult) { + Analytics.trackEvent('payments', 'click', 'django.mp4'); + console.log("paymentResult",paymentResult) + $scope.paymentResult = paymentResult; + }, function myError(error) {}); + } + var i = 0; + $scope.payingAmnt = $scope.payingAmnt * 100; + var options = { + "key": "rzp_live_mhSE1uOBlXvFyJ", + "amount": $scope.payingAmnt, + + "name": "Startup Jalsa", + "description": "amount", + "currency": "INR", + "status": "done", + + "theme": { + "color": "#2196f3 ", + "image_padding": "NO" + }, + "modal": { + "ondismiss": function() {} + }, + "handler": function(response) { + createPayment(response); + } + }; + var rzp1 = new Razorpay(options); + rzp1.open(); + $scope.paymentResponse = {}; + + function createPayment(response) { + Analytics.trackEvent('payments', 'click', 'django.mp4'); + console.log("response====from===razorpay",response) + $route.reload(); + $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; + $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; + $scope.paymentResponse.amount = data.amount; + $scope.paymentResponse.currency = "INR"; + $scope.paymentResponse.status = $scope.paymentResult.data.status; + $http({ + method: 'PUT', + url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, + data: $scope.paymentResponse, + headers: {} + }).then(function mySuccess(searchResult) { + Analytics.trackEvent('payments', 'click', 'django.mp4'); + console.log("searchResult", searchResult) + $location.path("/confirmation") + //$scope.showToastr() + //toaster.success("Registration done successfully"); + + }, function myError(error) {}); + } + }, function myError(error) {}); + } + + } //}, function myError(error) {}); //} -- 2.0.0