我试图执行一个HPP充分重定向realex付款,我有2个控制器的一个该请求发送到所述realex付款服务器和所述第二到的响应被发送回。 我得到这样的JSON响应
{"RESULT":"00","AUTHCODE":"12345","MESSAGE":"[ test system ] AUTHORISED","PASREF":"15441812060166886","AVSPOSTCODERESULT":"M","AVSADDRESSRESULT":"M","CVNRESULT":"M","ACCOUNT":"internet","MERCHANT_ID":"MyID","ORDER_ID":"UYCRWpJtlE-B1n62SE7EKg","TIMESTAMP":"20181207111253","AMOUNT":"199","MERCHANT_RESPONSE_URL":"URL to my webcontroller","pas_uuid":"b3cfa79e-2b60-4f2a-9dad-cfa897f17189","SHA1HASH":"c193e099da587b28810775f388d15c2f88fd637c","BATCHID":"601099"}
有问题的IM是这样的JSON显示在页面下面的网址。 https://pay.sandbox.realexpayments.com/card.html?guid=b3cfa79e-2b60-4f2a-9dad-cfa897f17189
但我想提取此JSON订单ID和交易ID和金额,并在某种显示它形式在了公司页面,告知有支付作为了全成或谢绝基于结果的用户。
客户端代码调用它:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>My Title</title>
<!-- reference to your css file below. You can also use a separate css from your desktop more at https://developer.realexpayments.com/#!/hpp/customisation-->
<link rel="stylesheet" type="text/css" href="resources/css/styles.css">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="rxp-js-master/lib/rxp-hpp.js"></script>
<script>
$(document).ready(function() {
$.getJSON("URL to my first controller", function(jsonFromRequestEndpoint) {
///alert(jsonFromRequestEndpoint);
RealexHpp.setHppUrl("https://pay.sandbox.realexpayments.com/pay");
// When using full page redirect your Response URL must be an absolute link
RealexHpp.redirect.init("payButtonId", "URL to my second controller", jsonFromRequestEndpoint);
const URL = "https://development.eurowatchcentral.com"
const data = jsonFromRequestEndpoint;
$.post(URL, data, function(data, status){
console.log ('${data} and status is ${status}')
});
});
});
</script>
</head>
<body>
<!-- The tag <hpp:body /> below indicates where the payment form will be placed - for all guidelines on templates please visit https://developer.realexpayments.com/#!/hpp/customisation-->
<div>
<form >
<button type="button" value="payButtonId" id ="payButtonId">Click Me!</button>
</div>
<p id="demo"></p>
</form>
</body>
</html>
我试图寻找在API中的任何相关步骤,但我在努力寻找任何。