Bon Voyage and Zopa Start Flow
Purpose
This page documents the runtime handoff from Finance Assistant enquiry to Bon Voyage lender launch, with the current Zopa path used by finmatch.io (FM-1234-5678-9102).
Runtime Path
Primary runtime files:
https://storage.googleapis.com/finmatch-p/scripts/finance-assistant.jshttps://storage.googleapis.com/finmatch-p/scripts/bon-voyage.jshttps://storage.googleapis.com/finmatch-p/scripts/start-finance-application-registry.jshttps://storage.googleapis.com/finmatch-p/scripts/start-finance-application-request-builders.js
Server/proxy path:
- Cloudflare proxy route:
/api/lenders/start/zopa/finance-application - Cloud Run route:
/api/lenders/start/zopa/finance-application
Sequence
- Enquiry submit CTA triggers
runSubmitFlow()infinance-assistant.js. buildStartFinanceApplicationFromRegistry()builds a lender-specific payload.- Bon Voyage renders with
startFinanceApplicationmetadata. bon-voyage.jsdetects Zopa flow and calls:${apiBaseUrl}/api/lenders/start/zopa/finance-application
- Cloudflare worker forwards the request with merchant API key to Cloud Run Finance Assistant.
- Cloud Run Zopa handler validates payload and merchant config, then returns:
hashwidgetScriptUrlenvironmentorderId
- Browser loads
widgetScriptUrl, initializesVendigoWidget, and opens withhash.
FM-1234-5678-9102 (finmatch.io) Notes
For this merchant, Zopa can be initiated from Bon Voyage when:
- Finance Assistant is enabled for lender
zopa. - Merchant uses proxy URL:
https://finance-assistant-proxy.james-84d.workers.dev/
- Merchant has valid Zopa config saved in admin:
zopa.enabledzopa.defaultEnvironmentzopa.sandbox/live.publicKeyzopa.sandbox/live.secretKey(write-only in admin UI)- optional
zopa.sandbox/live.baseUrl
What "Direct from Finance Assistant" Means
In this implementation, "direct" means the user starts the Zopa application from Finance Assistant Bon Voyage without relying on a manual merchant redirect URL flow. The browser still uses FinMatch proxy/backend to securely obtain the signed widget hash (secret key never leaves backend).
Troubleshooting
config_not_foundfrom start route:- Check merchant exists in profile store and
zopais enabled/configured.
- Check merchant exists in profile store and
public_key_missingorsecret_key_missing:- Save missing values in Admin -> Merchants -> Finance Assistant settings.
- Proxy returns missing key errors:
- Ensure Cloudflare KV
MERCHANT_KEYShas keyFM-1234-5678-9102with matching Finance Assistant API key.
- Ensure Cloudflare KV
- Widget constructor missing:
- Confirm returned
widgetScriptUrlloads and is not blocked by CSP/network.
- Confirm returned