GetHostedProfilePage不遵守hostedProfileBillingAddressOptions设置

时间:2016-07-26 14:09:49

标签: authorize.net authorize.net-cim

我一直在尝试更新我们对CIM界面的API调用,以便Authorize.net隐藏托管个人资料页面上的“结算地址”字段。

文档说明在调用令牌创建功能时,传入一个设置" hostedProfileBillingAddressOptions"价值为#34; showNone"将隐藏表单的帐单邮寄地址部分,但是当我通过此设置时,我仍然会显示帐单邮寄地址。

我已经确认我正确传递了设置(添加的方式与" hostedProfileIFrameCommunicatorUrl"和#34; hostedProfilePageBorderVisible"设置)相同,如果我通过了" hostedProfileBillingAddressOptions"的值无效;选项,令牌创建功能将返回错误

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

作为参考,我在Sandbox系统中对此进行测试,并且我使用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代码,但我没有看到任何阻止该设置传递的内容。

是否有人遇到此问题,或成功设置了卡片条目表单以隐藏帐单邮寄地址?

1 个答案:

答案 0 :(得分:0)

这个问题的解决方案原来分为两部分:

要使用“hostedProfileBillingAddressOptions”选项,您需要使用比我使用的更新版本的捕获页面。我使用的是“https://secure2.authorize.net/profile/”,而新版本是“https://secure2.authorize.net/customer/”。添加了奖励,新网址提供了更好,更现代的形式。

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

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

这在文档中没有提到(至少就我所见),所以可能不是其他人都知道的东西,因为在实时环境中使用'testMode'有点违反直觉。 这不是理想的,因为验证客户帐户的卡会向商家发送交易电子邮件,但似乎现在还没有其他方法。

总之,要允许客户在不必提供地址的情况下将信用卡添加到其个人资料中,您需要指定以下选项:

捕获的表单网址 - https://secure2.authorize.net/customer/

getHostedProfilePageRequest -

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