-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
150 lines (143 loc) · 6.44 KB
/
index.html
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- PAGE settings -->
<link rel="icon" href="https://app.attestr.com/images/favicon_symbol.png">
<title>Attestr FlowX Sample Webapp</title>
<meta name="description" content="Sample webapp to demonstrate Attestr FlowX">
<meta name="keywords" content="Attestr FlowX">
<meta name="author" content="Attestr">
<!-- CSS dependencies -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
type="text/css">
<link rel="stylesheet" href="style.css">
<script src="https://cdn.attestr.com/flowx.js"></script>
</head>
<body class="text-center bg-dark">
<nav class="navbar navbar-expand-md navbar-dark bg-primary">
<div class="container"> <a class="navbar-brand" href="#">
<img class="img-fluid d-block" src="https://app.attestr.com/images/team_logo.png" width="120"></a> <button
class="navbar-toggler navbar-toggler-right border-0" type="button" data-toggle="collapse"
data-target="#navbar10" style="">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar10">
<ul class="navbar-nav ml-auto">
<li class="nav-item"> <a class="nav-link text-decoration-none active" href="https://www.attestr.com"
target="_blank">Site</a> </li>
<li class="nav-item"> <a class="nav-link text-decoration-none active" href="https://docs.attestr.com"
target="_blank">Documentation</a> </li>
</ul> <a class="btn navbar-btn ml-md-2 text-decoration-none active bg-white text-primary"
href="https://attestr.com/contact-us/" target="_blank">Contact us</a>
</div>
</div>
</nav>
<div class="d-flex flex-column text-dark mt-0 p-3 pt-5 bg-white">
<div class="container">
<div class="row">
<div class="col-md-8 mx-auto">
<h1 class="cover-heading mt-3 mb-3"><b>Attestr FlowX Sample Webapp</b></h1>
</div>
</div>
</div>
</div>
<div class="bg-white d-none" id="success">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="alert alert-success" role="alert">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4 class="alert-heading">Success</h4>
<p class="lead" id="successRes">Success Message</p>
</div>
</div>
</div>
</div>
</div>
<div class="bg-white d-none" id="error">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger p-3" role="alert">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4 class="alert-heading">Error</h4>
<p class="lead" id="errorRes">Error Message</p>
</div>
</div>
</div>
</div>
</div>
<div class="py-3 text-center bg-white h-100">
<div class="container">
<div class="row border border-light">
<div class="mx-auto p-4 col-lg-7">
<p class="lead text-center"><br></p>
<div class="form-row">
<div class="form-group col-md-12"> <label for="form27" class="font-weight-normal pull-left text-dark">Enter
Handshake Id</label><input type="text" class="form-control text-primary bg-secondary" id="form27"
placeholder="Enter Handshake" required="required" name="Handshake"> </div>
<div class="form-group col-md-12"> <label for="form28" class="font-weight-normal pull-left text-dark">Enter
Client Key</label><input type="text" class="form-control text-primary bg-secondary" id="form28"
placeholder="Enter Client Key" name="ClientKey" required="required" style=""> </div>
<div class="form-group col-md-12"> <label for="form29" class="font-weight-normal pull-left text-dark">Retry
Mode</label><select class="form-control text-primary bg-secondary" id="form29"
placeholder="Select if retry" name="retry" required="required" style="">
<option value="true">True</option>
<option value="false">False</option>
</select> </div>
</div>
<button type="button" class="btn btn-primary mt-3" onclick="initiateSession();">Initiate Session</button>
</div>
</div>
</div>
</div>
<script style="">
function initiateSession(e) {
if (document.getElementById("errorRes")) {
document.getElementById("errorRes").innerHTML = "";
}
if (document.getElementById("successRes")) {
document.getElementById("successRes").innerHTML = "";
}
document.getElementById("success").classList.add('d-none');
document.getElementById("error").classList.add('d-none');
var flowx = new AttestrFlowx({
onFlowxError: function (data) {
document.getElementById("error").classList.remove('d-none');
if (document.getElementById("errorRes")) {
document.getElementById("errorRes").innerHTML = JSON.parse(data).message;
}
},
onFlowxComplete: function (data) {
document.getElementById("success").classList.remove('d-none');
if (document.getElementById("successRes")) {
document.getElementById("successRes").innerHTML = JSON.parse(data).signature;
}
},
onFlowxSkip: function (data) {
alert("You have skipped the flow");
},
cl: document.getElementById("form28").value,
hs: document.getElementById("form27").value,
lc: "en",
qr: {
a: "b"
},
retry: document.getElementById("form29").value === 'true'
});
flowx.launch();
}
</script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"
style=""></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"
style=""></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"
style=""></script>
</body>
</html>