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

chore(voucher): use settlement amount to get voucher price #4546

Merged

Conversation

siddhart1o1
Copy link
Member

@siddhart1o1 siddhart1o1 commented Jul 21, 2024

Previously, we handled the sales amount like this:

Sales amount = $1.05 (paid to escrow).
Voucher created for $1.04 (platform fee = 1%).

However, when using a BTC wallet to pay for the voucher, the sales amount is converted to satoshis and paid to escrow. This can lead to discrepancies (due to conversion from cents to sats). For example, we might end up paying $1.04 instead of $1.05, resulting in no platform fee being collected.

To improve accuracy, we now use the settlement amount (the actual amount paid to escrow) as the base and deduct the platform fees from that to create the voucher.

For example, if the amount paid to escrow is $1.04, we will deduct the fees from this amount and create a voucher for $1.03.

@siddhart1o1 siddhart1o1 merged commit 1a49cdb into main Jul 22, 2024
10 of 14 checks passed
siddhart1o1 added a commit that referenced this pull request Jul 27, 2024
siddhart1o1 added a commit that referenced this pull request Jul 27, 2024
* Revert "chore(vouhcer): update voucher amount calculation (#4549)"

This reverts commit 9e49bf6.

* Revert "chore(voucher): use settlement amount to get voucher price (#4546)"

This reverts commit 1a49cdb.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants