-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBillingReport.html
More file actions
46 lines (41 loc) · 1.5 KB
/
Copy pathBillingReport.html
File metadata and controls
46 lines (41 loc) · 1.5 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
<!DOCTYPE html>
<html>
<head>
<title>Get Billing Report</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
</head>
<body>
<button id="billingReportButton">Get Billing Report</button>
<div id="result"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<script>
var baseUrl = 'https://secure.petexec.net/api';
$('#billingReportButton').on('click', getBillingReport);
var token = ''; // Your token
var startDate = ''; // yyyy-mm-dd
var endDate = ''; // yyyy-mm-dd
var payType = ''; // All Types, Cash, Check, Credit, Clover Mini, Gift Certificate, No Payment, Paw Point Redemption, Refund, Tradeout, Unprocessed
var ownerPortal = ''; // yes, no
function getBillingReport(e) {
e.preventDefault();
$.ajax({
type : 'GET',
url : baseUrl + '/report/billing-report/' + startDate + '/' + endDate + '/' + payType + '/' + ownerPortal,
dataType : 'json',
headers : {
'Authorization' : 'Bearer ' + token
},
success : successCallback,
error : errorCallback
});
}
function successCallback(data, textStatus, jqXHR) {
$('#result').html(textStatus + '' + JSON.stringify(data));
}
function errorCallback(jqXHR, textStatus, errorThrown) {
$('#result').html(JSON.stringify(jqXHR.responseJSON));
}
</script>
</body>
</html>