feat(core,react): add the personal IBAN client contract - #199
Open
TaprootFreak wants to merge 3 commits into
Open
feat(core,react): add the personal IBAN client contract#199TaprootFreak wants to merge 3 commits into
TaprootFreak wants to merge 3 commits into
Conversation
Contributor
Author
|
Took 3 review passes to reach a clean run. What came out of them:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of #198: move the personal IBAN wire contract into the packages so consumers no longer
need a local
useApi()wrapper for it.Changes
@dfx.swiss/coreBuyUrl.personalIban(buy/personalIban)VirtualIban,CreateVirtualIban,VirtualIbanStatusBuyApi.getPersonalIbans()andBuyApi.createPersonalIban()PersonalIbanProviderenum:normalizePersonalIban,toPersonalIbanProvider,isUnrecognizedPersonalIbanSelector,toPersonalIbanProviderRequest@dfx.swiss/reactuseVirtualIban()withgetPersonalIbans/createPersonalIbanTests cover both client methods and every selector helper (
buy-api.test.ts,personal-iban.test.ts).Notes
GET buy/personalIbannext toPOST buy/personalIban; the list endpoint is part of the same customer contract, so freezing onlythe create half would leave consumers writing a local wrapper anyway.
acceptsPaymentsis part of the response. The API returns it (whether the bank behind the IBANcurrently accepts payments, independent of
active). Consumers that modelled this response locallywithout that field silently dropped it.
PersonalIbanProviderenum instead of comparing to a single hard-coded member, so a future providerneeds no change at the call sites. Behaviour is identical for today's enum.
currency/payment-method applicability rule, and the response check against a specific bank and
account-holder name. Those encode product state that can change without a contract change, and a
published SDK that asserts them would start lying the day the API changes. URL and widget parameter
handling stays with the consumer as well, per the issue.
Additive only — no existing export changes shape, so there is nothing for downstream consumers to
migrate.
Version fields, changelogs and lockfile pins are untouched, per CONTRIBUTING.