authentication.controller.js
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
85
86
87
88
(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) {
$scope.data={}
var checkData=0;
$scope.create = function() {
LoginService.createForm().save($scope.data).$promise.then(function(result) {
if(result != null){
toaster.success("Registration done successfully");
}
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);
}
}
// }
})
}
}
})();