-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Recommended exchange to be resolved during Invoice Creation #5976
Recommended exchange to be resolved during Invoice Creation #5976
Conversation
8a88bf6
to
90c72dc
Compare
90c72dc
to
261f3e4
Compare
9af0bce
to
436c782
Compare
6e4f6b1
to
f74002c
Compare
f74002c
to
6a6e95a
Compare
Logically, this makes a lot of sense, and sounds like it's more flexible/error proofed than our current implementation. Would want to take a look at the UI to confirm, but sounds good to me AFAICT! |
@dstrukt in the current UI, the only change you really see is:
EDIT: Just added this comment in the PR description |
Oh I see, yes, that sounds pretty close to how I imagined it originally reading the PR. Sounds like great change! cACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concept ACK, minimal code review but looks fine
Recommended exchange to be resolved during Invoice Creation
Previously, a store was required to select a specific exchange rate source during its creation.
We improved the user experience by automatically recommending the appropriate source when the user selects the currency. The selected recommendation was then saved in the store's configuration.
There were two problems with this approach:
This PR addresses these two issues by allowing the merchant to choose "Use the recommended exchange rate." Instead of selecting a specific exchange rate at the time of the store's creation, the "recommended exchange rate" is now selected at the time of the invoice's creation.
In a future PR (#5653), this will allow the administrator to easily change these if a rate source becomes unavailable and enables the merchant to switch his default currency without having to think about switching his exchange rate source.
To better reflect this change in meaning, in the store creation wizard and the rate configuration,
Kraken (Recommended)
has been replaced byRecommendation (Kraken)
. This reflects that the choice is actually to adopt whatever recommendation is given when the invoice is created, and that the current recommendation is Kraken (for USD).You can select this new option in the Greenfield API by simply setting the
PreferredSource
in the store's config to null.UX Changes
Kraken (Recommended)
, it should readRecommendation (Kraken)
.Recommendation (Kraken)
can now be selected in the rate configuration; previously, it was only selectable in the create store wizard.USD
toJPY
, you should see that the rate of new invoices is determined bybitbank
rather thankraken
.Implementation
A store
PreferredSource
can now be null or empty string to take the current recommendation. If it is the case, the rate rules used when an invoice is created are:If a specific exchange like
coinbase
is selected, this is instead used.Pluginifiable Recommended exchanges
A plugin can now define its own recommended exchanges via
services.AddSingleton<DefaultRules>(new DefaultRules.Recommendation("USD", "kraken"))
.DefaultRule.Order
has been added to decide which rule should be given priority if there is a tie.