-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.html
64 lines (58 loc) · 2.26 KB
/
sample.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://mtf.gateway.mastercard.com/checkout/version/61/checkout.js"
data-error="errorCallback"
data-cancel="cancelCallback"
data-complete="completeCallback"></script>
<script type="text/javascript">
const params = new URLSearchParams(window.location.search)
var sessionId = params.get('sessionId')
var orderId = params.get('orderId')
var orderValue = params.get('amount')
var merchantName = params.get('merchantName')
var addressLine1 = params.get('addressLine1')
var addressLine2 = params.get('addressLine2')
function errorCallback(error) {
android.showToast('Error', JSON.stringify(error));
}
function cancelCallback() {
android.showToast('Cancel', 'Payment Cancelled');
}
function completeCallback(resultIndicator, sessionVersion) {
android.showToast(resultIndicator, sessionVersion);
}
Checkout.configure({
session: {
id: sessionId
},
merchant: merchantName,
order: {
amount: orderValue,
currency: 'MWK',
description: 'Load Money to BCN',
id: orderId
},
interaction: {
merchant: {
name: merchantName,
address: {
line1: addressLine1,
line2: addressLine2
}
},
displayControl: {
billingAddress : 'HIDE',
customerEmail : 'HIDE',
orderSummary : 'SHOW',
shipping : 'HIDE'
}
}
});
</script>
</head>
<body>
<input type="button" value="Pay with Lightbox" onclick="Checkout.showLightbox();" />
<input type="button" value="Pay with Payment Page" onclick="Checkout.showPaymentPage();" />
</body>
</html>