![](/img/trans.png)
[英]Node.js E00007 Authorize.net error - User authentication failed due to invalid authentication values
[英]Authorize.net Error when adding new paymentProfile - code: E00114, Invalid OTS Token
我们正在尝试为现有的 customerProfile 添加一个新的 customerPaymentProfile。 我们在提供https://github.com/AuthorizeNet/sample-code-node/blob/master/CustomerProfiles/create-customer-payment-profile.js的 github 示例上对我们的代码进行模式化
唯一的区别是,我们不会将 CC 详细信息传递给我们的服务器。 相反,我们从前端传递 opaqueData。 在初始customerProfile创建(使用单个付款配置文件)时,它可以很好地工作。 但是如果我们尝试添加一个新的支付配置文件(使用新的 opaqueData),我们会得到错误代码: E00114,无效的 OTS 令牌。
关于错误代码的官方文档并没有说太多
似乎有几种不同的情况,它会抛出此错误代码
使用 Accept.js
我们的案例(node.js SDK)
其他
我们还尝试将事务延迟至少 7 秒,然后再使用 opaqueData 可能允许他们的系统按照此处的建议进行同步以接收相同的错误消息。
有没有人遇到过这样的事情? 任何形式的帮助将不胜感激。
我们做错了,通过反复试验(通过 API)来确定客户是否存在。
因此,我们尝试创建一个带有customerPaymentProfile 的 customerProfile,如果 customerProfile 已经存在(如果它是重复的电子邮件),这将引发错误。 这里有什么好处,就是customerProfileId将包含在错误有效负载中。
现在,我们虽然利用误差的有效载荷customerProfileId,来为客户创造新的付款资料,减少我们的系统上的一个DB电话给我们一些优势。
我们策略的问题在于,即使请求失败,当我们使用opaqueData创建 customerProfile(w/payment profile) 时,它显然也会过期。
所以解决方案是在我们的系统中保存客户信息,并检查它是否是回头客。 如果是,则从数据库中获取customerProfileId ,并在 authorize.net 上创建新的 customerPaymentProfile
也可以先创建 customerProfile,而无需 customerPaymentProfile。 如果此事务失败,那么至少您还没有使用opaqueData并且您获得了customerProfileId,而无需对您的数据库进行任何查询。 因此,当您尝试创建新的customerPaymentProfile 时,您不会收到错误代码E00114,因为尚未使用 opaqueData。
经验教训对我们来说是艰难的,但希望它可以帮助某人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.