Skip to content

PM-1213 - handle insufficient funds errors #48

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

Merged
merged 2 commits into from
May 13, 2025
Merged

Conversation

vas3a
Copy link
Collaborator

@vas3a vas3a commented May 13, 2025

When we call .startProcessing() on trolley, we'll get an "insufficient funds" error.
this was breaking the payment flow before (I wasn't expecting an error at this point, I was expecting a payment failed event). Anyway. we don't need to do anything if such error occurs. everything proceeds as expected: create the payment & mark it as "processing".
When funds are added to trolley, admin can approve & finish the payment and everything works as expected.


this.logger.debug(`Created payment with id ${payment.id}`);

return paymentBatch;
} catch (e) {
this.logger.error(`Failed to create payment, error '${e.message}'!`);
console.log(e);

Choose a reason for hiding this comment

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

Using console.log(e); for error logging is not recommended in production code. Consider using a more robust logging mechanism or removing this line if it's not necessary.

@vas3a vas3a merged commit 4269fd0 into dev May 13, 2025
1 check passed
@vas3a vas3a deleted the PM-1213_insufficient-funds branch May 13, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant