diff --git a/pages/registrationForm.html b/pages/registrationForm.html index d1a6c88..f8e3487 100644 --- a/pages/registrationForm.html +++ b/pages/registrationForm.html @@ -70,14 +70,14 @@ -
- + - +
diff --git a/script.js b/script.js index 91b4d85..fa36cfb 100644 --- a/script.js +++ b/script.js @@ -1365,54 +1365,52 @@ scotchApp.controller('registrationFormController', function($q, $scope, $http, $ $scope.data = {}; $scope.data.city = localStorage.getItem("city"); var data = { - "amount": $scope.payingAmnt, - "currency": "INR", - "status": "pending" + "status": "captured" } //$scope.payingAmnt = 590; - $rootScope.tokenCall = function(val) { - if (val == undefined) { - $('#invalidToken').css('display', 'block'); - } else { - val = val.toUpperCase(); - if(((val == "SMVDU") && $scope.data.city != "Katra") || ((val == "LEH") && $scope.data.city != "Leh")){ - $scope.tokencheck = false; - return; - } - $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') - .then(function(searchResult) { - if (searchResult.data.length == 0) { - $scope.tokencheck = false; - $scope.discountAmount = 0; + // $rootScope.tokenCall = function(val) { + // if (val == undefined) { + // $('#invalidToken').css('display', 'block'); + // } else { + // val = val.toUpperCase(); + // if(((val == "SMVDU") && $scope.data.city != "Katra") || ((val == "LEH") && $scope.data.city != "Leh")){ + // $scope.tokencheck = false; + // return; + // } + // $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') + // .then(function(searchResult) { + // if (searchResult.data.length == 0) { + // $scope.tokencheck = false; + // $scope.discountAmount = 0; - } else { - $scope.discountpercentage = searchResult.data[0].discount; - $scope.tokencheck = true; - } - $scope.ticketAmnt = 590; - var amount = $scope.ticketAmnt * 100 - if($scope.tokencheck == true){ - var amount = $scope.ticketAmnt - if($scope.discountpercentage == "100") { - $scope.discountpercentage = "99.9"; - } - //console.log($scope.ticketAmnt) - $scope.percDiscount = $scope.discountpercentage/100; - //console.log($scope.percDiscount) - $scope.discountAmount = amount * $scope.percDiscount; - //console.log($scope.discountAmount) - } - var taxAmount = $scope.ticketAmnt - $scope.discountAmount - //console.log(taxAmount) - $scope.payingAmnt = taxAmount; - $scope.payingAmnt = $scope.payingAmnt.toFixed() - //console.log($scope.payingAmnt) - },function(err){ - console.log(err) - }); + // } else { + // $scope.discountpercentage = searchResult.data[0].discount; + // $scope.tokencheck = true; + // } + // $scope.ticketAmnt = 590; + // var amount = $scope.ticketAmnt * 100 + // if($scope.tokencheck == true){ + // var amount = $scope.ticketAmnt + // if($scope.discountpercentage == "100") { + // $scope.discountpercentage = "99.9"; + // } + // //console.log($scope.ticketAmnt) + // $scope.percDiscount = $scope.discountpercentage/100; + // //console.log($scope.percDiscount) + // $scope.discountAmount = amount * $scope.percDiscount; + // //console.log($scope.discountAmount) + // } + // var taxAmount = $scope.ticketAmnt - $scope.discountAmount + // //console.log(taxAmount) + // $scope.payingAmnt = taxAmount; + // $scope.payingAmnt = $scope.payingAmnt.toFixed() + // //console.log($scope.payingAmnt) + // },function(err){ + // console.log(err) + // }); - } - }; + // } + // }; $scope.formRegister = function() { //Analytics.trackEvent('register', 'click', 'Registration'); @@ -1420,13 +1418,13 @@ scotchApp.controller('registrationFormController', function($q, $scope, $http, $ $scope.detail = {}; $scope.data.phone = "+91"+$scope.data.number; console.log($scope.data.register) - if($scope.data.referalToken == null){ - $scope.data.referalToken = "NA" - } + // if($scope.data.referalToken == null){ + // $scope.data.referalToken = "NA" + // } if($scope.data.register == "Pitch"){ - $scope.ticketAmnt = 590; + $scope.ticketAmnt = 0; }else { - $scope.ticketAmnt = 118; + $scope.ticketAmnt = 0; } $http({ method: 'POST', @@ -1436,24 +1434,24 @@ scotchApp.controller('registrationFormController', function($q, $scope, $http, $ }).then(function mySuccess(result) { $scope.detail = result; data.applicantIndiaId = result.data.id; - var amount = $scope.ticketAmnt * 100 - if($scope.tokencheck == true){ - //console.log("test") - var amount = $scope.ticketAmnt - //console.log("test",$scope.ticketAmnt) - if($scope.discountpercentage == "100") { - $scope.discountpercentage = "99.9"; - } - $scope.percDiscount = $scope.discountpercentage/100; - //console.log($scope.percDiscount) - $scope.discountAmount = amount * $scope.percDiscount; - //console.log($scope.discountAmount) - } - var taxAmount = $scope.ticketAmnt - $scope.discountAmount - $scope.payingAmnt = taxAmount; - $scope.payingAmnt = $scope.payingAmnt.toFixed() - //console.log($scope.payingAmnt) - data.amount = $scope.payingAmnt; + // var amount = $scope.ticketAmnt * 100 + // if($scope.tokencheck == true){ + // //console.log("test") + // var amount = $scope.ticketAmnt + // //console.log("test",$scope.ticketAmnt) + // if($scope.discountpercentage == "100") { + // $scope.discountpercentage = "99.9"; + // } + // $scope.percDiscount = $scope.discountpercentage/100; + // //console.log($scope.percDiscount) + // $scope.discountAmount = amount * $scope.percDiscount; + // //console.log($scope.discountAmount) + // } + // var taxAmount = $scope.ticketAmnt - $scope.discountAmount + // $scope.payingAmnt = taxAmount; + // $scope.payingAmnt = $scope.payingAmnt.toFixed() + // //console.log($scope.payingAmnt) + // data.amount = $scope.payingAmnt; //var amount = $scope.ticketAmnt * 100 if($scope.detail != null){ $http({ @@ -1466,63 +1464,63 @@ scotchApp.controller('registrationFormController', function($q, $scope, $http, $ $scope.loading = false; //$scope.ambassadorId = paymentResult.data.ambassadorId $scope.paymentResult = paymentResult; - //$location.path("/paytm/confirm") + $location.path("/paytm/confirm") }, function myError(error) { }); } - var i = 0; - $scope.payingAmntt = $scope.payingAmnt * 100; - //console.log($scope.payingAmntt) - var options = { - //"key": "rzp_test_YwHsVFiDIQ2WUQ", - "key": "rzp_live_mkmCb4FkstuWaS", - "amount": $scope.payingAmntt, - - "name": "Startup Jalsa", - "description":"amount", - "currency": "INR", - "status": "done", - - "prefill": { - "email": $scope.detail.email, - "contact": $scope.detail.phone - }, - - "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){ - console.log("response",response) - console.log($scope.paymentResult) - $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+'/paymentsIndia/'+$scope.paymentResult.data.id, - data: $scope.paymentResponse, - headers: {} - }).then(function mySuccess(searchResult) { - console.log("searchResult",searchResult) - $location.path("/confirm") - }, function myError(error) { - }); - } + // var i = 0; + // $scope.payingAmntt = $scope.payingAmnt * 100; + // //console.log($scope.payingAmntt) + // var options = { + // //"key": "rzp_test_YwHsVFiDIQ2WUQ", + // "key": "rzp_live_mkmCb4FkstuWaS", + // "amount": $scope.payingAmntt, + + // "name": "Startup Jalsa", + // "description":"amount", + // "currency": "INR", + // "status": "done", + + // "prefill": { + // "email": $scope.detail.email, + // "contact": $scope.detail.phone + // }, + + // "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){ + // console.log("response",response) + // console.log($scope.paymentResult) + // $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+'/paymentsIndia/'+$scope.paymentResult.data.id, + // data: $scope.paymentResponse, + // headers: {} + // }).then(function mySuccess(searchResult) { + // console.log("searchResult",searchResult) + // $location.path("/confirm") + // }, function myError(error) { + // }); + // } //} }, function myError(error) {