forked from cloudappsetup/html5-dg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py
49 lines (44 loc) · 1.05 KB
/
index.py
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
print 'X-Frame-Options: GOFORIT'
print ''
print '''
<!-- INSERT SCRIPT INCLUDES INTO PAGE BODY -->
<script src="https://www.paypalobjects.com/js/external/dg.js"></script>
<script src="client/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="client/pptransact.js"></script>
<input type="button" onclick="bill()" value="Bill" />
<input type="button" onclick="verify()" value="Verify" />
<script>
//INITIALIZE SESSION WITH APPROPRIATE LANGUAGE
pptransact.init('py', true);
//CALL BILL FUNCTION TO INITIALIZE BILL
function bill(){
pptransact.bill({
userId:'888888',
itemId:'123',
itemQty:'1',
successCallback: function(data){
//bill success
console.log("success");
},
failCallback: function(data){
//bill cancelled
}
});
}
function verify(){
console.log('verify');
pptransact.verify({
userId:'888888',
itemId:'123',
successCallback: function(data){
console.log('verify success');
//verify success
},
failCallback: function(data){
console.log('verify failed')
//verify failed
}
});
}
</script>
'''