Skip to content
Merged
Changes from all commits
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
14 changes: 14 additions & 0 deletions src/shared/global/trolley.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,20 @@ export class TrolleyService {
}
}

async removePayment(paymentId: string, batchId: string) {
try {
await this.client.payment.remove(paymentId, batchId);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Consider adding a check to ensure paymentId and batchId are valid before attempting to remove the payment. This can prevent unnecessary operations and potential errors if the IDs are invalid or undefined.

this.logger.debug(`Removed trolley payment with id ${paymentId}`);
} catch (error) {
this.logger.error(
`Failed to remove trolley payment: '${error.message}'!`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 readability]
The error logging message could be improved by including more context about the operation that failed. Consider specifying the operation name in the log message to make it clearer in the logs.

paymentId,
batchId,
error,
);
}
}

async startProcessingPayment(paymentBatchId: string) {
try {
// generate quote
Expand Down