Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #470 Add validation on /settleorder #567

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bot/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,13 @@ const initialize = (botToken: string, options: Partial<Telegraf.Options<MainCont
const order = await Order.findOne({ _id: orderId });
if (!order) return;

// Check if the order status is already PAID_HOLD_INVOICE
if (order.status === 'PAID_HOLD_INVOICE') {
const seller = await User.findOne({ _id: order.seller_id });
await messages.sellerPaidHoldMessage(ctx, seller);
return;
}

// We look for a dispute for this order
const dispute = await Dispute.findOne({ order_id: order._id });

Expand Down