Repository navigation
feat(pos-app): optional separate base URL for /merchants/* routes - #656
Merged
Merged
Conversation
On staging, payments are created in core (api.pay.walletconnect.org) but listed through the merchant service (staging.api.pay.walletconnect.org), which syncs from core prod; no single host serves both today. Bring back EXPO_PUBLIC_MERCHANT_DEV_API_URL (dropped in 9a93f51): when set, the payment list and email receipts (/merchants/*) use it; everything else, and both when it's unset, keeps using EXPO_PUBLIC_API_URL. - Web proxies: getMerchantApiBaseUrl() for /api/transactions and /api/send-receipt - Native: merchantApiClient for getTransactions and sendReceipt - Sentry trace propagation includes the merchant URL - .env.example and AGENTS.md document the variable Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CmgutsXzUS2j26BNUevhrE
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Claude finished @juanisierra's task in 3m 0s —— View job Code Review
Found 1 issue(s)Issue 1: Misleading error message in
|
getMerchantApiBaseUrl answered with the same "API_BASE_URL is not configured" as getApiBaseUrl, so logs didn't show which path failed or that EXPO_PUBLIC_MERCHANT_DEV_API_URL is also an option. Name both variables in its message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CmgutsXzUS2j26BNUevhrE
jakubuid
approved these changes
Oct 23, 2026
This branch was successfully deployed
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.
Summary
Brings back the optional
EXPO_PUBLIC_MERCHANT_DEV_API_URL(removed in #646). When set,/merchants/*routes use it; everything else keeps usingEXPO_PUBLIC_API_URL. When unset (or empty), both fall back toEXPO_PUBLIC_API_URL, so production behaves exactly as today.POST /merchant/payment,GET /merchant/payment/{id}/status,POST /payments/{id}/cancelEXPO_PUBLIC_API_URLGET /merchants/payments(payment list),POST /merchants/payments/{id}/receiptEXPO_PUBLIC_MERCHANT_DEV_API_URL→ falls back toEXPO_PUBLIC_API_URLWhy
#646 dropped the override as part of the email-receipt work ("Single API base URL"), but staging doesn't serve both route groups from one host yet. Since then the preview Payments list has returned
401 invalid_api_key(Maestro doesn't open Payments, so CI didn't catch it).Confirmed with the Pay backend team: payments live in core (
api.pay.walletconnect.org) while/merchants/*is served by the staging merchant service (staging.api.pay.walletconnect.org), which syncs against core prod. Aligning the staging gateway is being raised with core; until then the POS needs two base URLs on staging.Verified end to end with staging merchant
mrch_stg_L4Z43pPrSuyJfQwpqOpxg: create (201) and status (200) onapi.pay.walletconnect.org/v1, the new payment listed first onstaging.api.pay.walletconnect.org/v1/merchants/payments(200), then cancelled (200).Changes
getMerchantApiBaseUrl()inapi/_utils.ts, used by/api/transactionsand/api/send-receipt.merchantApiClientinservices/client.ts, used bygetTransactionsandsendReceipt..env.exampleandAGENTS.mddocument the variable.Config after merging
Vercel Preview (
pos-demo):Vercel Production /
POS_ENV_FILE: leaveEXPO_PUBLIC_MERCHANT_DEV_API_URLunset.POS_ENV_FILE_INTERNAL(TestFlight/Firebase internal): same values as Preview if internal builds should use the staging merchant.Once staging serves both route groups from one host, this variable can be removed again (in a PR verified against staging).
Tests
__tests__/api/base-urls.test.ts: merchant URL used when set, fallback when unset, 500 when neither is configured (fails without this change).merchantApiClient.npm test: 39 suites / 355 tests passing; lint and type checks clean for changed files.🤖 Generated with Claude Code
https://claude.ai/code/session_01CmgutsXzUS2j26BNUevhrE