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

fix: set the value from incoming payment in quote #862

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

dragosp1011
Copy link
Contributor

Context

Changes

  • uses the amount from incoming payment instead of converting it
    this PR will solve issues with internal cross-currencies payments.
    External payments may still encounter this issue and it will be solved when Create GetReceiver GraphQL Admin Query rafiki#1005 will be implemented.

@github-actions github-actions bot added package: wallet/backend Wallet backend implementations type: source Source changes labels Oct 10, 2023
amount: value
})
let convertedValue
if (isIncomingPayment) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this approach. The users should be able send their desired amounts. If the incoming payment has a receive amount of 100EUR, we should not enforce to send 100EUR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I agree, the request might be 100EUR but the user ca decide to pay only 50EUR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the issue is that converting the value is not exact, so 20.15 euro will result in 100.02 roni (instead of expected 100)
I added a check that if the amount is off by less then 1% to set it to the amount in incoming payment
open to other suggestions if this does not make sense

@dragosp1011 dragosp1011 merged commit f8b86b6 into main Oct 17, 2023
9 checks passed
@dragosp1011 dragosp1011 deleted the fix-cross-currency-fixed-send branch October 17, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: wallet/backend Wallet backend implementations type: source Source changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request payment error
4 participants