mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 17:03:15 +00:00
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:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user