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

After PaymentCreatedEventHandler state mistakes should be how to deal with? #273

Open
zhangzw218 opened this issue Oct 17, 2023 · 1 comment

Comments

@zhangzw218
Copy link
Contributor

if (order.PaymentId.HasValue || order.OrderStatus != OrderStatus.Pending)
{
    // Todo: should cancel the payment?
    throw new OrderIsInWrongStageException(order.Id);
}

In a certain scenario, order.orderstatus = Canceled, the order has been canceled and the payment has been canceled.
Then the payment transaction side is still subscribed to the event, triggering this progress exception issue.
How do I discard this event? Is to make sure that this mistake never happens again?

@gdlcf88
Copy link
Member

gdlcf88 commented Oct 18, 2023

As the todo said, this process flow should be improved.

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

No branches or pull requests

2 participants