fix(core): moved merchant fingerprint secret from superposition to merchant account table#13346
Conversation
Changed Files
|
…osition-to-merchant-account-table
| true => Err(errors::ApiErrorResponse::InternalServerError) | ||
| .attach_printable("fingerprint_secret not found in Superposition for merchant"), | ||
| } | ||
| merchant_account |
There was a problem hiding this comment.
We should have superposition as a fallback for now if the value is not found. We already have several fingerprint_secrets stored in superposition. We will need to migrate them to the merchant table before we can deploy this change.
This is easy enough for us, but this will also impact the self hosted merchants who are using superposition. If they miss the migration before the new deployment they might start experiencing transaction failures.
Ideally migrations like this should be automatically done in the background on application startup or as a background job and should be transparent to the self hosted merchant.
|
[blocking] Please add a migration/backfill or a read fallback for existing merchants before switching fingerprint generation to |
|
[blocking] The merchant-account migration adds Please either backfill |
Type of Change
Description
moved merchant fingerprint secret from superposition to merchant account table
Additional Changes
Overview
The PR moves the
fingerprint_secretfor merchants from the dynamic configuration service (Superposition) into the primary database as a direct column on themerchant_accounttable. This simplifies data retrieval and reduces the dependency on external config services for fingerprinting payments (used in blocklists).Key Changes
Database Schema & Migrations
2026-07-16-000001_add_fingerprint_secret_to_merchant_account) toADD COLUMN IF NOT EXISTS fingerprint_secret VARCHAR(128)to themerchant_accounttable.schema.rsandschema_v2.rsindiesel_modelsto reflect the new column.Model Updates
MerchantAccount,MerchantAccountSetter, andMerchantAccountNewstructs in bothdiesel_modelsandhyperswitch_domain_modelsto include thefingerprint_secret: Option<Secret<String>>field.Core Logic Refactoring (Blocklist & Routing)
insert_merchant_configs_with_superpositionfromcrates/router/src/core/admin.rs.fingerprint_secretis now immediately embedded and saved with the newMerchantAccountrecord.get_merchant_fingerprint_secretandgenerate_payment_fingerprintincrates/router/src/core/blocklist/utils.rs. They no longer require Superposition dimensions/state to fetch the secret; they simply extract it directly from the passedMerchantAccountobject.Configuration & Cleanup
FINGERPRINT_SECRETentry fromconfig/superposition_seed.toml.FINGERPRINT_SECRETmacros and writable config implementations indimension_config.rs.get_merchant_fingerprint_secret_key) acrossconsts.rsandmerchant.rs.Motivation and Context
Currently we are pushing merchant fingerprint to superposition and then fetching from superposition for further usecase, But merchant fingerprint is a merchant account property and not superposition property so we are moving back merchant fingerprint to merchant account table from superposition.
How did you test it?
Create merchant account
Checked if fingerprint secret is set in the table or not
Checklist
cargo +nightly fmt --allcargo clippy