Skip to content

Fall back to the collection account when a personal IBAN cannot be issued - #4580

Merged
TaprootFreak merged 2 commits into
developfrom
feat/collection-iban-fallback-on-viban-failure
Aug 1, 2026
Merged

Fall back to the collection account when a personal IBAN cannot be issued#4580
TaprootFreak merged 2 commits into
developfrom
feat/collection-iban-fallback-on-viban-failure

Conversation

@TaprootFreak

Copy link
Copy Markdown
Collaborator

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

  • Only on real issuance failure for an eligible customer. A customer below KYC 50 still gets KycRequired; an unsupported currency still gets PersonalIbanCurrencyNotSupported. The personal-IBAN / KYC coupling is unchanged.
  • Only with a reference. The collection account is shared, so the incoming transfer is attributed through the per-buy reference. Without a reference the transfer cannot be matched to a customer, so it is never shown — the request still fails in that case.
  • Always logged at ERROR. The customer no longer sees an error, so the failure is logged at ERROR to keep a provider outage visible in monitoring.
  • Both the explicit-provider path and the user-level path share one collectionAccountOrThrow helper, so they degrade identically.

Files

  • buy.service.tsresolveBankInfo (explicit + user-level paths) and the new collectionAccountOrThrow helper; DfxLogger added.
  • 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

tsc and Prettier are clean on the changed files. The full buy.service.spec suite 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.

…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.
@TaprootFreak
TaprootFreak marked this pull request as ready for review August 1, 2026 15:32
@TaprootFreak
TaprootFreak merged commit be9a273 into develop Aug 1, 2026
12 checks passed
@TaprootFreak
TaprootFreak deleted the feat/collection-iban-fallback-on-viban-failure branch August 1, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant