【问题标题】:Authorize.net Error when adding new paymentProfile - code: E00114, Invalid OTS TokenAuthorize.net 添加新的 paymentProfile 时出错 - 代码:E00114,无效的 OTS 令牌
【发布时间】:2020-03-27 15:09:03
【问题描述】:

我们正在尝试为现有的 customerProfile 添加新的 customerPaymentProfile。我们在提供的 github 示例上设计我们的代码 https://github.com/AuthorizeNet/sample-code-node/blob/master/CustomerProfiles/create-customer-payment-profile.js

唯一的区别是,我们不会将 CC 详细信息传递给我们的服务器。相反,我们从前端传递 opaqueData。在初始 customerProfile 创建(使用单一付款资料)时,它的 w/c 效果很好。但是如果我们尝试添加一个新的 paymentProfile(使用新的 opaqueData),我们会得到错误代码:E00114, Invalid OTS Token.

官方documentation关于错误码不多说

似乎有几种不同的情况会引发此错误代码

使用 Accept.js

我们的案例(node.js SDK)

其他

我们还尝试将事务延迟至少 7 秒,然后使用 opaqueData 可能允许他们的系统按照建议的here 同步以接收相同的错误消息。

有人遇到过这样的事情吗? 任何形式的帮助都将受到高度赞赏。

【问题讨论】:

    标签: node.js authorize.net


    【解决方案1】:

    我们做错了什么,通过反复试验(通过 API)来确定客户是否存在。因此点击 api 一次或两次会导致令牌无效(第二次调用出错)

    所以我们尝试创建一个 customerProfile,带有 customerPaymentProfile 并且如果 customerProfile 已经存在(如果它是重复的电子邮件),这将引发错误。这里的好处是 customerProfileId 带有错误有效负载。

    我们考虑使用错误负载中的 customerProfileId 为客户创建新的付款资料,通过减少系统上的一次数据库调用来为我们提供一些优势。

    我们策略的问题在于,当我们使用它创建 customerProfile(w/ payment profile)即使请求失败时,opaqueData 将过期

    所以解决方法是在我们的系统中保存客户信息,并检查它是否是回头客。如果是,则从 db 中获取 customerProfileId,并在 authorize.net 上创建新的 customerPaymentProfile

    也可以先创建 customerProfile,而不使用 customerPaymentProfile。如果此事务失败,那么至少您还没有使用 opaqueData 并且您获得了 customerProfileId 而无需对您的数据库进行任何查询。因此,当您尝试创建新的 customerPaymentProfile 时,您不会收到错误代码 E00114,因为尚未使用 opaqueData。

    经验教训对我们来说是艰难的,但希望它对某人有所帮助。

    【讨论】:

      猜你喜欢
      • 2018-05-14
      • 1970-01-01
      • 2021-12-12
      • 2017-05-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-19
      • 2018-08-20
      • 1970-01-01
      相关资源
      最近更新 更多