SagePay .NET集成套件 - 用于返回3dSecureStatus NOTAVAILABLE值时出错 [英] SagePay .Net Integration Kit - Error when returning NOTAVAILABLE value for 3dSecureStatus

查看:141
本文介绍了SagePay .NET集成套件 - 用于返回3dSecureStatus NOTAVAILABLE值时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现使用窗体集成SagePay付款。我的实现是基于SagePay提供的.NET集成套件已经都一直很好。

I have implemented SagePay payment using the Form Integration. My implementation is based on the .Net integration kit supplied by SagePay which has all been good.

最近,我们已经启用了3D安全,并遇到了一个问题,当 3DSecureStatus 的值返回 NOTAVAILABLE 的值

Recently we have enabled 3D Secure and have encountered an issue when the value of 3DSecureStatus returns a value of NOTAVAILABLE.

这似乎是返回 NOTAVAILABLE 价值时,一个错误是在调用 ConvertToSagePayMessage()的方法 SagePayIntegration 组件内类 SagePay.IntegrationKit.DotNet.dll

It would seem that when the NOTAVAILABLE value is returned, an error is thrown within the call to the ConvertToSagePayMessage() method on the SagePayIntegration class within the assembly SagePay.IntegrationKit.DotNet.dll.

具体而言,当值被解析到 ThreeDSecureStatus 枚举出现此错误。这个枚举不具备 NOTAVAILABLE A值能够解析到,因此错误。

Specifically, this error occurs when the value is being parsed to the ThreeDSecureStatus enum. This enum does not have a value for NOTAVAILABLE to be able to parse to, hence the error.

我已经把修复在此暂时得到这个工作现在。此修复程序替换 NOTAVAILABLE 值,所以这个现在解析为一个有效的枚举值。这仅仅是调用以前做过 ConvertToSagePayMessage()

I have put a fix in for this for the moment to get this working for now. This fix replaces the NOTAVAILABLE value with NONE, so this now parse to a valid enum value. This is done just before the call to ConvertToSagePayMessage()

cryptDecoded = cryptDecoded.Replace("3DSecureStatus=NOTAVAILABLE", "3DSecureStatus=NONE");

我只是想知道为什么 ThreeDSecureStatus 枚举不具有 NOTAVAILABLE A值,如 NOTAVAILABLE 是由SagePay提供的形式集成协议指南中列出,它有望返回值之一。并希望能实现一个更强大的修复,而不是字符串替换。

I was just wondering why the ThreeDSecureStatus enum does not have a value for NOTAVAILABLE, as NOTAVAILABLE is one of the values that it is expected to return, which is outlined in the Form Integration Protocol guide supplied by SagePay. And was hoping to implement a more robust fix, rather than the string replace.

推荐答案

的问题是,整合套件包含了枚举为<$ C $错误C> 3DSecure 状态缺少 NOTAVAILABLE 。 SagePay甚至告诉我:

The problem is that the integration kit contains a bug in that the enum for the 3DSecure status is missing a value for NOTAVAILABLE. SagePay have even told me this:

不幸的是,这是一个已知的问题与.NET工具包,但没有固定的呢。

Unfortunately this is a known issue with the .NET kit but there is no fix as of yet.

因此​​,有三种可能的方式来解决这个问题。

So there are three possible ways to fix this.


  1. 要么修改从服务器去codeD回应 3DSecureStatus 值的值更改为(写在的问题。)

  2. 使用一个版本已应用了修复程序的集成工具包的。你可以问SagePay为code(他们似乎非常愿意提供它免费),并在 NOTAVAILABLE ThreeDSecureStatus.cs 文件:

  1. Either modify the decoded response from the server to change the value of the 3DSecureStatus value to NONE (as written in the question.)
  2. Use a version of the Integration Kit that has had the fix applied. You can ask SagePay for the code (they seem perfectly willing to provide it free of charge) and add in NOTAVAILABLE as an enum value in the ThreeDSecureStatus.cs file:

public enum ThreeDSecureStatus
{
    NONE,
    OK,
    NOAUTH,
    CANTAUTH,
    NOTAUTHED,
    ATTEMPTONLY,
    NOTCHECKED,
    INCOMPLETE,
    MALFORMED,
    INVALID,
    ERROR,
    NOTAVAILABLE //<--- Add this
}


  • 我已经通过修复bug的历程,并将它上传到 GitHub的库。随意拿code从那里。我也更新项目中使用C#6,因此你需要使用Visual Studio 2015年或更高版本才能使用它。如果确实需要使用旧的版本,你可以从<一个原始文件启动href=\"https://github.com/WiredUK/SagePay.IntegrationKit/commit/56ad2d535aa10b436ce7ca2a55fe9abbaeb97a8c\"相对=nofollow>先提交到库。

  • I have already gone through the process of fixing the bug and have uploaded it to a GitHub repository. Feel free to take the code from there. I have also updated the project to use C#6 and as such you will need to use Visual Studio 2015 or higher to use it. If you do need to use an older version, you could start with the original files from the first commit to the repository.

    这篇关于SagePay .NET集成套件 - 用于返回3dSecureStatus NOTAVAILABLE值时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆