我正在尝试用Sagepay Direct实现Omnipay,但我真的在努力使用3D Secure bit。
当我将MD,PaReq和TermUrl发布到https://test.sagepay.com/mpitools/accesscontroler?action=pareq
时,我只是得到一个空白屏幕。
这些先前的SO答案建议从PaReq字段中删除空格来解决问题,但我的数据中没有任何空格。
SagePay Direct 3DSecure checkout part returning blank page when redirecting out to bank
Sage Pay test server won't load 3D Secure page
从Omnipay方法$ response-> getRedirectData()返回的数据是
"PaReq" => "eJxVUk1TwjAQvfsrGO52mza0lVnCoBxERqcqOuMxpqt0pB8mrRZ/vQkUweTy3svO2+xLcNoVm8EXaZNX5WTIPH84FWe4Wmui+SOpVpPAWzJGvtMgzybDwGcjn7OLmEc8CXnAgmQ0FJjOHuhTYG8krI/HEA7UOmi1lmUjUKrPy8Wd4DwKoxFCT7EgvZiLgPn7HfpuIexlLGVBYqZkRsV2RaZ5pjKrNMJOR1W1ZaO3IgkihAPBVm/EumlqMwaQdW08U1bfmur2dZMrT1Ve+wGGNm/nhvQXIbh6hONF09YhY/27PBNyef308zKLuuXdA0u71DC5DrItj2/uJwiuAjPZkLDxxH4SsgGLx2E85hxhp6Ms3MUEc1P1GGvXYnZycCqgzV5TqQ5zHRhSV1cl2YoA4Q9jRkaJR/dKqdwObtOFbewkhOMgV9cuf9XYSJmLfoecX24DYwnbGzqC4Gqhf1XoP4BF/z7GLxIJvBw="
"MD" => "20150419746483421285"
这是我正在使用的表单的HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="https://test.sagepay.com/mpitools/accesscontroler?action=pareq" method="post">
<input name="MD" value="20150419746483421285" type="hidden">
<input name="PaReq" value="eJxVUk1TwjAQvfsrGO52mza0lVnCoBxERqcqOuMxpqt0pB8mrRZ/vQkUweTy3svO2+xLcNoVm8EXaZNX5WTIPH84FWe4Wmui+SOpVpPAWzJGvtMgzybDwGcjn7OLmEc8CXnAgmQ0FJjOHuhTYG8krI/HEA7UOmi1lmUjUKrPy8Wd4DwKoxFCT7EgvZiLgPn7HfpuIexlLGVBYqZkRsV2RaZ5pjKrNMJOR1W1ZaO3IgkihAPBVm/EumlqMwaQdW08U1bfmur2dZMrT1Ve+wGGNm/nhvQXIbh6hONF09YhY/27PBNyef308zKLuuXdA0u71DC5DrItj2/uJwiuAjPZkLDxxH4SsgGLx2E85hxhp6Ms3MUEc1P1GGvXYnZycCqgzV5TqQ5zHRhSV1cl2YoA4Q9jRkaJR/dKqdwObtOFbewkhOMgV9cuf9XYSJmLfoecX24DYwnbGzqC4Gqhf1XoP4BF/z7GLxIJvBw=" type="hidden">
<input name="TermUrl" value="https://www.example.com/payment/auth-return" type="hidden">
<center><p>Please click button below to Authenticate your card</p><input value="Go" type="submit"></center>
</form>
</body>
</html>
你知道为什么我得到一个空白页吗?在将数据发送到Sagepay之前,我是否需要以某种方式转换数据?
我已经尝试了我能想到的一切但却无处可去。
好的,所以它现在神奇地工作......在Sagepay结束时可能是个问题?
如果它对其他人有用,这是我的iFrame代码......
<iframe src="secure-3d.php?acsURL=<?=$responseUrl?>&PaReq=<?=$responseData['PaReq']?>&MD=<?=$responseData['MD']?>&TermUrl=<?=$responseData['TermUrl']?>" name="secure-3d" id="secure-3d" width="100%" height="500" frameborder="0"></iframe>
...'secure-3d.php'是我的自我提交表格,如下所示....
<form id="cardToken" name="cardToken" action="<?=$_GET['acsURL']?>" method="post">
<input type="hidden" name="MD" value='<?=str_replace(' ','+',$_GET['MD'])?>' />
<input type="hidden" name="PaReq" value='<?=str_replace(' ','+',$_GET['PaReq'])?>' />
<input type="hidden" name="TermUrl" value='<?=str_replace(' ','+',$_GET['TermUrl'])?>' />
<noscript>
<center><p>Please click button below to Authenticate your card</p><input type="submit" value="Go"/></p></center>
</noscript>
</form>
<script language="Javascript">
var form = document.getElementById("cardToken");
form.submit();
</script>
我只是将PaReq,MD和TermUrl数据传递给查询字符串中的表单,然后在创建隐藏字段时需要使用str_replace
空格。
应该这样做!
如果有人对如何做到这一点有任何想法,请发表评论