2009-08-06 77 views
2

我的任務是在我們現有的網站上實施3D安全信用卡驗證。 我只是想知道是否有人有任何示例代碼來設置3D安全?在C#中實現DataCash 3DSecure

我一直在通過文檔,但沒有發現任何東西。

+0

通常的支付網關提供支持,這一點,誰是你的網關? – TWith2Sugars 2009-08-07 07:49:26

+0

通常他們會做...但是沒有3D安全示例代碼....沒有。 DataCash – Alex 2009-08-08 00:13:41

回答

2

我已經寫了這個,現在的文章... http://www.alexjamesbrown.com/blog/development/implementing-datacash-3d-secure-with-asp-net/

希望這有助於誰在這個由谷歌絆倒人....

+1

當試圖訪問您的文章使用Chrome瀏覽器(未嘗試其他瀏覽器)時,我收到一條警告,說該網頁包含惡意內容? – ddd 2010-07-28 08:57:47

+0

這是正確的。從IE瀏覽器時我被AVG保存。 IE沒有警告。 – IsmailS 2010-08-03 05:52:58

+0

我的網站成爲某些病毒的受害者 - 現在應該全部排序(谷歌可能需要一段時間才能將其標記爲安全) – Alex 2010-08-03 14:02:18

2

我試圖讓我和其中一個人一起在這裏發佈一些信息,因爲他爲我們的一個客戶寫了這篇文章,但我會帶你瞭解我所瞭解的過程。

基本上,一旦您執行了您執行的任何預驗證請求(例如使用DataCash二進制文件),然後您使用DataCash代理向DataCash提交支付請求以發送支付請求。

如果你有3D安全設置的所有DataCash帳戶,你已經通過字段進行發送的說本次交易可以用3DS發生,你可能會得到150返回一個狀態代碼:

<?xml version="1.0" encoding="UTF-8"?> 
<Response> 
    <CardTxn> 
    <card_scheme>...</card_scheme> 
    <country>...</country> 
    <issuer>...</issuer> 
    <ThreeDSecure> 
     <acs_url>...</acs_url> 
     <pareq_message>...</pareq_message> 
    </ThreeDSecure> 
    </CardTxn> 
    <datacash_reference>...</datacash_reference> 
    <merchantreference>...</merchantreference> 
    <mode>TEST</mode> 
    <reason>3DS Payer Verification Required</reason> 
    <status>150</status> 
    <time>...</time> 
</Response> 

與CardTxn元素中的ThreeDSecure塊一起使用。

然後您需要獲取acs_url和pareq_message,並使用它們向卡發行銀行提交授權請求。

這通常需要一個自提交JavaScript表單的形式,也可以張貼到iframe:

<!-- Action comes from acs_url returned by DataCash --> 
<form method="post" 
     target="3dAuthFrame" 
     action="https://testserver.datacash.com/acs"> 
    <!-- Value comes from pareq_message returned by DataCash --> 
    <input value="[...]" 
     name="PaReq" 
     type="hidden" /> 
    <!-- Value is a merchant specified identifier that is dislayed to the user --> 
    <input value="[...]" 
     name="MD" 
     type="hidden" /> 
    <!-- Value is a public URL that the 3D Secure server will post back to --> 
    <input type="hidden" 
     name="TermUrl" 
     value="[...]"/> 
    <p> 
    If you do not see your card issuer's instructions, below, please click 
    <input value="Continue" name="TDAction" type="submit" /> 
    </p> 
    <iframe style="width:100%;height:400px" 
      src="javascript:''" 
      name="3dAuthFrame"></iframe> 
    <script type="text/javascript"> 
    document.forms[0].elements.TDAction.click(); 
    document.forms[0].elements.TDAction.disabled=true;</script> 
</form> 

在TermUrl該頁面隨後將收到從3D安全服務器的呼叫,與表單域「 PaRes「和」MD「(即發行銀行的回覆,以及您之前提供的參考)。

然後,您將這些授權詳細信息作爲歷史事務提交回DataCash以完成付款。

有關詳細信息,請參見D.4節。 3-D Secure,開發人員指南中包含DataCash MPI,以及this page(可能需要登錄)。

如果您需要更多詳細信息,請告訴我,我會盡力在此處獲得更多詳細信息。

+0

嗨,感謝您的驚人詳細的答案!我非常感謝你的幫助。 我給你發過一個問題使用:http://www.doodle.co.uk/Contact.aspx 這是正確的嗎? – Alex 2009-08-27 10:36:59

+0

是的,這是正確的 - 只需幾分鐘即可弄清楚它在做什麼,我想......我會看看我是否可以爲你獲得一些代碼。 – 2009-08-27 11:05:27