Skip to content

Commit

Permalink
fix: notify
Browse files Browse the repository at this point in the history
  • Loading branch information
Groupguanfang committed Mar 13, 2024
1 parent cda5d6e commit 33bdb4a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export class XunhupayService implements PayServiceImpl {
if (body.status !== "OD") return;
const receipt = await this.userReceiptService.getReceipt(body.trade_order_id, body.attach);
if (!receipt) return;
const databaseReceipt = await this.prismaService.userReceipt.findFirst({
where: { userReceiptID: receipt.userReceiptID },
});
if (!databaseReceipt) return;
if (databaseReceipt.receiptStatus !== IReceiptStatus.Pending) return "success";
await this.userReceiptService.setReceiptStatus(receipt.userReceiptID, IReceiptStatus.Success);
const user = await this.prismaService.user.findFirst({ where: { userID: receipt.userID } });
if (!user) return;
Expand Down

0 comments on commit 33bdb4a

Please sign in to comment.