Commit eb448ef43338a53da9d57b670cc27d31e153664e
1 parent
53b83aa9e8
Exists in
master
and in
1 other branch
change base url
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
script.js
1 | // create the module and name it scotchApp | 1 | // create the module and name it scotchApp |
2 | var scotchApp = angular.module('scotchApp', ['ngRoute']); | 2 | var scotchApp = angular.module('scotchApp', ['ngRoute']); |
3 | 3 | ||
4 | // configure our routes | 4 | // configure our routes |
5 | scotchApp.config(function($routeProvider) { | 5 | scotchApp.config(function($routeProvider) { |
6 | $routeProvider | 6 | $routeProvider |
7 | 7 | ||
8 | // route for the home page | 8 | // route for the home page |
9 | .when('/', { | 9 | .when('/', { |
10 | templateUrl : 'pages/home.html', | 10 | templateUrl : 'pages/home.html', |
11 | controller : 'mainController' | 11 | controller : 'mainController' |
12 | }) | 12 | }) |
13 | 13 | ||
14 | // route for the about page | 14 | // route for the about page |
15 | .when('/verification/=:id', { | 15 | .when('/verification/=:id', { |
16 | templateUrl : 'pages/verify.html', | 16 | templateUrl : 'pages/verify.html', |
17 | controller : 'verifyController' | 17 | controller : 'verifyController' |
18 | }) | 18 | }) |
19 | }); | 19 | }); |
20 | 20 | ||
21 | // create the controller and inject Angular's $scope | 21 | // create the controller and inject Angular's $scope |
22 | scotchApp.controller('mainController', function($scope, $http, $location,$route) { | 22 | scotchApp.controller('mainController', function($scope, $http, $location,$route) { |
23 | 23 | ||
24 | $scope.data = { | 24 | $scope.data = { |
25 | show: true, | 25 | show: true, |
26 | hide: false | 26 | hide: false |
27 | }; | 27 | }; |
28 | 28 | ||
29 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 29 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
30 | 30 | ||
31 | $scope.max = 100; | 31 | $scope.max = 100; |
32 | $scope.current = 0; | 32 | $scope.current = 0; |
33 | $scope.payingAmnt = 0; | 33 | $scope.payingAmnt = 0; |
34 | if ($scope.data.stage == 'select') { | 34 | if ($scope.data.stage == 'select') { |
35 | console.log("sdsaasd"); | 35 | console.log("sdsaasd"); |
36 | 36 | ||
37 | } | 37 | } |
38 | 38 | ||
39 | $scope.author = 'Swarn Singh'; | 39 | $scope.author = 'Swarn Singh'; |
40 | $scope.data = {}; | 40 | $scope.data = {}; |
41 | //$scope.data.stage = 'idea'; | 41 | //$scope.data.stage = 'idea'; |
42 | //$scope.data.email = ''; | 42 | //$scope.data.email = ''; |
43 | $scope.check = false; | 43 | $scope.check = false; |
44 | $scope.numberCheck = false; | 44 | $scope.numberCheck = false; |
45 | $scope.paymentResult = {}; | 45 | $scope.paymentResult = {}; |
46 | var BASE_URL = "http://0.0.0.0:4001/api"; | 46 | var BASE_URL = "http://139.59.68.74:4001/api"; |
47 | var data ={ | 47 | var data ={ |
48 | "amount":$scope.payingAmnt, | 48 | "amount":$scope.payingAmnt, |
49 | "currency": "INR", | 49 | "currency": "INR", |
50 | "status": "pending" | 50 | "status": "pending" |
51 | } | 51 | } |
52 | 52 | ||
53 | $scope.removeError = function(){ | 53 | $scope.removeError = function(){ |
54 | $('#invalidEmail').css('display', 'none'); | 54 | $('#invalidEmail').css('display', 'none'); |
55 | $('#alreadyExist').css('display', 'none'); | 55 | $('#alreadyExist').css('display', 'none'); |
56 | }; | 56 | }; |
57 | 57 | ||
58 | $scope.emailcheck = function(val){ | 58 | $scope.emailcheck = function(val){ |
59 | //console.log('val', val); | 59 | //console.log('val', val); |
60 | if (val == undefined) { | 60 | if (val == undefined) { |
61 | $('#invalidEmail').css('display', 'block'); | 61 | $('#invalidEmail').css('display', 'block'); |
62 | }else{ | 62 | }else{ |
63 | $http({ | 63 | $http({ |
64 | method: 'GET', | 64 | method: 'GET', |
65 | url: BASE_URL+'/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', | 65 | url: BASE_URL+'/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', |
66 | //data: email, | 66 | //data: email, |
67 | headers: {} | 67 | headers: {} |
68 | }).then(function mySuccess(searchResult) { | 68 | }).then(function mySuccess(searchResult) { |
69 | console.log("searchResult1===>",searchResult) | 69 | console.log("searchResult1===>",searchResult) |
70 | if(searchResult.data.length == 0){ | 70 | if(searchResult.data.length == 0){ |
71 | $scope.check = false; | 71 | $scope.check = false; |
72 | }else{ | 72 | }else{ |
73 | $scope.check = true; | 73 | $scope.check = true; |
74 | $('#alreadyExist').css('display', 'block'); | 74 | $('#alreadyExist').css('display', 'block'); |
75 | } | 75 | } |
76 | }, function myError(error) { | 76 | }, function myError(error) { |
77 | }); | 77 | }); |
78 | } | 78 | } |
79 | }; | 79 | }; |
80 | 80 | ||
81 | $scope.removeNoError = function(){ | 81 | $scope.removeNoError = function(){ |
82 | $('#noExist').css('display', 'none'); | 82 | $('#noExist').css('display', 'none'); |
83 | }; | 83 | }; |
84 | 84 | ||
85 | $scope.numbercheck = function(number){ | 85 | $scope.numbercheck = function(number){ |
86 | $http({ | 86 | $http({ |
87 | method: 'GET', | 87 | method: 'GET', |
88 | url: BASE_URL+'/applicants?filter={"where": {"phone": {"like":"%25'+number+'%25"}}}', | 88 | url: BASE_URL+'/applicants?filter={"where": {"phone": {"like":"%25'+number+'%25"}}}', |
89 | data: $scope.data, | 89 | data: $scope.data, |
90 | headers: {} | 90 | headers: {} |
91 | }).then(function mySuccess(searchResult) { | 91 | }).then(function mySuccess(searchResult) { |
92 | console.log("searchResult===>",searchResult) | 92 | console.log("searchResult===>",searchResult) |
93 | if(searchResult.data.length == 0){ | 93 | if(searchResult.data.length == 0){ |
94 | $scope.numberCheck = false; | 94 | $scope.numberCheck = false; |
95 | }else{ | 95 | }else{ |
96 | $scope.numberCheck = true; | 96 | $scope.numberCheck = true; |
97 | $('#noExist').css('display', 'block'); | 97 | $('#noExist').css('display', 'block'); |
98 | } | 98 | } |
99 | }, function myError(error) { | 99 | }, function myError(error) { |
100 | }); | 100 | }); |
101 | }; | 101 | }; |
102 | 102 | ||
103 | /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ | 103 | /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ |
104 | $(document).ready( | 104 | $(document).ready( |
105 | function(){ | 105 | function(){ |
106 | $('input:submit').attr('disabled',true); | 106 | $('input:submit').attr('disabled',true); |
107 | $('input:file').change( | 107 | $('input:file').change( |
108 | function(){ | 108 | function(){ |
109 | if ($("#picture").val()){ | 109 | if ($("#picture").val()){ |
110 | $('input:submit').removeAttr('disabled'); | 110 | $('input:submit').removeAttr('disabled'); |
111 | } | 111 | } |
112 | else { | 112 | else { |
113 | $('input:submit').attr('disabled',true); | 113 | $('input:submit').attr('disabled',true); |
114 | } | 114 | } |
115 | }); | 115 | }); |
116 | }); | 116 | }); |
117 | 117 | ||
118 | /*****THIS IS FOR STEP ONE FORM ******/ | 118 | /*****THIS IS FOR STEP ONE FORM ******/ |
119 | $scope.next = function() { | 119 | $scope.next = function() { |
120 | $scope.data.status = null | 120 | $scope.data.status = null |
121 | if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { | 121 | if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { |
122 | var x = document.getElementById("snackbar") | 122 | var x = document.getElementById("snackbar") |
123 | x.className = "show"; | 123 | x.className = "show"; |
124 | setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); | 124 | setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
125 | }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { | 125 | }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { |
126 | $scope.infoForm = true; | 126 | $scope.infoForm = true; |
127 | console.log("sdasdasdsa"); | 127 | console.log("sdasdasdsa"); |
128 | $scope.data.stage = $scope.data.stage; | 128 | $scope.data.stage = $scope.data.stage; |
129 | $scope.detail = {}; | 129 | $scope.detail = {}; |
130 | $scope.data.phone = "+91"+$scope.data.number; | 130 | $scope.data.phone = "+91"+$scope.data.number; |
131 | $http({ | 131 | $http({ |
132 | method: 'POST', | 132 | method: 'POST', |
133 | url: BASE_URL+'/information', | 133 | url: BASE_URL+'/information', |
134 | data: $scope.data, | 134 | data: $scope.data, |
135 | headers: {} | 135 | headers: {} |
136 | }).then(function mySuccess(result) { | 136 | }).then(function mySuccess(result) { |
137 | console.log("result",result) | 137 | console.log("result",result) |
138 | $scope.detail = result; | 138 | $scope.detail = result; |
139 | data.applicantId = result.data.id; | 139 | data.applicantId = result.data.id; |
140 | $scope.userId = result.data.id; | 140 | $scope.userId = result.data.id; |
141 | 141 | ||
142 | }, function myError(error) { | 142 | }, function myError(error) { |
143 | }); | 143 | }); |
144 | } | 144 | } |
145 | 145 | ||
146 | } | 146 | } |
147 | 147 | ||
148 | /*****THIS IS FOR STEP THREE FORM ******/ | 148 | /*****THIS IS FOR STEP THREE FORM ******/ |
149 | $scope.create = function() { | 149 | $scope.create = function() { |
150 | console.log("$scope.data.identity",$scope.data.identity) | 150 | console.log("$scope.data.identity",$scope.data.identity) |
151 | if($scope.data.stage == "Idea"){ | 151 | if($scope.data.stage == "Idea"){ |
152 | console.log("$scope.data",$scope.data) | 152 | console.log("$scope.data",$scope.data) |
153 | if($scope.data.identity == "student"){ | 153 | if($scope.data.identity == "student"){ |
154 | $scope.payingAmnt = 50000; | 154 | $scope.payingAmnt = 50000; |
155 | }else{ | 155 | }else{ |
156 | $scope.payingAmnt = 100000; | 156 | $scope.payingAmnt = 100000; |
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | if($scope.data.stage == "Product"){ | 160 | if($scope.data.stage == "Product"){ |
161 | if($scope.data.identity == "student"){ | 161 | if($scope.data.identity == "student"){ |
162 | $scope.payingAmnt = 100000; | 162 | $scope.payingAmnt = 100000; |
163 | }else{ | 163 | }else{ |
164 | $scope.payingAmnt = 200000; | 164 | $scope.payingAmnt = 200000; |
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
168 | if($scope.data.stage == "Growth"){ | 168 | if($scope.data.stage == "Growth"){ |
169 | if($scope.data.identity == "student"){ | 169 | if($scope.data.identity == "student"){ |
170 | $scope.payingAmnt = 250000; | 170 | $scope.payingAmnt = 250000; |
171 | }else{ | 171 | }else{ |
172 | $scope.payingAmnt = 500000; | 172 | $scope.payingAmnt = 500000; |
173 | } | 173 | } |
174 | } | 174 | } |
175 | 175 | ||
176 | 176 | ||
177 | if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 177 | if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
178 | var x = document.getElementById("snackbar") | 178 | var x = document.getElementById("snackbar") |
179 | x.className = "show"; | 179 | x.className = "show"; |
180 | setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); | 180 | setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
181 | }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 181 | }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
182 | 182 | ||
183 | 183 | ||
184 | if($scope.data.identity == "student"){ | 184 | if($scope.data.identity == "student"){ |
185 | 185 | ||
186 | 186 | ||
187 | var image = BASE_URL+'/container1s/proof/download/' | 187 | var image = BASE_URL+'/container1s/proof/download/' |
188 | console.log("image",image) | 188 | console.log("image",image) |
189 | var image = document.getElementById('picture').files[0]; | 189 | var image = document.getElementById('picture').files[0]; |
190 | var imagePath = image.name; | 190 | var imagePath = image.name; |
191 | $scope.NewIamge = image + imagePath; | 191 | $scope.NewIamge = image + imagePath; |
192 | $scope.data.pic = $scope.NewIamge; | 192 | $scope.data.pic = $scope.NewIamge; |
193 | var fd = new FormData() | 193 | var fd = new FormData() |
194 | fd.append('file',image); | 194 | fd.append('file',image); |
195 | $http({ | 195 | $http({ |
196 | method:'POST', | 196 | method:'POST', |
197 | url: BASE_URL+'/container1s/proof/upload', | 197 | url: BASE_URL+'/container1s/proof/upload', |
198 | data:fd, | 198 | data:fd, |
199 | transformRequest:angular.identity, | 199 | transformRequest:angular.identity, |
200 | headers:{'Content-Type':undefined} | 200 | headers:{'Content-Type':undefined} |
201 | }).then(function mySuccess(sucessResponse) { | 201 | }).then(function mySuccess(sucessResponse) { |
202 | 202 | ||
203 | 203 | ||
204 | }, function myError(error) { | 204 | }, function myError(error) { |
205 | }); | 205 | }); |
206 | 206 | ||
207 | } | 207 | } |
208 | 208 | ||
209 | $scope.infoForm = true; | 209 | $scope.infoForm = true; |
210 | console.log("sdasdasdsa"); | 210 | console.log("sdasdasdsa"); |
211 | $scope.data.stage = $scope.data.stage; | 211 | $scope.data.stage = $scope.data.stage; |
212 | $scope.detail = {}; | 212 | $scope.detail = {}; |
213 | $scope.data.phone = "+91"+$scope.data.number; | 213 | $scope.data.phone = "+91"+$scope.data.number; |
214 | $http({ | 214 | $http({ |
215 | method: 'POST', | 215 | method: 'POST', |
216 | url: BASE_URL+'/applicants', | 216 | url: BASE_URL+'/applicants', |
217 | data: $scope.data, | 217 | data: $scope.data, |
218 | headers: {} | 218 | headers: {} |
219 | }).then(function mySuccess(result) { | 219 | }).then(function mySuccess(result) { |
220 | 220 | ||
221 | console.log("=====result=====",result) | 221 | console.log("=====result=====",result) |
222 | $scope.detail = result; | 222 | $scope.detail = result; |
223 | data.applicantId = result.data.id; | 223 | data.applicantId = result.data.id; |
224 | $scope.userId = result.data.id; | 224 | $scope.userId = result.data.id; |
225 | console.log("=====data=====",data) | 225 | console.log("=====data=====",data) |
226 | data.amount = $scope.payingAmnt /100; | 226 | data.amount = $scope.payingAmnt /100; |
227 | if($scope.detail != null){ | 227 | if($scope.detail != null){ |
228 | $http({ | 228 | $http({ |
229 | method: 'POST', | 229 | method: 'POST', |
230 | url: BASE_URL+'/payments', | 230 | url: BASE_URL+'/payments', |
231 | data: data, | 231 | data: data, |
232 | headers: {} | 232 | headers: {} |
233 | }).then(function mySuccess(paymentResult) { | 233 | }).then(function mySuccess(paymentResult) { |
234 | $scope.paymentResult = paymentResult; | 234 | $scope.paymentResult = paymentResult; |
235 | }, function myError(error) { | 235 | }, function myError(error) { |
236 | }); | 236 | }); |
237 | } | 237 | } |
238 | var i = 0; | 238 | var i = 0; |
239 | var options = { | 239 | var options = { |
240 | "key": "rzp_test_YwHsVFiDIQ2WUQ", | 240 | "key": "rzp_test_YwHsVFiDIQ2WUQ", |
241 | "amount": $scope.payingAmnt, | 241 | "amount": $scope.payingAmnt, |
242 | 242 | ||
243 | "name": "Startup Jalsa", | 243 | "name": "Startup Jalsa", |
244 | "description":"amount", | 244 | "description":"amount", |
245 | "currency": "INR", | 245 | "currency": "INR", |
246 | "status": "done", | 246 | "status": "done", |
247 | 247 | ||
248 | "theme": { | 248 | "theme": { |
249 | "color": "#2196f3 ", | 249 | "color": "#2196f3 ", |
250 | "image_padding":"NO" | 250 | "image_padding":"NO" |
251 | }, | 251 | }, |
252 | "modal": { | 252 | "modal": { |
253 | "ondismiss": function(){ | 253 | "ondismiss": function(){ |
254 | } | 254 | } |
255 | }, | 255 | }, |
256 | "handler": function (response){ | 256 | "handler": function (response){ |
257 | createPayment(response); | 257 | createPayment(response); |
258 | } | 258 | } |
259 | }; | 259 | }; |
260 | var rzp1 = new Razorpay(options); | 260 | var rzp1 = new Razorpay(options); |
261 | rzp1.open(); | 261 | rzp1.open(); |
262 | $scope.paymentResponse = {}; | 262 | $scope.paymentResponse = {}; |
263 | function createPayment(response){ | 263 | function createPayment(response){ |
264 | $route.reload(); | 264 | $route.reload(); |
265 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 265 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
266 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 266 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
267 | $scope.paymentResponse.amount = data.amount; | 267 | $scope.paymentResponse.amount = data.amount; |
268 | $scope.paymentResponse.currency = "INR"; | 268 | $scope.paymentResponse.currency = "INR"; |
269 | $scope.paymentResponse.status = "captured"; | 269 | $scope.paymentResponse.status = "captured"; |
270 | $http({ | 270 | $http({ |
271 | method: 'PUT', | 271 | method: 'PUT', |
272 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | 272 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, |
273 | data: $scope.paymentResponse, | 273 | data: $scope.paymentResponse, |
274 | headers: {} | 274 | headers: {} |
275 | }).then(function mySuccess(searchResult) { | 275 | }).then(function mySuccess(searchResult) { |
276 | console.log("searchResult",searchResult) | 276 | console.log("searchResult",searchResult) |
277 | $scope.showToastr() | 277 | $scope.showToastr() |
278 | //toaster.success("Registration done successfully"); | 278 | //toaster.success("Registration done successfully"); |
279 | 279 | ||
280 | }, function myError(error) { | 280 | }, function myError(error) { |
281 | }); | 281 | }); |
282 | } | 282 | } |
283 | 283 | ||
284 | }, function myError(error) { | 284 | }, function myError(error) { |
285 | }); | 285 | }); |
286 | } | 286 | } |
287 | 287 | ||
288 | } | 288 | } |
289 | 289 | ||
290 | $scope.showToastr = function(){ | 290 | $scope.showToastr = function(){ |
291 | console.log("called toast") | 291 | console.log("called toast") |
292 | var x = document.getElementById("snacsskbar") | 292 | var x = document.getElementById("snacsskbar") |
293 | x.className = "show"; | 293 | x.className = "show"; |
294 | setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); | 294 | setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
295 | } | 295 | } |
296 | 296 | ||
297 | // $scope.lastpage = function(){ | 297 | // $scope.lastpage = function(){ |
298 | // console.log("sdasd"); | 298 | // console.log("sdasd"); |
299 | // $('.sectors-card').css('display', 'inherit'); | 299 | // $('.sectors-card').css('display', 'inherit'); |
300 | // $('.form-all').css('display', 'inherit'); | 300 | // $('.form-all').css('display', 'inherit'); |
301 | // $('.submit-button').css('display', 'inherit'); | 301 | // $('.submit-button').css('display', 'inherit'); |
302 | // } | 302 | // } |
303 | /*kk***This code for change data when click to chooses stages***/ | 303 | /*kk***This code for change data when click to chooses stages***/ |
304 | $scope.businessmodel = true; | 304 | $scope.businessmodel = true; |
305 | $scope.Idea =true; | 305 | $scope.Idea =true; |
306 | $scope.current = true; | 306 | $scope.current = true; |
307 | 307 | ||
308 | $scope.stage = function(stage){ | 308 | $scope.stage = function(stage){ |
309 | // $('.sectors-card').css('display', 'block'); | 309 | // $('.sectors-card').css('display', 'block'); |
310 | // $('.form-all').css('display', 'block'); | 310 | // $('.form-all').css('display', 'block'); |
311 | // $('.identity-shadow').css('display', 'block'); | 311 | // $('.identity-shadow').css('display', 'block'); |
312 | // $('.step-two-form').css('display', 'block'); | 312 | // $('.step-two-form').css('display', 'block'); |
313 | // $('.step-three-form').css('display', 'block'); | 313 | // $('.step-three-form').css('display', 'block'); |
314 | 314 | ||
315 | if (stage == 'Idea') { | 315 | if (stage == 'Idea') { |
316 | $scope.current = 10; | 316 | $scope.current = 10; |
317 | $scope.prototyp = false; | 317 | $scope.prototyp = false; |
318 | $scope.market = false; | 318 | $scope.market = false; |
319 | $scope.risks = false; | 319 | $scope.risks = false; |
320 | $scope.team = false; | 320 | $scope.team = false; |
321 | $scope.pitch = false; | 321 | $scope.pitch = false; |
322 | $scope.financials = false; | 322 | $scope.financials = false; |
323 | $scope.businessmodel = true; | 323 | $scope.businessmodel = true; |
324 | // for right content | 324 | // for right content |
325 | $scope.Idea =true; | 325 | $scope.Idea =true; |
326 | $scope.Product =false; | 326 | $scope.Product =false; |
327 | $scope.Growth =false; | 327 | $scope.Growth =false; |
328 | }else if(stage == 'Product') { | 328 | }else if(stage == 'Product') { |
329 | $scope.current = 10; | 329 | $scope.current = 10; |
330 | $scope.prototyp= true; | 330 | $scope.prototyp= true; |
331 | $scope.market = true; | 331 | $scope.market = true; |
332 | $scope.risks = true; | 332 | $scope.risks = true; |
333 | $scope.team = true; | 333 | $scope.team = true; |
334 | $scope.pitch = true; | 334 | $scope.pitch = true; |
335 | $scope.financials = true; | 335 | $scope.financials = true; |
336 | $scope.businessmodel = false; | 336 | $scope.businessmodel = false; |
337 | // for right content | 337 | // for right content |
338 | $scope.Idea =false; | 338 | $scope.Idea =false; |
339 | $scope.Product =true; | 339 | $scope.Product =true; |
340 | $scope.Growth =false; | 340 | $scope.Growth =false; |
341 | }else if(stage == 'Growth') { | 341 | }else if(stage == 'Growth') { |
342 | $scope.current = 10; | 342 | $scope.current = 10; |
343 | $scope.prototyp = true; | 343 | $scope.prototyp = true; |
344 | $scope.market = true; | 344 | $scope.market = true; |
345 | $scope.risks = true; | 345 | $scope.risks = true; |
346 | $scope.team = true; | 346 | $scope.team = true; |
347 | $scope.pitch = true; | 347 | $scope.pitch = true; |
348 | $scope.financials = true; | 348 | $scope.financials = true; |
349 | $scope.businessmodel = false; | 349 | $scope.businessmodel = false; |
350 | // for right content | 350 | // for right content |
351 | $scope.Idea =false; | 351 | $scope.Idea =false; |
352 | $scope.Product =false; | 352 | $scope.Product =false; |
353 | $scope.Growth =true; | 353 | $scope.Growth =true; |
354 | } | 354 | } |
355 | } | 355 | } |
356 | 356 | ||
357 | // $scope.sector = function(sector){ | 357 | // $scope.sector = function(sector){ |
358 | // if (sector == 'retail') { | 358 | // if (sector == 'retail') { |
359 | // $scope.current = true; | 359 | // $scope.current = true; |
360 | 360 | ||
361 | // }else if(sector == 'b2b commerce') { | 361 | // }else if(sector == 'b2b commerce') { |
362 | // $scope.current = true; | 362 | // $scope.current = true; |
363 | 363 | ||
364 | // }else if(sector == 'agritech') { | 364 | // }else if(sector == 'agritech') { |
365 | // $scope.current = true; | 365 | // $scope.current = true; |
366 | 366 | ||
367 | // }else if(sector == 'travel') { | 367 | // }else if(sector == 'travel') { |
368 | // $scope.current = true; | 368 | // $scope.current = true; |
369 | 369 | ||
370 | // }else if(sector == 'fintech') { | 370 | // }else if(sector == 'fintech') { |
371 | // $scope.current = true; | 371 | // $scope.current = true; |
372 | 372 | ||
373 | // }else if(sector == 'hyperlocal services') { | 373 | // }else if(sector == 'hyperlocal services') { |
374 | // $scope.current = true; | 374 | // $scope.current = true; |
375 | 375 | ||
376 | // }else if(sector == 'education') { | 376 | // }else if(sector == 'education') { |
377 | // $scope.current = true; | 377 | // $scope.current = true; |
378 | 378 | ||
379 | // }else if(sector == 'rural') { | 379 | // }else if(sector == 'rural') { |
380 | // $scope.current = true; | 380 | // $scope.current = true; |
381 | // } | 381 | // } |
382 | // } | 382 | // } |
383 | // $scope.sector = function(sector){ | 383 | // $scope.sector = function(sector){ |
384 | // if (sector == 'retail') { | 384 | // if (sector == 'retail') { |
385 | // $scope.current = true; | 385 | // $scope.current = true; |
386 | 386 | ||
387 | // }else if(sector == 'b2b commerce') { | 387 | // }else if(sector == 'b2b commerce') { |
388 | // $scope.current = true; | 388 | // $scope.current = true; |
389 | 389 | ||
390 | // }else if(sector == 'agritech') { | 390 | // }else if(sector == 'agritech') { |
391 | // $scope.current = true; | 391 | // $scope.current = true; |
392 | 392 | ||
393 | // }else if(sector == 'travel') { | 393 | // }else if(sector == 'travel') { |
394 | // $scope.current = true; | 394 | // $scope.current = true; |
395 | 395 | ||
396 | // }else if(sector == 'fintech') { | 396 | // }else if(sector == 'fintech') { |
397 | // $scope.current = true; | 397 | // $scope.current = true; |
398 | 398 | ||
399 | // }else if(sector == 'hyperlocal services') { | 399 | // }else if(sector == 'hyperlocal services') { |
400 | // $scope.current = true; | 400 | // $scope.current = true; |
401 | 401 | ||
402 | // }else if(sector == 'education') { | 402 | // }else if(sector == 'education') { |
403 | // $scope.current = true; | 403 | // $scope.current = true; |
404 | 404 | ||
405 | // }else if(sector == 'rural') { | 405 | // }else if(sector == 'rural') { |
406 | // $scope.current = true; | 406 | // $scope.current = true; |
407 | // } | 407 | // } |
408 | // } | 408 | // } |
409 | 409 | ||
410 | // $scope.entername = function(name){ | 410 | // $scope.entername = function(name){ |
411 | // if (name == undefined) { | 411 | // if (name == undefined) { |
412 | // $scope.current = false; | 412 | // $scope.current = false; |
413 | // }else if (name != undefined){ | 413 | // }else if (name != undefined){ |
414 | // $scope.current = true; | 414 | // $scope.current = true; |
415 | // } | 415 | // } |
416 | // } | 416 | // } |
417 | // $scope.enteremail = function(email){ | 417 | // $scope.enteremail = function(email){ |
418 | // if (email == undefined) { | 418 | // if (email == undefined) { |
419 | // $scope.current = false; | 419 | // $scope.current = false; |
420 | // }else if (email != undefined){ | 420 | // }else if (email != undefined){ |
421 | // $scope.current = true; | 421 | // $scope.current = true; |
422 | // } | 422 | // } |
423 | // } | 423 | // } |
424 | // $scope.enternumber = function(number){ | 424 | // $scope.enternumber = function(number){ |
425 | // if (name == undefined) { | 425 | // if (name == undefined) { |
426 | // $scope.current = false; | 426 | // $scope.current = false; |
427 | // }else if (name != undefined){ | 427 | // }else if (name != undefined){ |
428 | // $scope.current = true; | 428 | // $scope.current = true; |
429 | // } | 429 | // } |
430 | // } | 430 | // } |
431 | // $scope.selectcity = function(city){ | 431 | // $scope.selectcity = function(city){ |
432 | // console.log("city",city); | 432 | // console.log("city",city); |
433 | // if (name == undefined) { | 433 | // if (name == undefined) { |
434 | // $scope.current = false; | 434 | // $scope.current = false; |
435 | // }else if (name != undefined){ | 435 | // }else if (name != undefined){ |
436 | // $scope.current = true; | 436 | // $scope.current = true; |
437 | // } | 437 | // } |
438 | // } | 438 | // } |
439 | // $scope.entertechnology = function(technology){ | 439 | // $scope.entertechnology = function(technology){ |
440 | // console.log("technology",technology); | 440 | // console.log("technology",technology); |
441 | // if (name == undefined) { | 441 | // if (name == undefined) { |
442 | // $scope.current = false; | 442 | // $scope.current = false; |
443 | // }else if (name != undefined){ | 443 | // }else if (name != undefined){ |
444 | // $scope.current = true; | 444 | // $scope.current = true; |
445 | // } | 445 | // } |
446 | // } | 446 | // } |
447 | // $scope.enterproblem = function(problem){ | 447 | // $scope.enterproblem = function(problem){ |
448 | // console.log("problem",problem); | 448 | // console.log("problem",problem); |
449 | // if (name == undefined) { | 449 | // if (name == undefined) { |
450 | // $scope.current = false; | 450 | // $scope.current = false; |
451 | // }else if (name != undefined){ | 451 | // }else if (name != undefined){ |
452 | // $scope.current = true; | 452 | // $scope.current = true; |
453 | // } | 453 | // } |
454 | // } | 454 | // } |
455 | // $scope.entersolution = function(solution){ | 455 | // $scope.entersolution = function(solution){ |
456 | // console.log("solution",solution); | 456 | // console.log("solution",solution); |
457 | // if (name == undefined) { | 457 | // if (name == undefined) { |
458 | // $scope.current = false; | 458 | // $scope.current = false; |
459 | // }else if (name != undefined){ | 459 | // }else if (name != undefined){ |
460 | // $scope.current = true; | 460 | // $scope.current = true; |
461 | // } | 461 | // } |
462 | // } | 462 | // } |
463 | $scope.enterbusiness = function(business){ | 463 | $scope.enterbusiness = function(business){ |
464 | console.log("business",business); | 464 | console.log("business",business); |
465 | if (name == undefined) { | 465 | if (name == undefined) { |
466 | $scope.current = false; | 466 | $scope.current = false; |
467 | }else if (name != undefined){ | 467 | }else if (name != undefined){ |
468 | $scope.current = true; | 468 | $scope.current = true; |
469 | } | 469 | } |
470 | } | 470 | } |
471 | /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ | 471 | /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ |
472 | $scope.stagekeyPress = function(){ | 472 | $scope.stagekeyPress = function(){ |
473 | $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); | 473 | $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); |
474 | } | 474 | } |
475 | $scope.sectorkeyPress = function(){ | 475 | $scope.sectorkeyPress = function(){ |
476 | $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); | 476 | $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); |
477 | } | 477 | } |
478 | 478 | ||
479 | $scope.studentkeyPress = function(){ | 479 | $scope.studentkeyPress = function(){ |
480 | $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); | 480 | $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); |
481 | } | 481 | } |
482 | 482 | ||
483 | $scope.namekeyPress = function(name){ | 483 | $scope.namekeyPress = function(name){ |
484 | console.log("name",name); | 484 | console.log("name",name); |
485 | if (name == undefined) { | 485 | if (name == undefined) { |
486 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); | 486 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); |
487 | }else{ | 487 | }else{ |
488 | $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); | 488 | $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); |
489 | } | 489 | } |
490 | } | 490 | } |
491 | $scope.emailkeyPress = function(email){ | 491 | $scope.emailkeyPress = function(email){ |
492 | console.log("email",email); | 492 | console.log("email",email); |
493 | if (email == undefined) { | 493 | if (email == undefined) { |
494 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); | 494 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); |
495 | }else{ | 495 | }else{ |
496 | $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); | 496 | $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); |
497 | } | 497 | } |
498 | } | 498 | } |
499 | 499 | ||
500 | 500 | ||
501 | $scope.phonekeyPress = function(number){ | 501 | $scope.phonekeyPress = function(number){ |
502 | console.log("number",number); | 502 | console.log("number",number); |
503 | if (number == undefined) { | 503 | if (number == undefined) { |
504 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); | 504 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); |
505 | }else{ | 505 | }else{ |
506 | $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); | 506 | $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); |
507 | } | 507 | } |
508 | } | 508 | } |
509 | 509 | ||
510 | $scope.citykeyPress = function(city){ | 510 | $scope.citykeyPress = function(city){ |
511 | console.log("city",city); | 511 | console.log("city",city); |
512 | if (city == undefined) { | 512 | if (city == undefined) { |
513 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); | 513 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); |
514 | }else{ | 514 | }else{ |
515 | $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); | 515 | $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); |
516 | } | 516 | } |
517 | } | 517 | } |
518 | 518 | ||
519 | $scope.questionkeyPress = function(q){ | 519 | $scope.questionkeyPress = function(q){ |
520 | if (q == undefined) { | 520 | if (q == undefined) { |
521 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); | 521 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); |
522 | }else{ | 522 | }else{ |
523 | $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); | 523 | $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); |
524 | } | 524 | } |
525 | } | 525 | } |
526 | 526 | ||
527 | $scope.technologykeyPress = function(technology){ | 527 | $scope.technologykeyPress = function(technology){ |
528 | if (technology == undefined) { | 528 | if (technology == undefined) { |
529 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); | 529 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); |
530 | }else{ | 530 | }else{ |
531 | $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); | 531 | $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); |
532 | } | 532 | } |
533 | } | 533 | } |
534 | $scope.problemkeyPress = function(problem){ | 534 | $scope.problemkeyPress = function(problem){ |
535 | if (problem == undefined) { | 535 | if (problem == undefined) { |
536 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); | 536 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); |
537 | }else{ | 537 | }else{ |
538 | $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); | 538 | $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); |
539 | } | 539 | } |
540 | } | 540 | } |
541 | $scope.solutionkeyPress = function(solution){ | 541 | $scope.solutionkeyPress = function(solution){ |
542 | if (solution == undefined) { | 542 | if (solution == undefined) { |
543 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); | 543 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); |
544 | }else{ | 544 | }else{ |
545 | $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); | 545 | $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); |
546 | } | 546 | } |
547 | } | 547 | } |
548 | $scope.businesskeyPress = function(business){ | 548 | $scope.businesskeyPress = function(business){ |
549 | $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); | 549 | $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); |
550 | } | 550 | } |
551 | 551 | ||
552 | $scope.prototypekeyPress = function(prototype){ | 552 | $scope.prototypekeyPress = function(prototype){ |
553 | if (prototype == undefined) { | 553 | if (prototype == undefined) { |
554 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); | 554 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); |
555 | }else{ | 555 | }else{ |
556 | $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); | 556 | $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); |
557 | } | 557 | } |
558 | } | 558 | } |
559 | 559 | ||
560 | $scope.marketkeyPress = function(market){ | 560 | $scope.marketkeyPress = function(market){ |
561 | if (market == undefined) { | 561 | if (market == undefined) { |
562 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); | 562 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); |
563 | }else{ | 563 | }else{ |
564 | $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); | 564 | $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); |
565 | } | 565 | } |
566 | } | 566 | } |
567 | 567 | ||
568 | $scope.riskkeyPress = function(risk){ | 568 | $scope.riskkeyPress = function(risk){ |
569 | if (risk == undefined) { | 569 | if (risk == undefined) { |
570 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); | 570 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); |
571 | }else{ | 571 | }else{ |
572 | $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); | 572 | $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); |
573 | } | 573 | } |
574 | } | 574 | } |
575 | 575 | ||
576 | $scope.teamkeyPress = function(team){ | 576 | $scope.teamkeyPress = function(team){ |
577 | if (team == undefined) { | 577 | if (team == undefined) { |
578 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); | 578 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); |
579 | }else{ | 579 | }else{ |
580 | $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); | 580 | $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); |
581 | } | 581 | } |
582 | } | 582 | } |
583 | 583 | ||
584 | $scope.pitchkeyPress = function(pitch){ | 584 | $scope.pitchkeyPress = function(pitch){ |
585 | if (pitch == undefined) { | 585 | if (pitch == undefined) { |
586 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); | 586 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); |
587 | }else{ | 587 | }else{ |
588 | $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); | 588 | $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); |
589 | } | 589 | } |
590 | } | 590 | } |
591 | 591 | ||
592 | $scope.financialskeyPress = function(financial){ | 592 | $scope.financialskeyPress = function(financial){ |
593 | console.log("financial",financial); | 593 | console.log("financial",financial); |
594 | if (financial == undefined) { | 594 | if (financial == undefined) { |
595 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); | 595 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); |
596 | }else{ | 596 | }else{ |
597 | $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); | 597 | $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); |
598 | } | 598 | } |
599 | } | 599 | } |
600 | 600 | ||
601 | // create a message to display in our view | 601 | // create a message to display in our view |
602 | // $scope.message = 'Everyone come and see how good I look!'; | 602 | // $scope.message = 'Everyone come and see how good I look!'; |
603 | }); | 603 | }); |
604 | 604 | ||
605 | scotchApp.controller('verifyController', function($scope, $http, $location) { | 605 | scotchApp.controller('verifyController', function($scope, $http, $location) { |
606 | 606 | ||
607 | $scope.pendingPaymentId = $location.absUrl().split('=')[1] | 607 | $scope.pendingPaymentId = $location.absUrl().split('=')[1] |
608 | var BASE_URL = "http://0.0.0.0:4001/api"; | 608 | var BASE_URL = "http://139.59.68.74:4001/api"; |
609 | $http({ | 609 | $http({ |
610 | method : "GET", | 610 | method : "GET", |
611 | url : BASE_URL+'/applicants/'+$scope.pendingPaymentId, | 611 | url : BASE_URL+'/applicants/'+$scope.pendingPaymentId, |
612 | }).then(function mySuccess(response) { | 612 | }).then(function mySuccess(response) { |
613 | $scope.data = response.data; | 613 | $scope.data = response.data; |
614 | console.log("response-1",response); | 614 | console.log("response-1",response); |
615 | $scope.pendingPaymentId = $location.absUrl().split('=')[1] | 615 | $scope.pendingPaymentId = $location.absUrl().split('=')[1] |
616 | $http({ | 616 | $http({ |
617 | method : "GET", | 617 | method : "GET", |
618 | url : BASE_URL+'/payments?filter={"where":{"applicantId":'+$scope.pendingPaymentId+'}}', | 618 | url : BASE_URL+'/payments?filter={"where":{"applicantId":'+$scope.pendingPaymentId+'}}', |
619 | }).then(function mySuccess(response) { | 619 | }).then(function mySuccess(response) { |
620 | $scope.paymentRecord = response.data; | 620 | $scope.paymentRecord = response.data; |
621 | }, function myError(response) { | 621 | }, function myError(response) { |
622 | // $scope.paymentRecord = response.data; | 622 | // $scope.paymentRecord = response.data; |
623 | }); | 623 | }); |
624 | }, function myError(response) { | 624 | }, function myError(response) { |
625 | $scope.myWelcome = response.statusText; | 625 | $scope.myWelcome = response.statusText; |
626 | }); | 626 | }); |
627 | 627 | ||
628 | $scope.checkView = false; | 628 | $scope.checkView = false; |
629 | $scope.verifyView = false; | 629 | $scope.verifyView = false; |
630 | 630 | ||
631 | $scope.pendingPaymentId = ''; | 631 | $scope.pendingPaymentId = ''; |
632 | 632 | ||
633 | var BASE_URL = "http://0.0.0.0:4001/api"; | 633 | var BASE_URL = "http://139.59.68.74:4001/api"; |
634 | 634 | ||
635 | $scope.update = function(){ | 635 | $scope.update = function(){ |
636 | 636 | ||
637 | $http({ | 637 | $http({ |
638 | method: 'GET', | 638 | method: 'GET', |
639 | url: BASE_URL+'/payments?filter={"where":{"applicantId": '+$scope.pendingPaymentId+'}}', | 639 | url: BASE_URL+'/payments?filter={"where":{"applicantId": '+$scope.pendingPaymentId+'}}', |
640 | //data: email, | 640 | //data: email, |
641 | headers: {} | 641 | headers: {} |
642 | }).then(function mySuccess(searchResult) { | 642 | }).then(function mySuccess(searchResult) { |
643 | if(searchResult.data[0].status == "pending"){ | 643 | if(searchResult.data[0].status == "pending"){ |
644 | $scope.checkView = true; | 644 | $scope.checkView = true; |
645 | $scope.verifyView = false; | 645 | $scope.verifyView = false; |
646 | $scope.amount = searchResult.data[0].amount * 100; | 646 | $scope.amount = searchResult.data[0].amount * 100; |
647 | console.log('pending data', searchResult); | 647 | console.log('pending data', searchResult); |
648 | var i = 0; | 648 | var i = 0; |
649 | var options = { | 649 | var options = { |
650 | "key": "rzp_test_YwHsVFiDIQ2WUQ", | 650 | "key": "rzp_test_YwHsVFiDIQ2WUQ", |
651 | "amount": $scope.amount, | 651 | "amount": $scope.amount, |
652 | 652 | ||
653 | "name": "Startup Jalsa", | 653 | "name": "Startup Jalsa", |
654 | "description":"amount", | 654 | "description":"amount", |
655 | "currency": "INR", | 655 | "currency": "INR", |
656 | "status": "done", | 656 | "status": "done", |
657 | 657 | ||
658 | "theme": { | 658 | "theme": { |
659 | "color": "#2196f3 ", | 659 | "color": "#2196f3 ", |
660 | "image_padding":"NO" | 660 | "image_padding":"NO" |
661 | }, | 661 | }, |
662 | "modal": { | 662 | "modal": { |
663 | "ondismiss": function(){ | 663 | "ondismiss": function(){ |
664 | } | 664 | } |
665 | }, | 665 | }, |
666 | "handler": function (response){ | 666 | "handler": function (response){ |
667 | createPayment(response); | 667 | createPayment(response); |
668 | } | 668 | } |
669 | }; | 669 | }; |
670 | var rzp1 = new Razorpay(options); | 670 | var rzp1 = new Razorpay(options); |
671 | rzp1.open(); | 671 | rzp1.open(); |
672 | $scope.paymentResponse = {}; | 672 | $scope.paymentResponse = {}; |
673 | function createPayment(response){ | 673 | function createPayment(response){ |
674 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 674 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
675 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 675 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
676 | $scope.paymentResponse.amount = $scope.amount; | 676 | $scope.paymentResponse.amount = $scope.amount; |
677 | $scope.paymentResponse.currency = "INR"; | 677 | $scope.paymentResponse.currency = "INR"; |
678 | $scope.paymentResponse.status = "captured"; | 678 | $scope.paymentResponse.status = "captured"; |
679 | $scope.paymentResponse.applicantId = $scope.userId; | 679 | $scope.paymentResponse.applicantId = $scope.userId; |
680 | console.log("$scope.paymentResponse",$scope.paymentResponse) | 680 | console.log("$scope.paymentResponse",$scope.paymentResponse) |
681 | $http({ | 681 | $http({ |
682 | method: 'PUT', | 682 | method: 'PUT', |
683 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | 683 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, |
684 | data: $scope.paymentResponse, | 684 | data: $scope.paymentResponse, |
685 | headers: {} | 685 | headers: {} |
686 | }).then(function mySuccess(searchResult) { | 686 | }).then(function mySuccess(searchResult) { |
687 | 687 | ||
688 | }, function myError(error) { | 688 | }, function myError(error) { |
689 | 689 | ||
690 | }); | 690 | }); |
691 | } | 691 | } |
692 | }else{ | 692 | }else{ |
693 | 693 | ||
694 | } | 694 | } |
695 | 695 | ||
696 | }, function myError(error) { | 696 | }, function myError(error) { |
697 | }); | 697 | }); |
698 | } | 698 | } |
699 | }); | 699 | }); |
700 | 700 | ||
701 | // scotchApp.controller('contactController', function($scope) { | 701 | // scotchApp.controller('contactController', function($scope) { |
702 | // $scope.message = 'Contact us! JK. This is just a demo.'; | 702 | // $scope.message = 'Contact us! JK. This is just a demo.'; |
703 | // }); | 703 | // }); |
704 | 704 | ||
705 | 705 |