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: (payments) simplify loop logic in moneycorp plugin and add unit tests #115

Merged
merged 7 commits into from
Oct 10, 2024

Conversation

laouji
Copy link
Contributor

@laouji laouji commented Oct 4, 2024

fixes ENG-1429
fixes ENG-1435

@laouji laouji marked this pull request as ready for review October 4, 2024 17:08
@laouji laouji requested a review from a team as a code owner October 4, 2024 17:08
@@ -7,6 +7,8 @@ import (
)

var (
ErrMissingCurrencies = errors.New("missing currencies")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add this error for the non-retryable errors in temporal ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm guessing no for two reasons:

  1. missing currency will happen if there is an inconsistency between our implementation and the API response... this is more a configuration error on our side (eg. the platform supports currencies that we didn't add to the whitelist). The smoothest way to deal with this problem would be for an updated version of payments to be deployed and the temporal job to be picked up automatically, allowing us to import the data

  2. the resolution of the error is granular (related to 1 transaction) rather than a batch error (related to all transactions in the batch). If our users misconfigure credentials, we mark as a non-retryable error because no matter how many times we retry with that configuration we will never be able to import transactions. In this case (if the page size were 10) we might have a batch of 9 importable transactions and 1 transaction with an unsupported currency. If we want to ignore that one record with an unsupported currency we should program in a "skip" behaviour so that we can still import the rest of the transactions with valid currencies.

@laouji laouji merged commit 3acdf8f into feat/payments-v3 Oct 10, 2024
6 checks passed
@laouji laouji deleted the feat/payments-v3-ENG-1429 branch October 10, 2024 08:58
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.

2 participants