【问题标题】:Support for Authorize.Net webhooks in asp.net在 asp.net 中支持 Authorize.Net webhook
【发布时间】:2019-12-14 09:48:07
【问题描述】:

asp.net 中是否支持 Authorize.Net webhook?

我正在使用 Microsoft.AspNet.WebHooks.Receivers 包。这是正确的吗?因为其他包是特定于 Github 和其他的?

Public Sub Register(ByVal config As HttpConfiguration)

    ' Web API configuration and services

    config.MapHttpAttributeRoutes()

    config.Routes.MapHttpRoute(
        name:="WebHook_Authorizr",,
        routeTemplate:="api/{controller}/{id}",
        defaults:=New With {.id = RouteParameter.Optional}
    )

    config.   <<<<<<  which method to be called here ????
End Sub

【问题讨论】:

    标签: c# asp.net authorize.net


    【解决方案1】:

    无需使用任何 webhook 包。您应该创建一个读取字符串的任务,您可以使用流阅读器从 request.body 读取响应。

    using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8)){var 
    responseBody = await reader.ReadToEndAsync();}
    

    之后反序列化响应正文。

    【讨论】:

      猜你喜欢
      • 2018-09-08
      • 2019-08-18
      • 1970-01-01
      • 1970-01-01
      • 2021-07-31
      • 1970-01-01
      • 2020-02-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多