forked from globalpayments/rxp-js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprocess-a-payment-embedded.html
34 lines (34 loc) · 1.17 KB
/
process-a-payment-embedded.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
<!DOCTYPE html>
<html>
<head>
<title>HPP embed Demo</title>
<meta charset="UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="/dist/rxp-js.js"></script>
<script>
RealexHpp.setHppUrl('https://pay.sandbox.realexpayments.com/pay');
// get the HPP JSON from the server-side SDK
$(document).ready(function () {
$.getJSON("/examples/hpp/proxy-request.php?slug=process-a-payment", function (jsonFromServerSdk) {
RealexHpp.embedded.init(
"payButtonId",
"targetIframe",
"/examples/hpp/response.php", // merchant url
jsonFromServerSdk, // form data
{ // options
onResize:function(data){
$('#targetIframe').css(data)
}
}
);
$('body').addClass('loaded');
});
});
</script>
</head>
<body>
<input type="submit" id="payButtonId" value="Checkout Now" />
<br />
<iframe id="targetIframe" style="display:none;"></iframe>
</body>
</html>