验证用户输入的Authorize.net登录凭证与交易密钥的方法是否恰当?
- 核心结论:你通过发起0.01美元的仅授权(authOnlyTransaction)测试交易来验证登录ID和交易密钥的方式是有效的,测试账户和真实账户都适用。
- 真实账户注意事项:在真实账户中完成这笔测试交易后,务必手动**撤销(void)**该授权,避免授权有效期内触发自动扣款(仅授权本身不会立即扣款,但存在后续扣款风险)。
- 补充思路:Authorize.net确实没有专门的凭证验证API,小额测试交易是行业通用的验证方案。你也可以尝试发起0美元金额的交易,不过该操作在Authorize.net可能存在限制,建议自行测试可行性。
你的VB.NET代码如下:
Dim merchantType As New merchantAuthenticationType() With { .name = USER_Entered_LoginID, .Item = USER_Entered_Key, .ItemElementName = ItemChoiceType.transactionKey } Dim bankAccount As New bankAccountType With { .accountType = bankAccountTypeEnum.checking, .nameOnAccount = "Test", .routingNumber = "125008547", .accountNumber = "856667", .echeckType = echeckTypeEnum.WEB } ''测试银行账户信息 Dim paymentType As New paymentType With { .Item = bankAccount } Dim transactionRequest As New transactionRequestType With { .transactionType = transactionTypeEnum.authOnlyTransaction.ToString(), .payment = paymentType, .amount = 0.01 } Dim myRequest = New createTransactionRequest With { .transactionRequest = transactionRequest } Dim controller = New createTransactionController(myRequest) controller.Execute() Dim myResponse = controller.GetApiResponse()
内容的提问来源于stack exchange,提问作者mikemurf22
相关产品推荐
相关产品推荐

