feat(gift): transferable gift claim — buyer share link + recipient claim page

Pairs with the bot's unified claimable-gift model. A landing gift now lands on
the buyer's success page as PAID/claimable (deferred) instead of being delivered
to a phantom recipient, so the buyer gets a transferable link to forward and the
recipient claims it themselves — guaranteeing delivery regardless of channel or
whether they pre-exist.

- api/landings.ts: PurchaseStatus gains is_claimable/claim_url/bot_claim_link;
  add GiftClaimResult + getGiftClaim()/claimGift().
- PurchaseSuccess.tsx: GiftLinkShareState — buyer sees the claim link + Telegram
  link + copy-message when a gift is PAID/claimable; stop polling for that state
  (it stays PAID until claimed) instead of spinning forever.
- GiftClaim.tsx (new) + /buy/gift/:token route: public recipient claim page with
  a Telegram arm (GIFT_ deep link) and a web/email arm (binds + one-click login),
  polling while the payment settles, idempotent "already claimed" + 404 states.
- i18n: landing.giftClaim.* / landing.giftLink.* in ru/en/zh/fa.
This commit is contained in:
c0mrade
2026-06-03 13:46:00 +03:00
parent 71047780c9
commit db31d395cd
8 changed files with 579 additions and 1 deletions

View File

@@ -4834,6 +4834,34 @@
"merging": "Merging..."
},
"landing": {
"giftClaim": {
"title": "You have a gift!",
"error": "Could not activate the gift.",
"notFoundTitle": "Gift not found",
"notFoundDesc": "This gift link is invalid or no longer available.",
"alreadyTitle": "Gift already activated",
"alreadyDesc": "This gift has already been claimed.",
"successTitle": "Gift activated!",
"connectDesc": "Use this link to connect:",
"copyLink": "Copy link",
"pendingTitle": "Almost ready…",
"pendingDesc": "The payment is still being confirmed. This page will update automatically.",
"replaceWarning": "You already have a subscription — activating this gift will replace it.",
"activateTelegram": "Activate in Telegram",
"activateWeb": "Activate by email",
"emailLabel": "Your email",
"claimNow": "Get my gift"
},
"giftLink": {
"shareText": "I have a gift for you! Activate it here:",
"viaTelegram": "Telegram:",
"title": "Gift is ready!",
"subtitle": "Send this link to whoever you want to receive the gift — they activate it themselves.",
"linkLabel": "Gift link",
"telegramLabel": "Telegram link",
"alsoSent": "We also emailed it to {{contact}}.",
"copyMessage": "Copy message"
},
"notFound": "Page not found",
"forMe": "For me",
"asGift": "As a gift",

View File

@@ -4494,6 +4494,34 @@
"merging": "در حال ادغام..."
},
"landing": {
"giftClaim": {
"title": "شما یک هدیه دارید!",
"error": "فعال‌سازی هدیه ناموفق بود.",
"notFoundTitle": "هدیه یافت نشد",
"notFoundDesc": "این لینک هدیه نامعتبر یا دیگر در دسترس نیست.",
"alreadyTitle": "هدیه قبلاً فعال شده است",
"alreadyDesc": "این هدیه قبلاً دریافت شده است.",
"successTitle": "هدیه فعال شد!",
"connectDesc": "از این لینک برای اتصال استفاده کنید:",
"copyLink": "کپی لینک",
"pendingTitle": "تقریباً آماده است…",
"pendingDesc": "پرداخت در حال تأیید است. این صفحه به‌طور خودکار به‌روزرسانی می‌شود.",
"replaceWarning": "شما در حال حاضر اشتراک دارید — فعال‌سازی این هدیه جایگزین آن خواهد شد.",
"activateTelegram": "فعال‌سازی در تلگرام",
"activateWeb": "فعال‌سازی با ایمیل",
"emailLabel": "ایمیل شما",
"claimNow": "دریافت هدیه"
},
"giftLink": {
"shareText": "یک هدیه برای شما دارم! اینجا فعال کنید:",
"viaTelegram": "تلگرام:",
"title": "هدیه آماده است!",
"subtitle": "این لینک را برای کسی که می‌خواهید هدیه را دریافت کند بفرستید — خودش آن را فعال می‌کند.",
"linkLabel": "لینک هدیه",
"telegramLabel": "لینک تلگرام",
"alsoSent": "آن را به {{contact}} نیز ایمیل کردیم.",
"copyMessage": "کپی پیام"
},
"notFound": "صفحه یافت نشد",
"forMe": "برای خودم",
"asGift": "به عنوان هدیه",

View File

@@ -5389,6 +5389,34 @@
"merging": "Объединение..."
},
"landing": {
"giftClaim": {
"title": "Вам подарок!",
"error": "Не удалось активировать подарок.",
"notFoundTitle": "Подарок не найден",
"notFoundDesc": "Ссылка на подарок недействительна или больше недоступна.",
"alreadyTitle": "Подарок уже активирован",
"alreadyDesc": "Этот подарок уже забрали.",
"successTitle": "Подарок активирован!",
"connectDesc": "Используйте эту ссылку для подключения:",
"copyLink": "Скопировать ссылку",
"pendingTitle": "Почти готово…",
"pendingDesc": "Оплата ещё подтверждается. Страница обновится автоматически.",
"replaceWarning": "У вас уже есть подписка — активация подарка заменит её.",
"activateTelegram": "Активировать в Telegram",
"activateWeb": "Активировать по почте",
"emailLabel": "Ваш email",
"claimNow": "Получить подарок"
},
"giftLink": {
"shareText": "Дарю вам подписку! Активируйте здесь:",
"viaTelegram": "Telegram:",
"title": "Подарок готов!",
"subtitle": "Отправьте эту ссылку тому, кому предназначен подарок — он активирует его сам.",
"linkLabel": "Ссылка на подарок",
"telegramLabel": "Ссылка для Telegram",
"alsoSent": "Мы также отправили её на {{contact}}.",
"copyMessage": "Скопировать сообщение"
},
"notFound": "Страница не найдена",
"forMe": "Для себя",
"asGift": "В подарок",

View File

@@ -4493,6 +4493,34 @@
"merging": "合并中..."
},
"landing": {
"giftClaim": {
"title": "您收到一份礼物!",
"error": "无法激活礼物。",
"notFoundTitle": "未找到礼物",
"notFoundDesc": "此礼物链接无效或已不可用。",
"alreadyTitle": "礼物已激活",
"alreadyDesc": "此礼物已被领取。",
"successTitle": "礼物已激活!",
"connectDesc": "使用此链接连接:",
"copyLink": "复制链接",
"pendingTitle": "即将完成…",
"pendingDesc": "付款仍在确认中。本页面将自动更新。",
"replaceWarning": "您已有订阅——激活此礼物将替换它。",
"activateTelegram": "在 Telegram 中激活",
"activateWeb": "通过邮箱激活",
"emailLabel": "您的邮箱",
"claimNow": "领取礼物"
},
"giftLink": {
"shareText": "我送您一份订阅!在此激活:",
"viaTelegram": "Telegram",
"title": "礼物已就绪!",
"subtitle": "将此链接发送给您想赠送的人——他们自行激活。",
"linkLabel": "礼物链接",
"telegramLabel": "Telegram 链接",
"alsoSent": "我们也已发送到 {{contact}}。",
"copyMessage": "复制消息"
},
"notFound": "页面未找到",
"forMe": "为自己",
"asGift": "作为礼物",