-
Notifications
You must be signed in to change notification settings - Fork 70
/
process-a-payment-lightbox.html
41 lines (39 loc) · 1.52 KB
/
process-a-payment-lightbox.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
<!DOCTYPE html>
<html>
<head>
<title>HPP Lightbox Demo</title>
<meta charset="UTF-8">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="./../../dist/rxp-js.js"></script>
<script src="./helper.js"></script>
<script>
RealexHpp.setHppUrl('https://pay.sandbox.realexpayments.com/pay');
// Enable the logger. Should be used for debugging only.
RealexHpp.setConfigItem('enableLogging', true);
window.addEventListener(RealexHpp.constants.logEventName, function(e) {
console.log(e.detail);
});
// get the HPP JSON from the server-side SDK
$(document).ready(function () {
$.getJSON("./proxy-request.php?slug=process-a-payment", function (jsonFromServerSdk) {
RealexHpp.lightbox.init(
"payButtonId",
"./response.php", // merchant url
jsonFromServerSdk //form data
);
$('body').addClass('loaded');
});
});
</script>
</head>
<body>
<div class="method">
<label for="paymentMethod">Payment Method: </label>
<select name="paymentMethod" id="paymentMethod">
<option value="https://pay.sandbox.realexpayments.com/pay">Ecommerce</option>
<option value="https://apis.sandbox.globalpay.com/ucp/hpp/transactions">Unified Payments</option>
</select>
</div>
<input type="submit" id="payButtonId" value="Checkout Now" />
</body>
</html>