Вызовите функцию
paywall.getUser()
чтобы получить информацию о пользователе, данные о совпадении страны с настройками таргетинга пейволла, а также баланс (если токенизация включена). Если юзер не авторизован будет возвращена ошибка 401 { error: 'Unauthorized', countryMatch: boolean, tier: 1 | 2 | 3, country: string }
, иначе вы получите следующий объект:В случае если у пользователя есть активная подписка либо лайфтайм платеж
paid
равен true
Статусы подписки
СТАТУС | ОПИСАНИЕ |
active | Подписка в активном состоянии, и последний платеж прошел успешно. Вы можете безопасно предоставить ваш продукт клиенту. |
incomplete | Успешный платеж должен быть произведен в течение 23 часов для активации подписки. Или платеж требует действия, например, аутентификации клиента. |
incomplete_expired | The initial payment on the subscription failed and no successful payment was made within 23 hours of creating the subscription. These subscriptions don’t bill customers. This status exists so you can track customers that failed to activate their subscriptions. |
past_due | Payment on the latest finalized invoice either failed or wasn’t attempted. The subscription continues to create invoices. If the invoice is still unpaid after all Smart Retries have been attempted, you can configure the subscription to move to canceled , unpaid , or leave it as past_due . To move the subscription to active , pay the most recent invoice before its due date. |
canceled | Подписка была отменена. Это конечный статус и он не может быть обновлен. |
unpaid | The latest invoice hasn’t been paid but the subscription remains in place. The latest invoice remains open and invoices continue to be generated but payments aren’t attempted. You should revoke access to your product when the subscription is unpaid since payments were already attempted and retried when it was past_due . To move the subscription to active , pay the most recent invoice before its due date. |