-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.html
More file actions
39 lines (36 loc) · 1.08 KB
/
example.html
File metadata and controls
39 lines (36 loc) · 1.08 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
<!DOCTYPE html>
<title>Qoncrete js client sdk</title>
<script src="qoncrete.min.js"></script>
<script>
var qsdk = new Qoncrete({
sourceID: 'SOURCE_ID',
apiToken: 'API_TOKEN',
secureTransport: false // Send trough HTTPS. Can be: true | false | 'auto'. Default: 'auto'
});
qsdk.send({ "user": "name", "action": "purchase", "price": 99.99 })
.onError(function(error) {
console.log('Error, error code:', error.code, 'details:', error.message);
})
.onSuccess(function() {
console.log('success');
})
.done();
qsdk.send(
{ "user": "name", "action": "purchase", "price": 99.99 },
null,
function(error) {
if (error)
return console.log('Error, error code:', error.code, 'details:', error.message);
console.log('success');
}
);
qsdk.send(
{ "user": "name", "action": "purchase", "price": 99.99 },
{ retryOnTimeout: 2, timeoutAfter: 3000 },
function(error) {
if (error)
return console.log('Error, error code:', error.code, 'details:', error.message);
console.log('success');
}
);
</script>