fix(wallet): offer Google Wallet only where it works, and never post it to the Apple route

- GET /api/trips/:tripId/reservations/google-wallet answers whether this
  server can make Google Wallet passes: passes on, and the TREK services'
  signer with its Google route mounted (it is once liketrek has a Wallet
  issuer). The probe is kept for ten minutes.
- The Google route is derived from TREK_WALLET_SIGNER_URL by its path, the
  query kept; a signer URL that does not end in /pass has none, and the
  booking is refused with a 404 instead of going to the Apple signer.
- End-to-end tests for the save link: owner, stranger, another trip, no
  issuer yet, a link that is not Google Wallet, and the availability.
- Italian and Hungarian wording of the button.
This commit is contained in:
Maurice
2026-11-07 14:50:17 +01:00
parent 924836be31
commit 99a8701bd4
8 changed files with 185 additions and 9 deletions
@@ -412,3 +412,10 @@ export const googleWalletSaveResponseSchema = z.object({
saveUrl: z.string().url().startsWith('https://pay.google.com/gp/v/save/'),
});
export type GoogleWalletSaveResponse = z.infer<typeof googleWalletSaveResponseSchema>;
/**
* GET /api/trips/:tripId/reservations/google-wallet: whether this server can make
* Google Wallet passes right now (passes on, and liketrek's Wallet issuer live).
*/
export const googleWalletAvailabilityResponseSchema = z.object({ available: z.boolean() });
export type GoogleWalletAvailabilityResponse = z.infer<typeof googleWalletAvailabilityResponseSchema>;