← 返回刚才阅读的位置

知识卡片

支付系统案例卡 · 2285.l.22

重复请求可能重复扣款

理解等级:高级

分布式系统中的重试与消息重投不可避免,信用卡扣款却不是天然幂等操作。两次请求若都执行就会重复收款;反过来,仅凭同卡、同金额、短时间去重,又可能错误吞掉客户同时购买两张同价机票的合法付款。参见[[唯一请求键去重扣款]]。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 工作流引擎与集成挑战 · 查看原书依据

      It is advisable not to rely on the business payload for detecting duplicates. If there are two credit card charges for the same card with the same amount within milliseconds, it is likely that this is a retry, but you can never be sure. Maybe somebody booked two flight tickets with the exact same price at the exact same time.

    参考来源

    - 位置:《Practical Process Automation》第9章《工作流引擎与集成挑战》(来源项目:book-sources;源文件:extracted/Practical Process Automation (Bernd Ruecker)/_epub-src/OEBPS/ch09.xhtml) - 结论依据:原文以同一卡、同金额、毫秒内的两笔扣款说明载荷相同既可能是重试,也可能是两张同价机票的合法购买,支持不能据载荷猜测重复的资金风险;紧邻前文明确扣款非天然幂等。 - 原始内容:It is advisable not to rely on the business payload for detecting duplicates. If there are two credit card charges for the same card with the same amount within milliseconds, it is likely that this is a retry, but you can never be sure. Maybe somebody booked two flight tickets with the exact same price at the exact same time.