Blame view

src/app/components/authentication/authentication.controller.js 2.4 KB
66ee5529f   Palak Handa   initial commit
1
2
3
4
5
6
7
  (function(){
  	'use strict';
  
  		angular.module('sbAdminApp')
  			.controller('LoginCtrl', ['$scope', '$rootScope', '$state','$mdDialog','$log', 'AUTH_EVENTS', 'LoginService', 'toaster', loginCtrl]);
  
  		function loginCtrl($scope, $rootScope, $state, $mdDialog,$log, AUTH_EVENTS, LoginService ,toaster) {
3459bcf48   Palak Handa   modify new module
8
  			$scope.data={}
fc9af94cb   Palak Handa   modify module
9
  			var checkData=0;
3459bcf48   Palak Handa   modify new module
10
11
12
  			$scope.create = function() {
  				LoginService.createForm().save($scope.data).$promise.then(function(result) {
  					if(result != null){
fc9af94cb   Palak Handa   modify module
13
  						toaster.success("Registration done successfully");
3459bcf48   Palak Handa   modify new module
14
  					}
66ee5529f   Palak Handa   initial commit
15

fc9af94cb   Palak Handa   modify module
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
  						if(checkData != 0){
  							$mdToast.show(
  							$mdToast.simple()
  							.textContent('Please verify your form again')
  							.position($scope.getToastPosition())
  							.hideDelay(3000)
  							);
  							checkData++;
  						}else{
  							
  							var i = 0;
  							var applicationFees = 100;
  							$scope.applicationFees = applicationFees*100;
  							var options = {
  					           "key": "rzp_test_TxoEstU3hr7Ltw",
  					           "amount": $scope.applicationFees,
  					           "currency": "INR",
  					           "status": "done",
  					         
    
  					           "theme": {
  					               "color": "#2196f3 ",
  					               "image_padding":"NO"
  					           },
  					           "modal": {
  					               "ondismiss": function(){
  					                 console.log("===ondismiss====");
  					               }
  					           },
  					           "handler": function (response){
  					             console.log("response===",response)
  					             createPayment(response)
  					           }
  					       };
  					       var rzp1 = new Razorpay(options);
  					       rzp1.open();
  							
  							function createPayment(response){
  								// var date= new Date();
  								// $scope.registration.paymentId = response.razorpay_payment_id;
  								// $scope.registration.paymentDate = date.toISOString();
  								// $scope.registration.amount = $scope.registrationFees/100;
  								// $scope.registration.paymentType = "registration fees";
  								// var setDate = $scope.registrationDate.setMonth($scope.registrationDate.getMonth());
  								// var registrationDate = new Date(setDate).getMonth() + 1;
  								// $scope.registration.dob = $scope.registrationDate.getFullYear() +"-"+ registrationDate +"-"+$scope.registrationDate.getDate();
  								
  								console.log("$scope.registration",$scope.registration);
  								
  								
  							}
  						}
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  					// }
  				})		
  			}	
3459bcf48   Palak Handa   modify new module
85
86
  			
  	}
66ee5529f   Palak Handa   initial commit
87
  })();