-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
43 lines (39 loc) · 978 Bytes
/
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
<!-- 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('php');
//CALL BILL FUNCTION TO INITIALIZE BILL
function bill(){
pptransact.bill({
userId:'888888',
itemId:'123',
itemQty:'1',
successCallback: function(data){
//bill 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>