Commit d122fec29cd021a6d7981e3e933236567755ea7e
1 parent
f221aecf6c
Exists in
master
and in
1 other branch
modify
Showing
1 changed file
with
119 additions
and
120 deletions
Show diff stats
script.js
... | ... | @@ -247,126 +247,125 @@ |
247 | 247 | console.log("result", result) |
248 | 248 | $scope.detail = result; |
249 | 249 | data.applicantId = result.data.id; |
250 | - $scope.userId = result.data.id; | |
251 | - | |
252 | - }, function myError(error) {}); | |
253 | - } | |
254 | - | |
255 | - if ($scope.data.stage == "Idea") { | |
256 | - console.log("$scope.data", $scope.data) | |
257 | - $scope.ticketAmnt = 500; | |
258 | - } | |
259 | - | |
260 | - if ($scope.data.stage == "Product") { | |
261 | - $scope.ticketAmnt = 1000; | |
262 | - } | |
263 | - | |
264 | - if ($scope.data.stage == "Growth") { | |
265 | - $scope.ticketAmnt = 1000; | |
266 | - } | |
267 | - var amount = $scope.ticketAmnt * 100 | |
268 | - if($scope.tokencheck == true){ | |
269 | - var amount = $scope.ticketAmnt | |
270 | - // $scope.discountAmount = (amount * 10)/100 | |
271 | - console.log("finalAmount====>",$scope.payingAmnt) | |
272 | - } | |
273 | - | |
274 | - var taxAmount = $scope.ticketAmnt | |
275 | - // $scope.taxTotal = (taxAmount * 18)/100 | |
276 | - $scope.payingAmnt = taxAmount | |
277 | - console.log("taxincludedamount----", $scope.payingAmnt) | |
278 | - // } | |
279 | - | |
280 | - /*****THIS IS FOR STEP THREE FORM ******/ | |
281 | - // $scope.create = function() { | |
282 | - // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | |
283 | - // var x = document.getElementById("snackbar") | |
284 | - // x.className = "show"; | |
285 | - // setTimeout(function() { | |
286 | - // x.className = x.className.replace("show", ""); | |
287 | - // }, 3000); | |
288 | - // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | |
289 | - // $scope.infoForm = true; | |
290 | - // console.log("sdasdasdsa"); | |
291 | - // $scope.data.stage = $scope.data.stage; | |
292 | - // $scope.detail = {}; | |
293 | - // $scope.data.phone = "+91" + $scope.data.number; | |
294 | - // $http({ | |
295 | - // method: 'POST', | |
296 | - // url: BASE_URL + '/applicants', | |
297 | - // data: $scope.data, | |
298 | - // headers: {} | |
299 | - // }).then(function mySuccess(result) { | |
300 | - | |
301 | - // console.log("=====result=====", result) | |
302 | - // $scope.detail = result; | |
303 | - // data.applicantId = result.data.id; | |
304 | - // $scope.userId = result.data.id; | |
305 | - // console.log("=====data=====", data) | |
306 | - data.amount = $scope.payingAmnt; | |
307 | - if ($scope.detail != null) { | |
308 | - $http({ | |
309 | - method: 'POST', | |
310 | - url: BASE_URL + '/payments', | |
311 | - data: data, | |
312 | - headers: {} | |
313 | - }).then(function mySuccess(paymentResult) { | |
314 | - Analytics.trackEvent('payments', 'click', 'django.mp4'); | |
315 | - console.log("paymentResult",paymentResult) | |
316 | - $scope.paymentResult = paymentResult; | |
317 | - }, function myError(error) {}); | |
318 | - } | |
319 | - var i = 0; | |
320 | - $scope.payingAmnt = $scope.payingAmnt * 100; | |
321 | - var options = { | |
322 | - "key": "rzp_live_mhSE1uOBlXvFyJ", | |
323 | - "amount": $scope.payingAmnt, | |
324 | - | |
325 | - "name": "Startup Jalsa", | |
326 | - "description": "amount", | |
327 | - "currency": "INR", | |
328 | - "status": "done", | |
329 | - | |
330 | - "theme": { | |
331 | - "color": "#2196f3 ", | |
332 | - "image_padding": "NO" | |
333 | - }, | |
334 | - "modal": { | |
335 | - "ondismiss": function() {} | |
336 | - }, | |
337 | - "handler": function(response) { | |
338 | - createPayment(response); | |
339 | - } | |
340 | - }; | |
341 | - var rzp1 = new Razorpay(options); | |
342 | - rzp1.open(); | |
343 | - $scope.paymentResponse = {}; | |
344 | - | |
345 | - function createPayment(response) { | |
346 | - Analytics.trackEvent('payments', 'click', 'django.mp4'); | |
347 | - console.log("response====from===razorpay",response) | |
348 | - $route.reload(); | |
349 | - $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | |
350 | - $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | |
351 | - $scope.paymentResponse.amount = data.amount; | |
352 | - $scope.paymentResponse.currency = "INR"; | |
353 | - $scope.paymentResponse.status = $scope.paymentResult.data.status; | |
354 | - $http({ | |
355 | - method: 'PUT', | |
356 | - url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, | |
357 | - data: $scope.paymentResponse, | |
358 | - headers: {} | |
359 | - }).then(function mySuccess(searchResult) { | |
360 | - Analytics.trackEvent('payments', 'click', 'django.mp4'); | |
361 | - console.log("searchResult", searchResult) | |
362 | - $location.path("/confirmation") | |
363 | - //$scope.showToastr() | |
364 | - //toaster.success("Registration done successfully"); | |
365 | - | |
366 | - }, function myError(error) {}); | |
367 | - } | |
368 | - | |
369 | - } | |
250 | + //$scope.userId = result.data.id; | |
251 | + | |
252 | + if ($scope.data.stage == "Idea") { | |
253 | + console.log("$scope.data", $scope.data) | |
254 | + $scope.ticketAmnt = 500; | |
255 | + } | |
256 | + | |
257 | + if ($scope.data.stage == "Product") { | |
258 | + $scope.ticketAmnt = 1000; | |
259 | + } | |
260 | + | |
261 | + if ($scope.data.stage == "Growth") { | |
262 | + $scope.ticketAmnt = 1000; | |
263 | + } | |
264 | + var amount = $scope.ticketAmnt * 100 | |
265 | + if($scope.tokencheck == true){ | |
266 | + var amount = $scope.ticketAmnt | |
267 | + // $scope.discountAmount = (amount * 10)/100 | |
268 | + console.log("finalAmount====>",$scope.payingAmnt) | |
269 | + } | |
270 | + | |
271 | + var taxAmount = $scope.ticketAmnt | |
272 | + // $scope.taxTotal = (taxAmount * 18)/100 | |
273 | + $scope.payingAmnt = taxAmount | |
274 | + console.log("taxincludedamount----", $scope.payingAmnt) | |
275 | + // } | |
276 | + | |
277 | + /*****THIS IS FOR STEP THREE FORM ******/ | |
278 | + // $scope.create = function() { | |
279 | + // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | |
280 | + // var x = document.getElementById("snackbar") | |
281 | + // x.className = "show"; | |
282 | + // setTimeout(function() { | |
283 | + // x.className = x.className.replace("show", ""); | |
284 | + // }, 3000); | |
285 | + // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | |
286 | + // $scope.infoForm = true; | |
287 | + // console.log("sdasdasdsa"); | |
288 | + // $scope.data.stage = $scope.data.stage; | |
289 | + // $scope.detail = {}; | |
290 | + // $scope.data.phone = "+91" + $scope.data.number; | |
291 | + // $http({ | |
292 | + // method: 'POST', | |
293 | + // url: BASE_URL + '/applicants', | |
294 | + // data: $scope.data, | |
295 | + // headers: {} | |
296 | + // }).then(function mySuccess(result) { | |
297 | + | |
298 | + // console.log("=====result=====", result) | |
299 | + // $scope.detail = result; | |
300 | + // data.applicantId = result.data.id; | |
301 | + // $scope.userId = result.data.id; | |
302 | + // console.log("=====data=====", data) | |
303 | + data.amount = $scope.payingAmnt; | |
304 | + if ($scope.detail != null) { | |
305 | + $http({ | |
306 | + method: 'POST', | |
307 | + url: BASE_URL + '/payments', | |
308 | + data: data, | |
309 | + headers: {} | |
310 | + }).then(function mySuccess(paymentResult) { | |
311 | + Analytics.trackEvent('payments', 'click', 'django.mp4'); | |
312 | + console.log("paymentResult",paymentResult) | |
313 | + $scope.paymentResult = paymentResult; | |
314 | + }, function myError(error) {}); | |
315 | + } | |
316 | + var i = 0; | |
317 | + $scope.payingAmnt = $scope.payingAmnt * 100; | |
318 | + var options = { | |
319 | + "key": "rzp_live_mhSE1uOBlXvFyJ", | |
320 | + "amount": $scope.payingAmnt, | |
321 | + | |
322 | + "name": "Startup Jalsa", | |
323 | + "description": "amount", | |
324 | + "currency": "INR", | |
325 | + "status": "done", | |
326 | + | |
327 | + "theme": { | |
328 | + "color": "#2196f3 ", | |
329 | + "image_padding": "NO" | |
330 | + }, | |
331 | + "modal": { | |
332 | + "ondismiss": function() {} | |
333 | + }, | |
334 | + "handler": function(response) { | |
335 | + createPayment(response); | |
336 | + } | |
337 | + }; | |
338 | + var rzp1 = new Razorpay(options); | |
339 | + rzp1.open(); | |
340 | + $scope.paymentResponse = {}; | |
341 | + | |
342 | + function createPayment(response) { | |
343 | + Analytics.trackEvent('payments', 'click', 'django.mp4'); | |
344 | + console.log("response====from===razorpay",response) | |
345 | + $route.reload(); | |
346 | + $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | |
347 | + $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | |
348 | + $scope.paymentResponse.amount = data.amount; | |
349 | + $scope.paymentResponse.currency = "INR"; | |
350 | + $scope.paymentResponse.status = $scope.paymentResult.data.status; | |
351 | + $http({ | |
352 | + method: 'PUT', | |
353 | + url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, | |
354 | + data: $scope.paymentResponse, | |
355 | + headers: {} | |
356 | + }).then(function mySuccess(searchResult) { | |
357 | + Analytics.trackEvent('payments', 'click', 'django.mp4'); | |
358 | + console.log("searchResult", searchResult) | |
359 | + $location.path("/confirmation") | |
360 | + //$scope.showToastr() | |
361 | + //toaster.success("Registration done successfully"); | |
362 | + | |
363 | + }, function myError(error) {}); | |
364 | + } | |
365 | + }, function myError(error) {}); | |
366 | + } | |
367 | + | |
368 | + } | |
370 | 369 | |
371 | 370 | //}, function myError(error) {}); |
372 | 371 | //} | ... | ... |