【问题标题】:GetHostedProfilePage not honouring hostedProfileBillingAddressOptions settingGetHostedProfilePage 不遵守 hostsProfileBillingAddressOptions 设置
【发布时间】:2016-11-30 05:44:18
【问题描述】:

我一直在尝试更新我们对 Authorize.net 的 CIM 接口的 API 调用,以隐藏托管配置文件页面上的账单地址字段。

文档指出,当调用令牌创建函数时,传入值为“showNone”的设置“hostedProfileBillingAddressOptions”将隐藏表单的帐单地址部分,但是当我传入此设置时,我仍然得到帐单地址显示。

我已验证我正确传递了设置(添加方式与“hostedProfileIFrameCommunicatorUrl”和“hostedProfilePageBorderVisible”设置相同),如果我为“hostedProfileBillingAddressOptions”选项传递了无效值,令牌创建函数将返回错误

此选项是否依赖于其他东西,例如帐户设置或其他设置参数?

作为参考,我在沙盒系统中测试这个,我使用的是dotNet SDK,我调用API函数的测试代码如下

Public Shared Function CreateHostFormToken(apiId As String, apiKey As String, branchId As Int64, nUser As Contact, iframeComURL As String) As String
        Dim nCustProfile = GetCustomerProfile(apiId, apiKey, branchId, nUser)

            Dim nHost = New AuthorizeNet.Api.Contracts.V1.getHostedProfilePageRequest()
            nHost.customerProfileId = nCustProfile

            ' Set Auth
            Dim nAuth = New Api.Contracts.V1.merchantAuthenticationType()
            nAuth.ItemElementName = Api.Contracts.V1.ItemChoiceType.transactionKey
            nAuth.name = apiId
            nAuth.Item = apiKey

            nHost.merchantAuthentication = nAuth

            ' Set Params
            Dim settingList As New List(Of Api.Contracts.V1.settingType)
            Dim nParam As New Api.Contracts.V1.settingType With {.settingName = "hostedProfileIFrameCommunicatorUrl",
                                                                 .settingValue = iframeComURL}
            settingList.Add(nParam)
            nParam = New Api.Contracts.V1.settingType With {.settingName = "hostedProfilePageBorderVisible",
                                                            .settingValue = "false"}
            settingList.Add(nParam)

            nParam = New Api.Contracts.V1.settingType With {.settingName = "hostedProfileBillingAddressOptions",
                                                            .settingValue = "showNone"}
            settingList.Add(nParam)

            nHost.hostedProfileSettings = settingList.ToArray

            Dim nX = New AuthorizeNet.Api.Controllers.getHostedProfilePageController(nHost)
            Dim nRes = nX.ExecuteWithApiResponse(GetEnvironment())

            Return nRes.token
 End Function

我也查看了 SDK 代码,没有看到任何会阻止设置通过的内容。

有没有人遇到过这个问题,或者成功设置了卡片输入表单来隐藏账单地址?

【问题讨论】:

    标签: authorize.net authorize.net-cim


    【解决方案1】:

    原来解决这个问题的方法有两个部分:

    为了使用“hostedProfileBillingAddressOptions”选项,您需要使用比我使用的更新版本的捕获页面。我使用的是“https://secure2.authorize.net/profile/”,而新版本是“https://secure2.authorize.net/customer/”。额外的好处是,新的 URL 提供了一个更漂亮、更现代的表单。

    但是,一旦这工作正常,我就遇到了一个问题,即在输入卡时,一条验证消息告诉我“需要地址和邮政编码”,尽管不可见。我还确保将选项“hostedProfileBillingAddressRequired”设置为 false(无论如何这是默认值)

    Authorize.net 支持的响应是,为了捕获没有地址的卡,必须将选项“hostedProfileValidationMode”设置为“testMode”。

    文档中没有提到这一点(至少据我所知),因此其他人可能不知道,因为在实时环境中使用“testMode”有点违反直觉。 这并不理想,因为验证客户帐户的卡会向商家发送交易电子邮件,但目前似乎没有其他方法。

    总之,为了让客户无需提供地址即可将信用卡添加到他们的个人资料中,您需要指定以下选项:

    用于捕获的表单 URL - https://secure2.authorize.net/customer/

    getHostedProfilePageRequest -

    hostedProfileIFrameCommunicatorUrl: *your URL*
    hostedProfilePageBorderVisible: false  //assuming you are using an iFrame
    hostedProfileValidationMode: testMode
    hostedProfileBillingAddressOptions: showNone
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-15
      • 1970-01-01
      • 1970-01-01
      • 2019-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-14
      相关资源
      最近更新 更多