问题描述
我通过 Hosted Payment Page
设置付款处理。我正在使用完整重定向并确保在 redirect.init
方法 (http://WEBSITE/response.PHP)
当我进行交易时,我收到以下错误:
Your transaction has been successful but there was a problem connecting back to the merchant's web site. Please contact the merchant and advise them that you received this error message.
<script>
$(document).ready(function () {
jsonFromrequestEndpoint = <?PHP echo $hppJson; ?>;
RealexHpp.setHppUrl("https://pay.sandBox.realexpayments.com/pay");
RealexHpp.redirect.init("creditSubmit","https://WEBSITE/response_globalPay.PHP",jsonFromrequestEndpoint);
$('#creditSubmit').click();
});
</script>
解决方法
在本地环境中进行测试时,通常会遇到此错误。
如果您想在本地环境中进行测试,您需要将本地环境暴露给互联网 - 我们为此使用了 ngrok,但您可以使用任何其他服务来帮助您做到这一点。
从上面提到的服务中获取 URL 后,只需将 WEBSITE 替换为它即可。
完成此操作后,一切都应该按预期进行。