2014-02-24 77 views
0

我正在將安全付費直接發佈到我的網站。 下面是我在main(index.php)頁面中使用的表單。 表單需要許多不同的參數作爲HIDDEN字段傳遞,如下所示。SecurePay直接發佈url重定向

使用的隱藏字段之一是'EPS_RESULTURL',其中結果重定向到APPROVED或DECLINED事務之後。

Index.php 

<form name="input" action="https://api.securepay.com.au/test/directpost/authorise"  method="post"> 
<input type="hidden" name="EPS_MERCHANT" value="<?php echo $EPS_MERCHANTID;?>"> 
<input type="hidden" name="EPS_TXNTYPE" value="<?php echo $EPS_TXNTYPE;?>"> 
<input type="hidden" name="EPS_REFERENCEID" value="<?php echo $EPS_REFERENCEID;?>"> 
<input type="hidden" name="EPS_AMOUNT" value="<?php echo $EPS_AMOUNT;?>"> 
<input type="hidden" name="EPS_TIMESTAMP" value="<?php echo $EPS_TIMESTAMP;?>"> 
<input type="hidden" name="EPS_FINGERPRINT" value="<?php echo $fingerprint;?>"> 
<input type="hidden" name="EPS_RESULTURL" value="http:://www.mydomain.com/result.php"/> 

<input type="text" name="EPS_CARDNUMBER" id="EPS_CARDNUMBER" placeholder="card number" class="cardnumber"/> 
<input type="text" name="EPS_EXPIRYMONTH" id="EPS_EXPIRYMONTH" placeholder="mm" class="month"/> 
<input type="text" name="EPS_EXPIRYYEAR" id="EPS_EXPIRYYEAR" placeholder="yyyy" class="year"/> 
<input type="text" name="EPS_CCV" id="EPS_CCV" placeholder="cvv"/> 
<input type="submit" name="submit" id="submit" class="submitBtn"> 
</form> 

result.php 
<?php 
    print_r($_POST); 
?> 

對於批准的交易:

的URL被重定向到result.php並且因此打印從服務器接收到的POST數據。然而,在瀏覽器中,URL仍然是

https://api.securepay.com.au/test/directpost/authorise

我希望以某種方式我可以留在自己網站www.mydomain.com而不是重定向到 https://api.securepay.com.au/test/directpost/authorise

感謝。

回答

0

更改result.php到:

<?php 
header("location:yoururl.php"); 
exit(); 
?> 

而且要成爲它會將您重定向。一般來說,results.php是您想要挑選該數據的地方,解析它並對其執行操作,然後重定向用戶。更一般地說,results.php是你會做一些魔術的地方,並將用戶拍到thanksforpaying.php

希望有幫助。

+0

嗨,山姆,謝謝你的回覆。我以類似的方式使用了重定向。它做了實際的重定向,但我的問題是爲什麼URL不會在瀏覽器中更改爲重定向的URL。在我們的例子中是「http :: //www.mydomain.com/yoururl.php」。 – user96675

+0

嘿,我很抱歉,我不知道你試過這個。我不確定,我有不同的提供商的經驗,他們有3個網站。 1爲付款數據,1爲成功,1爲失敗。因此,他們會將付款數據發送給一個網址,並將您重定向至成功/失敗網站。也許它從表格中缺失,對不起,我沒有回答你的問題。 –

+0

你也可能想看看這個:http://test.web.securepay.com.au/resources/eSec/SSL-Browser-Redirect-Integration-Guide-pg07.html 我還沒有使用過的方法所以我不確定,但似乎很好? –