2010-01-25 76 views
0

我正在整合一些電子商務網站到不同的銀行,並決定最簡單的方法是在dotnetcharge(www.dotnetcharge.com)庫中添加。它運作良好,意味着我可以保持我的大部分代碼對於每個銀行類型和交易都是一樣的。然而,他們的支持有點糟糕(發送了4封電子郵件,1封回覆),我對3D安全問題感到困惑不解。3D使用dotnetcharge安全處理問題

有沒有人有使用dotnetcharge和3D Secure的經驗?我已經設置了MerchantURL並出現了實際的3D安全屏幕 - 但我不確定如何讓系統正常流動。有沒有人有正確的方向的任何代碼示例,甚至指針?否則,有誰知道如何讓支持迴應!

這種特殊的集成與SagePay,它也有上帝糟糕的文檔和支持。

參考代碼如下;

 Dim Amount As Decimal = ordertotal 
     ' ApplySecure3D options: 
     ' 0 = If 3D-Secure checks are possible and rules allow, perform the checks and apply the authorization rules. 
     ' 1 = Force 3D-Secure checks for this transaction only (if your account is 3D-enabled) and apply rules for authorization. 
     ' 2 = Do not perform 3D-Secure checks for this transaction only and always authorize. 
     ' 3 = Force 3D-Secure checks for this transaction (if your account is 3D-enabled) but ALWAYS obtain an auth code, irrespective of rule base. 
     Dim ProtxLogin As String = "xxx" 
     Dim ProtxPassword As String = "xxx" 
     Dim ProtxApply3DSecure As Integer = 1 
     Dim ProtxMerchantURL As String = "https://www.mydomain.com/processing/" 

     Dim Number As String = txtCardNo.Text '//luhn/mod10 here. 
     Dim AVS As String = txtCVN.Text 
     Dim DD As String = "01" 
     Dim MM As String = ddlValidTo_month.SelectedValue.ToString() 
     Dim YY As String = ddlValidTo_year.SelectedValue.ToString() 

     Dim ProcessingResult As Integer = 0 
     Dim Protx As New dotnetCHARGE.CC() 

     Protx.Login = ProtxLogin 
     Protx.Password = ProtxPassword 
     Protx.ApplySecure3D = ProtxApply3DSecure 
     Protx.MerchantUrl = ProtxMerchantURL 

     Dim AVSResponse As String = "" 
     Dim CVV2 As String = "" 

     Protx.OrderID = GoogleOrderNumber 
     Protx.Month = MM 
     Protx.Year = YY 
     Protx.TransactionType = dotnetCHARGE.TransactionType.Sale 
     Protx.Amount = ordertotal 
     Protx.Number = Number 
     Protx.Currency = "GBP" 
     Protx.CustomerID = CustomerId 
     '//loads of params removed for brevity 
     Protx.ClientIP = Request.UserHostAddress.ToString() 
     Protx.CardType = ddlCardType.SelectedValue.ToString() 
     Protx.Description = "My Order" 
     Protx.Code = AVS 
     Protx.TestMode = True 
     Protx.TransactionType = dotnetCHARGE.TransactionType.Sale 

     ProcessingResult = Protx.Charge(Processor.Protx) 

幫助感謝。

+2

恕我直言 - 我不會推薦dotnetcharge。我發現他們的產品是低標準的,支持粗魯和文檔差。 – Robs 2010-08-28 15:00:43

+1

作爲對此的後續行動;路西法我完全同意你的看法。 dotnetcharge的支持是一個完全的笑話,它們會讓客戶感覺到他們「在路上」或「浪費他們的時間」。 – dooburt 2010-11-02 14:21:02

回答

0

我決定回到這個問題來解釋最終結果是如何實現的。希望有些SO用戶會覺得它有用。

爲了獲得正確的'流',你需要兩頁。您不會真正能夠在單個頁面中完成整個事務處理。第一頁將具有卡入口細節;卡號,失效日期,CVN,賬單地址等。在支付/提交時,我建議將交易保存爲您的數據源爲'未處理'或類似的東西。一旦保存了所有的細節信息 - 到目前爲止還沒有完成卡片處理 - 將HTTPS重定向到第二頁。

根據您的設置,您的客戶可能永遠不會知道此頁面存在。第二頁將其中的.netCharge代碼作爲我的問題並處理該卡片。當啓用3D安全功能(.Apply3DSecure = 1)時,客戶將被重定向到他們的銀行以輸入更多詳細信息,並返回到第二頁。它的行爲不像回發或刷新,所以不要擔心兩次返回到頁面處理的調用。您將收到3種可能狀態中的1種;授權,錯誤和拒絕。您的頁面可以重定向到更多必要的頁面(因此客戶ne ne知道這個中間頁面存在),或者直接在此處理頁面上顯示結果。

有一個最後的'gotcha',你會很快看到。第二頁(處理頁面)需要卡片的詳細信息才能真正處理。你不能僅僅通過表單或者查詢字符串來傳遞卡片細節,這是不負責任的。 .netCharge附帶.Encrypt和.Decrypt功能;只需將值傳遞給加密和某種類型的散列,並將這些細節臨時保存在第一頁上,然後在第二頁上讀取並解密,然後將其刪除。這意味着細節是安全的,在大多數情況下保存時間少於5秒,因爲它們被破壞而沒有曝光。

我希望這會有所幫助 - 如果有人有任何問題,請給我留言。