Repository navigation
Expand file tree
/
Copy pathconnected.html
More file actions
60 lines (56 loc) · 1.97 KB
/
Copy pathconnected.html
File metadata and controls
60 lines (56 loc) · 1.97 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
{% load static %}
<html>
<head>
<title>OAuth2 Sample App - Intuit</title>
<link rel="stylesheet" type="text/css" href="{% static "style.css" %}">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
if (window.opener) {
window.opener.location.href = '/app/connected'
window.close()
}
</script>
<script>
function apiCall() {
$("#result").html('Loading...')
$.get("/app/qbo_request", function (data) {
$("#result").html(data)
})
}
function revokeCall() {
$("#result").html('Loading...')
$.get("/app/revoke", function (data) {
$("#result").html(data)
})
}
function refreshCall() {
$("#result").html('Loading...')
$.get("/app/refresh", function (data) {
$("#result").html(JSON.stringify(data, null, 2))
})
}
function userInfoCall() {
$("#result").html('Loading...')
$.get("/app/user_info", function (data) {
$("#result").html(data)
})
}
</script>
</head>
<body>
<a href="/app/">Home</a>
<h3>Connected!</h3>
<p>Would you like to make a sample API call?</p>
<div>
{% if openid %}
<button onclick="userInfoCall()">UserInfo API Call</button>
{% else %}
<button onclick="apiCall()">QuickBooks API Call</button>
{% endif %}
<button onclick="refreshCall()">Refresh Token Call</button>
<button onclick="revokeCall()">Revoke Token Call</button>
<br><br>
<div><code id="result"></code></div>
</div>
</body>
</html>