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

Incorrect hostCurrencyFxRate and amountInHostCurrency with some PayPal expenses #4021

Closed
znarf opened this issue Feb 25, 2021 · 2 comments · Fixed by opencollective/opencollective-api#8216
Assignees
Labels
api Issues that require some work on the API (https://github.com/opencollective/opencollective-api) bug complexity → medium expenses Expense Management System important Should be considered for prioritisation as soon as possible ledger Anything related to the ledger

Comments

@znarf
Copy link
Member

znarf commented Feb 25, 2021

When paying an Expense with PayPal, we're reading the hostCurrencyFxRate from PayPal response but it's sometimes inaccurate to do so. It's especially visible for Transactions that have currency = hostCurrency.

https://github.com/opencollective/opencollective-api/blob/master/server/lib/transactions.js#L117

SELECT * FROM "Transactions"
WHERE "deletedAt" IS NULL
AND "ExpenseId" IS NOT NULL
AND "currency" = "hostCurrency"
AND "hostCurrencyFxRate" != 1;

We should review this and fix past entries in the ledger.

@znarf znarf added bug expenses Expense Management System ledger Anything related to the ledger api Issues that require some work on the API (https://github.com/opencollective/opencollective-api) complexity → medium labels Feb 25, 2021
@znarf znarf added the important Should be considered for prioritisation as soon as possible label Jun 17, 2021
@kewitz kewitz self-assigned this Dec 21, 2021
@kewitz
Copy link
Contributor

kewitz commented Dec 21, 2021

@znarf
This bug happened only once in 2021 and twice in 2020.
It affects only Adaptive Payments, which PayPal deprecated and continues to provide support to existing integrations only.

I suggest deprecating adaptive payments on our side as well and enabling PayPal Payouts for everyone:
#4210

@znarf
Copy link
Member Author

znarf commented Dec 21, 2021

Ok, I think it might be slightly misleading to look at the data as it is today, because I fixed many impacted transactions.

But if it doesn't happen anymore, that's good to know and we don't have to look at a fix I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues that require some work on the API (https://github.com/opencollective/opencollective-api) bug complexity → medium expenses Expense Management System important Should be considered for prioritisation as soon as possible ledger Anything related to the ledger
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants