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

feat (tax-integrations): Use Anrok taxes in subscription invoices flow #2486

Merged
merged 9 commits into from
Aug 29, 2024

Conversation

lovrocolic
Copy link
Collaborator

Context

Currently integration with tax provider Anrok is being implemented.

Description

This PR uses all existing Anrok logic on subscription and draft invoices.

If customer is connected to Anrok, its taxes should be used. All services and Anrok core logic is already implemented and merged on main. This is just logic that consumes it for subscription and draft invoices

@lovrocolic lovrocolic force-pushed the qa-anrok-subscription-invoices branch 2 times, most recently from ca87a2c to 31a1300 Compare August 28, 2024 09:53
@ivannovosad ivannovosad self-requested a review August 28, 2024 14:00
lovrocolic and others added 9 commits August 28, 2024 17:53
…2378)

## Context

Added error processing on draft invoices, finalization of draft invoices
with tax error details

## Description

Added:
- Fetch taxes from anrok/create_draft_invoice service if calculating
fees and applying taxes for draft invoices
- Fetch taxes from anrok/create_invoice service if calculating fees and
applying taxes for draft invoices that is being finalized
- From refresh_draft_and_finalize service if there was a tax error we
now update invoice to failed state and do not send any notifications
- Return from finalize_service if it was a tax_error while fetching
taxes
- Reset all invoice values when refreshing it - not only delete values,
but also set 0 to computed values, so when we fail we have 0s instead of
previous calculated values
fail with validation failure when fail to refresh invoice
@lovrocolic lovrocolic force-pushed the qa-anrok-subscription-invoices branch from 176a3aa to 47dda19 Compare August 28, 2024 15:53
@lovrocolic lovrocolic merged commit aaa05d4 into main Aug 29, 2024
6 checks passed
@lovrocolic lovrocolic deleted the qa-anrok-subscription-invoices branch August 29, 2024 10:07
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.

3 participants