2010-01-25 73 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秒,因为它们被破坏而没有曝光。

我希望这会有所帮助 - 如果有人有任何问题,请给我留言。