Skip to content

Commit

Permalink
Fixes paying invoices from orders w/ status FROZEN (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
grunch authored May 14, 2024
1 parent a56f94b commit b998f0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bot/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ const addInvoicePHI = async (ctx, bot, orderId) => {
ctx.deleteMessage();
const order = await Order.findOne({ _id: orderId });
// orders with status PAID_HOLD_INVOICE are released payments
if (order.status !== 'PAID_HOLD_INVOICE') {
if (order.status !== 'PAID_HOLD_INVOICE' && order.status !== 'FROZEN') {
return;
}

Expand Down
7 changes: 6 additions & 1 deletion bot/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ const askForConfirmation = async (user: UserDocument, command: string) => {
const where: FilterQuery<OrderQuery> = {
$and: [
{ buyer_id: user._id },
{ status: 'PAID_HOLD_INVOICE' },
{
$or: [
{ status: 'PAID_HOLD_INVOICE' },
{ status: 'FROZEN' },
],
},
]
};
orders = await Order.find(where);
Expand Down

0 comments on commit b998f0a

Please sign in to comment.