我一直在尝试更新我们对 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 代码,我没有看到任何会阻止设置通过的内容。
有没有人遇到过这个问题,或者成功设置了卡片输入表单来隐藏账单地址?