- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我一直假设用 IPN 消息发送的 txn_id
是唯一的。 Paypal 指南似乎支持这个想法 - https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro
Avoid duplicate IPN messages. Check that you have not already processed the transaction identified by the transaction ID returned in the IPN message. You may need to store transaction IDs returned by IPN messages in a file or database so that you can check for duplicates. If the transaction ID sent by PayPal is a duplicate, you should not process it again.
但是我发现 PayPal 的 eCheck 付款 IPN 使用相同的交易 ID 发送了两次。一次在初始付款期间,payment_status
为“待定”,几天后 eCheck 实际处理时再次为 payment_status
为“已完成”。
我想存储两笔交易,但仍想避免存储重复的交易。 IPN 中还有一个名为 ipn_track_id
的字段,它对于两个交易都是不同的,但我找不到它的文档,除了这个模糊的描述:
Internal; only for use by MTS and DTS
还有其他人使用 ipn_track_id
来唯一标识 IPN 消息吗?
最佳答案
ipn_track_id
不应被使用;主要是因为这仅供内部使用,因为它对于每个 IPN 消息都是唯一的。txn_id
对于每个交易都是唯一的,而不是每个 IPN 消息。
这是什么意思;一个事务可以有多个 IPN 消息。例如,eCheck,默认情况下它会进入“待处理”状态,一旦 eCheck 结清就会进入“完成”状态。
但您可能还会看到针对同一 txn_id
的撤销、取消的撤销、打开的案例和退款。
伪代码:
If not empty txn_id and txn_type = web_accept and payment_status = Completed
// New payment received; completed. May have been a transaction which was pending earlier.
Update database set payment_status = Completed and txn_id = $_POST['txn_id']
If not empty txn_id and txn_type = web_accept and payment_status = Pending
// New payment received; completed
Update database set payment_status = Pending and payment_reason = $_POST['pending_reason'] and txn_id = $_POST['txn_id']
您可以在 https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables#id08CTB0S055Z 上找到更多列出的 IPN 变量
基本上; PayPal 将生成唯一的卖家交易 ID。此交易 ID 在“完成”之前可能会经历多个阶段,因此您需要能够处理这些异常。
至于 PayPal 在文档中的说明:如果在发送过程中遇到错误,PayPal 可能会重新发送个别 IPN 消息。例如,只要 PayPal 将 IPN 数据发送给它,您的脚本就需要返回正确的 HTTP/1.1 200 OK HTTP 状态响应。
如果您没有返回 HTTP/1.1 200 OK 响应,PayPal 将针对每个 IPN 消息重新尝试发送相同数据最多 16 次。
注意:卖家的交易 ID 与买家的交易 ID 不同,因为它们是两种不同的操作(一次借记,一次贷记)。
关于 Paypal IPN 唯一标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9240235/
C++ Primer 说: The identifier we define in our programs may not contain 2 consecutive underscores, no
标识符术语在文档 alongside constants 中定义。 , 使用几乎相同的用例,尽管术语在运行时计算它们的值,而常量在编译时得到它。潜在地,这可能会使术语使用全局变量,但这是一个遥远而丑陋
我想知道,.Net 标识符中接受哪些字符? 不是 C# 或 VB.Net,而是 CLR。 我问这个的原因是我正在查看 yield return 语句是如何实现的 (C# In Depth),并看到
在PowerShell中,当我专门使用Active Directory时,通常会编译一个包含一组人群列表的对象,通常使用$x = get-adgroup -filter {name -like "*"
使用 hibernate 时: 我必须为每个实体指定一个 ID 或复合 ID,如果我想使用没有任何主键且没有复合键的表怎么办... 提前致谢 最佳答案 没有键的表不是一个好的关系模型。我不会推荐它。
所以我有一些代码正在尝试编译,但我不断收到此错误: 3SATSolver.java:3: expected 这是代码。我只是没有看到什么吗? import java.util.ArrayList;
我正在寻找有关 C 标准(C99 和/或 C11)部分内容的一些说明,主要是关于标识符的使用。 上下文是一个完整的C99标准库的实现,我希望它完全符合标准。 基本问题是:C 标准允许我在多大程度上声明
我有这个 Shader.h 文件,我正在用这段代码制作它: #include #include #include #include in vec2 TexCoords; out vec4 co
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
这是我的代码: #include "stdafx.h" #include #include #include #include using namespace std; int _tmain(
pthread_create() 的第一个参数是一个thread 对象,用于标识新创建的线程。但是,我不确定我是否完全理解其中的含义。 例如,我正在编写一个简单的聊天服务器并且我计划使用线程。线程会随
我想从我的标识符中获得匹配项。 我在 {/describe:foo} 中有一个这样的字符串,我正在尝试匹配 {/describe:} 以返回 foo,但我没有得到正确的正则表达式,会有人介意指出我做错
我遇到了一个奇怪的问题,我似乎找不到答案,但我想我不妨问问。 我有一个执行碰撞检查的抽象类,它有一个“更新”函数,以及“updateX”和“updateY”函数。 class MapCollidabl
我正在尝试创建一个程序来将所有文件从一个目录复制到另一个目录。但我遇到了一个基本问题。它说当我尝试在第 52 行编译时需要标识符。 public bool RecursiveCopy() {
1>cb.c(51): error C2061: syntax error : identifier 'SaveConfiguration' 1>cb.c(51): error C2059: synt
我刚刚发现命名变量 arguments 是个坏主意。 var arguments = 5; (function () { console.log(arguments); })(); Outpu
我们对我们的网站进行了安全测试,并发现了一个漏洞。 问题 If the session identifier were known by an attacker who had access to t
为了估计程序在一次内核启动中可以处理多少数据,我尝试使用 cudaMemGetInfo() 获取一些内存信息。但是,编译器告诉我: 错误:标识符“cudaMemGetInfo”未定义 cudaGetD
我发现我需要使用 xpath 查询来定位几乎是 regexp 类型的字符串,但无法看到如何管理它。我正在使用的当前查询是: $result = $xpath->query('//ul/li[sta
我正在创建我的学生计划表的虚拟版本,它基本上可以让你记下你有哪些科目的作业。 这是界面: 用户从组合框中选择主题,并在相邻的备忘录中输入一些注释。完成后,他们将单击“保存”按钮,将其保存到 .ini
我是一名优秀的程序员,十分优秀!