优化接收Stripe回调时数据重复存储问题(添加唯一索引)

This commit is contained in:
2025-02-10 16:11:59 +08:00
parent ab7e1705c4
commit 7eb9abbdb5
7 changed files with 37 additions and 5 deletions

View File

@@ -163,4 +163,15 @@
AND TRIM(country) != ''
</select>
<insert id="insertIgnore" parameterType="com.ai.da.mapper.primary.entity.PaymentInfo">
INSERT IGNORE INTO
t_payment_info (order_no, transaction_id, payment_type, trade_state, payer_total,
type, content, notified, payment_method, last4, hosted_invoice_url,
country, city, ip_address, create_time)
VALUES (#{paymentInfo.orderNo}, #{paymentInfo.transactionId}, #{paymentInfo.paymentType},
#{paymentInfo.tradeState}, #{paymentInfo.payerTotal}, #{paymentInfo.content},#{paymentInfo.type},
#{paymentInfo.notified},#{paymentInfo.paymentMethod}, #{paymentInfo.last4},#{paymentInfo.hostedInvoiceUrl},
#{paymentInfo.ipAddress},#{paymentInfo.country},#{paymentInfo.city},#{paymentInfo.createTime});
</insert>
</mapper>