首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用dotnetcharge的3D安全处理问题

使用dotnetcharge的3D安全处理问题
EN

Stack Overflow用户
提问于 2010-01-25 19:26:49
回答 1查看 549关注 0票数 1

我正在将许多电子通信站点集成到不同的银行中,并决定最简单的方法是添加点网络收费(www.dotnetcharge.com)库。它运行良好,这意味着我可以为每个银行类型和交易保持我的大部分代码相同。然而,他们的支持有点糟糕(发送了4封电子邮件,1个回复),我对3D安全问题感到完全困惑。

有没有人有使用dotnetcharge和3D Secure的经验?我已经设置了MerchantURL,实际的3D安全屏幕出现了--但我不确定如何让系统正确地“流动”。有没有人有任何正确方向的代码示例或指针?如果做不到这一点,有没有人知道如何让支持响应!

这种特殊的集成是与SagePay集成的,它也有非常糟糕的文档和支持。

供参考的代码如下;

代码语言:javascript
复制
        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)

感谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2010-06-30 18:13:41

我决定回到这个问题上来解释最终结果是如何获得的。希望一些SO用户会发现它很有用。

要获得正确的“流”,你需要两页。实际上,您不可能在一个页面中完成整个事务处理。第一页将有卡输入细节;卡号,到期日,CVN,帐单地址等。点击支付/提交时,我建议将交易保存到您的数据源作为‘未处理’或类似的东西。保存所有详细信息后-到目前为止还没有卡处理-使用HTTPS重定向到第二页。

您的客户可能永远不知道此页面的存在,这取决于您如何设置此页面。第二页将包含.netCharge代码作为我的问题并处理卡片。启用3D secure (.Apply3DSecure = 1)后,客户将被重定向至其银行,以输入更多详细信息,银行将返回到第二个页面。它的行为不像回发或刷新,因此不必担心对页面处理的两次返回调用。您将收到3种可能状态中的1种:已授权、错误和已拒绝。您的页面可以重定向到更多必要的页面(因此客户从不知道这个中间页面的存在),或者直接在这个处理页面上显示结果。

最后还有一个“问题”,你很快就会看到。第二个页面(处理页面)需要卡的详细信息才能实际处理。你不能仅仅在表单甚至查询字符串中传递卡片的详细信息,这是不负责任的。.netCharge附带了一个.Encrypt和.Decrypt函数;只需将要加密的值和某种散列传递给它,并将这些详细信息临时保存在第一页上,在第二页上读取和解密,然后删除它们。这意味着细节是安全的,在大多数情况下保存的时间不到5秒,而且你没有暴露,因为它们被销毁了。

我希望这能有所帮助--如果任何人有任何问题,尽管叫我一声。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2131876

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档