-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomated-new-tab.html
81 lines (76 loc) · 2.7 KB
/
automated-new-tab.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<script type="text/javascript" src="./utilities.js"></script>
</head>
<style>
iframe {
border: none;
height: 70vh;
width: 90vw;
max-width: 40em;
}
input:not([type=checkbox]),
select {
display: block;
}
</style>
<script>
let authorization
window.addEventListener('DOMContentLoaded', (event) => {
initialize()
});
function submit() {
authorization = {
"number": generateUnique(), // "Should be your unique authorization number"
"amount": Number(document.getElementById("amount").value),
"currency": document.getElementById("currency").value,
capture: document.getElementById("auto-capture").checked ? "auto" : undefined,
"card": {
"pan": document.getElementById("pan").value,
"expires": [
Number(document.getElementById("expires").value.split("/")[0]),
Number(document.getElementById("expires").value.split("/")[1])
],
"csc": document.getElementById("csc").value,
},
target: "https://merchant.igacq.com/v1/integration-example",
}
authorize()
}
async function authorize() {
const form = document.getElementById("iframePost")
form.input.value = JSON.stringify(authorization)
form.key.value = "Bearer " + document.getElementById("api-key").value.trim()
form.submit()
}
</script>
<body style="width: 100%; max-width: 20em; margin-left: auto; margin-right: auto;">
<form method="post" id="iframePost" action="https://merchant.intergiro.com/v1/authorization/redirect"
target="_blank">
<input type="hidden" id="input" name="input"></input>
<input type="hidden" id="key" name="key"></input>
</form>
<form method="post">
<label for="key">Public API key</label>
<input type="text" id="api-key" name="key" />
<label for="pan">PAN</label>
<input type="text" id="pan" name="pan" autocomplete="cc-number" value="4111111111111111" />
<label for="csc" autocomplete="cc-csc">CSC</label>
<input type="text" id="csc" name="csc" value="987" />
<label for="expires">Expires</label>
<input type="text" id="expires" name="expires" autocomplete="cc-exp" placeholder="MM/YY" value="1/32" />
<input type="checkbox" id="auto-capture" name="auto-capture" checked />
<label for="auto-capture">Auto Capture</label><br />
<label for="currency">Currency</label>
<input type="text" id="currency" name="currency" autocomplete="transaction-currency" value="EUR" />
<label for="amount">Amount</label>
<input type="text" id="amount" name="amount" autocomplete="transaction-amount" value="250" />
</form>
<button onclick="submit()">Submit</button>
</body>
</html>