Fall back to the collection account when a personal IBAN cannot be issued - #4580
Merged
TaprootFreak merged 2 commits intoAug 1, 2026
Merged
Conversation
…uance fails When a personal IBAN cannot be issued for an eligible bank-transfer customer (e.g. the provider is temporarily unavailable), show the shared collection account with the per-buy reference instead of failing the request. The reference keeps the incoming transfer attributable, so the collection account is shown only when a reference is present; without one the request still fails. The failure is logged at ERROR regardless, so a provider outage stays visible even though the customer no longer sees an error. A customer below KYC 50 keeps getting KYC_REQUIRED, and unsupported currencies keep getting the currency error - the personal-IBAN/KYC coupling is unchanged. Both the explicit-provider path and the user-level path share one collectionAccountOrThrow helper.
The two negative tests (no collection account resolves) did not stub bankService.getBank, so the default mock returned a truthy bank and the new fallback resolved instead of throwing. Stub getBank to undefined so both pin the no-fallback path: a transient issuance error surfaces as PersonalIbanIssuanceFailed rather than degrading to the transfer fallback.
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.
What
When a personal IBAN cannot be issued for an eligible bank-transfer customer (for example while the personal-IBAN provider is temporarily unavailable), the buy flow now shows the shared collection account with the per-buy reference instead of failing the request outright.
Previously this case threw
PersonalIbanIssuanceFailed, leaving an eligible customer with no way to pay in during an outage.Rules
KycRequired; an unsupported currency still getsPersonalIbanCurrencyNotSupported. The personal-IBAN / KYC coupling is unchanged.collectionAccountOrThrowhelper, so they degrade identically.Files
buy.service.ts—resolveBankInfo(explicit + user-level paths) and the newcollectionAccountOrThrowhelper;DfxLoggeradded.buy.service.spec.ts— new cases (fallback with reference + ERROR log; no-reference still fails; explicit-provider fallback) and existing issuance-failure cases updated for the new getBank call.Verification note
tscand Prettier are clean on the changed files. The fullbuy.service.specsuite could not be run to green locally (the build host stalled on this large suite); the test changes are derived by inspection and rely on CI here for execution — please treat the CI test result as the gate.