{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["signatureVerifier","codeTabs","tab"]},"type":"markdown"},"seo":{"title":"Создание подписочного платежа","description":"Документация API 1Payment — приём платежей и выплаты.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"создание-подписочного-платежа","__idx":0},"children":["Создание подписочного платежа"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Рекуррентные платежи по ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["банковской карте"]}," позволяют списывать средства по ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["токену"]}," сохранённой карты без повторного ввода реквизитов плательщиком. При активной привязке списание выполняется через GATE (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_payment"]},")."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Для включения функционала в проекте обратитесь к сопровождающему менеджеру 1Payment."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Формат запросов и подписи — в разделе ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/init-request"},"children":["Формат запроса к API"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"принцип-работы","__idx":1},"children":["Принцип работы"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Процесс работы с подписками по картам состоит из четырёх этапов:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Первый платёж (привязка карты)"]}," — проведите ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["успешный"]}," платёж с параметром ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription=1"]}," через ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/init-form"},"children":["форму оплаты"]}," или ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/host2host"},"children":["GATE (host2host)"]},". Плательщик вводит данные карты и проходит 3-D Secure при необходимости."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Получение токена"]}," — после успешной оплаты 1Payment передаёт уникальный ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," в колбеке на ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notify_url"]}," или в ответе ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/status"},"children":["запроса статуса"]},". Сохраните его для последующих списаний."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Автосписание (рекуррент)"]}," — для повторных оплат ваш сервер вызывает GATE (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_payment"]},"), передавая сохранённый ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["вместо"]}," полей ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card_holder"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["year"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["month"]}," и ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cvc"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Уведомление"]}," — после каждой попытки списания приходит колбек с финальным результатом транзакции."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"техническая-информация","__idx":2},"children":["Техническая информация"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Этап"},"children":["Этап"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Эндпоинт"},"children":["Эндпоинт"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Методы"},"children":["Методы"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Регистрация подписки (форма)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.1payment.com/init_form"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Регистрация подписки (GATE)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.1payment.com/init_payment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Рекуррентное списание (GATE)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.1payment.com/init_payment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," (рекомендуется), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Формат ответа: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JSON"]},". Для карт в запросах GATE указывайте ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_type=card"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"1-получение-токена-первый-платёж","__idx":3},"children":["1. Получение токена (первый платёж)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Для привязки карты проведите ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["успешный"]}," платёж с параметром ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription=1"]},". Подробнее о параметрах формы и GATE — в разделах ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/init-form"},"children":["Создание платежа по форме"]}," и ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/host2host"},"children":["Создание платежа по host2host (GATE)"]},". Ниже — обязательный набор для привязки."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"обязательные-параметры-инициация-через-форму","__idx":4},"children":["Обязательные параметры (инициация через форму)"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Параметр"},"children":["Параметр"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип"},"children":["Тип"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ваш уникальный ID в системе 1Payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["project_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Идентификатор вашего проекта."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Сумма платежа при привязке (например, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["50.00"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Флаг создания подписки. Всегда ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},". Без него токен в ответе не вернётся."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ваш уникальный ID заказа для сопоставления."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shop_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL сайта, на котором совершается покупка."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sign"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Контрольная подпись (см. ниже)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"обязательные-параметры-инициация-через-gate","__idx":5},"children":["Обязательные параметры (инициация через GATE)"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Параметр"},"children":["Параметр"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип"},"children":["Тип"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ваш уникальный ID в системе 1Payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Всегда ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["project_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Идентификатор вашего проекта."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Номер банковской карты."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card_holder"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Имя держателя карты (как указано на карте)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["year"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Год окончания действия карты, две последние цифры (например, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["22"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["month"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Месяц окончания действия карты (например, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["01"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cvc"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["CVV/CVC код карты."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Сумма платежа при привязке (например, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["50.00"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Флаг создания подписки. Всегда ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},". Без него токен в ответе не вернётся."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ваш уникальный ID заказа для сопоставления."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shop_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL сайта источника платежа."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sign"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Контрольная подпись (см. ниже)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"дополнительные-параметры-инициация","__idx":6},"children":["Дополнительные параметры (инициация)"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Параметр"},"children":["Параметр"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип"},"children":["Тип"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Описание платежа."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL возврата клиента при успехе (форма)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failure_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL возврата клиента при ошибке (форма)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["return_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL возврата плательщика после оплаты (GATE)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ip"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["IP-адрес плательщика (GATE)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID плательщика в вашей системе."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Подпись при регистрации через форму"]}," — префикс ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_form"]},". ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Через GATE"]}," — префикс ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_payment"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"MD5(init_form + <параметры_без_sign_в_алфавитном_порядке_через_&> + <API_KEY>)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"MD5(init_payment + <параметры_без_sign_в_алфавитном_порядке_через_&> + <API_KEY>)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["После финального статуса ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SUCCESS"]}," сохраните значение ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," из колбека или из ответа ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/status"},"children":["Статусы платежей"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"2-рекуррентное-списание-повторные-платежи","__idx":7},"children":["2. Рекуррентное списание (повторные платежи)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Для автоматического списания отправьте запрос на GATE с сохранённым ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]},". ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Не передавайте"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card_holder"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["year"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["month"]}," и ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cvc"]}," — вместо них используется только ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"обязательные-параметры-рекуррент","__idx":8},"children":["Обязательные параметры (рекуррент)"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Параметр"},"children":["Параметр"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип"},"children":["Тип"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ваш уникальный ID в системе 1Payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Всегда ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["project_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Идентификатор вашего проекта."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Сумма очередного списания (например, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["500.00"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Токен, полученный при первом успешном платеже (из колбека или запроса статуса)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Новый уникальный ID транзакции на вашей стороне."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shop_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL сайта источника платежа."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sign"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Контрольная подпись (префикс ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_payment"]},")."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"дополнительные-параметры-рекуррент","__idx":9},"children":["Дополнительные параметры (рекуррент)"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Параметр"},"children":["Параметр"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип"},"children":["Тип"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Описание платежа."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ip"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["IP-адрес плательщика."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["return_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL возврата плательщика после оплаты."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID плательщика в вашей системе."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"формирование-подписи--sign-","__idx":10},"children":["Формирование подписи (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sign"]},")"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Подпись: MD5, lowercase (hex). Общие правила — ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/init-request#%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%81%D1%8C-%D0%B7%D0%B0%D0%BF%D1%80%D0%BE%D1%81%D0%B0-sign"},"children":["Формат запроса к API"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Формула:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"MD5(init_payment + <параметры_без_sign_в_алфавитном_порядке_через_&> + <API_KEY>)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Пример строки до хеширования:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"init_paymentamount=500.00&partner_id=1234&payment_type=card&project_id=5678&shop_url=https://test.com&token=card_t_1a2b3c&user_data=card_order_888secret_key\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"проверка-подписи-рекуррентное-списание","__idx":11},"children":["Проверка подписи (рекуррентное списание)"]},{"$$mdtype":"Tag","name":"SignatureVerifier","attributes":{"method":"init_payment","preset":"card_recurring_payment"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"примеры-запроса","__idx":12},"children":["Примеры запроса"]},{"$$mdtype":"Tag","name":"CodeTabs","attributes":{},"children":[{"$$mdtype":"Tag","name":"Tab","attributes":{"label":"Node.js"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const crypto = require('crypto');\nconst axios = require('axios');\n\n// 1. Инициация подписки через форму (первичная привязка)\nasync function setupCardSubscriptionForm(apiKey, params) {\n  const sortedKeys = Object.keys(params).sort();\n  const queryString = sortedKeys.map((k) => `${k}=${params[k]}`).join('&');\n\n  const baseString = `init_form${queryString}${apiKey}`;\n  params.sign = crypto.createHash('md5').update(baseString).digest('hex');\n\n  const response = await axios.post('https://api.1payment.com/init_form', params);\n  return response.data; // поле url — ссылка на форму\n}\n\n// 2. Инициация подписки через GATE\nasync function setupCardSubscriptionGate(apiKey, params) {\n  const sortedKeys = Object.keys(params).sort();\n  const queryString = sortedKeys.map((k) => `${k}=${params[k]}`).join('&');\n\n  const baseString = `init_payment${queryString}${apiKey}`;\n  params.sign = crypto.createHash('md5').update(baseString).digest('hex');\n\n  const response = await axios.post('https://api.1payment.com/init_payment', params);\n  return response.data; // redirect_url при необходимости 3-D Secure\n}\n\n// 3. Рекуррентное списание (по токену)\nasync function chargeCardByToken(apiKey, params) {\n  const sortedKeys = Object.keys(params).sort();\n  const queryString = sortedKeys.map((k) => `${k}=${params[k]}`).join('&');\n\n  const baseString = `init_payment${queryString}${apiKey}`;\n  params.sign = crypto.createHash('md5').update(baseString).digest('hex');\n\n  const response = await axios.post('https://api.1payment.com/init_payment', params);\n  return response.data;\n}\n\nconst apiKey = process.env.ONEPAYMENT_API_KEY;\n\n// Пример: привязка через форму\nconst setupFormData = {\n  partner_id: 1234,\n  project_id: 5678,\n  amount: '50.00',\n  subscription: 1,\n  user_data: 'card_setup_777',\n  shop_url: 'https://test.com',\n};\n// setupCardSubscriptionForm(apiKey, setupFormData).then(console.log);\n\n// Пример: привязка через GATE\nconst setupGateData = {\n  partner_id: 1234,\n  payment_type: 'card',\n  project_id: 5678,\n  account: '4111111111111111',\n  card_holder: 'TEST',\n  year: '22',\n  month: '01',\n  cvc: '111',\n  amount: '50.00',\n  subscription: 1,\n  user_data: 'card_setup_777',\n  shop_url: 'https://test.com',\n};\n// setupCardSubscriptionGate(apiKey, setupGateData).then(console.log);\n\n// Пример: списание\nconst recurringData = {\n  partner_id: 1234,\n  payment_type: 'card',\n  project_id: 5678,\n  token: 'card_t_1a2b3c',\n  amount: '500.00',\n  user_data: 'card_order_888',\n  shop_url: 'https://test.com',\n};\nchargeCardByToken(apiKey, recurringData).then(console.log);\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"Tab","attributes":{"label":"Python"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import hashlib\nimport os\nimport requests\n\ndef setup_card_subscription_form(api_key: str, params: dict) -> dict:\n    sorted_keys = sorted(params.keys())\n    query_string = \"&\".join(f\"{k}={params[k]}\" for k in sorted_keys)\n    base_string = f\"init_form{query_string}{api_key}\"\n    params[\"sign\"] = hashlib.md5(base_string.encode(\"utf-8\")).hexdigest()\n    response = requests.post(\"https://api.1payment.com/init_form\", data=params)\n    response.raise_for_status()\n    return response.json()\n\ndef setup_card_subscription_gate(api_key: str, params: dict) -> dict:\n    sorted_keys = sorted(params.keys())\n    query_string = \"&\".join(f\"{k}={params[k]}\" for k in sorted_keys)\n    base_string = f\"init_payment{query_string}{api_key}\"\n    params[\"sign\"] = hashlib.md5(base_string.encode(\"utf-8\")).hexdigest()\n    response = requests.post(\"https://api.1payment.com/init_payment\", data=params)\n    response.raise_for_status()\n    return response.json()\n\ndef charge_card_by_token(api_key: str, params: dict) -> dict:\n    sorted_keys = sorted(params.keys())\n    query_string = \"&\".join(f\"{k}={params[k]}\" for k in sorted_keys)\n    base_string = f\"init_payment{query_string}{api_key}\"\n    params[\"sign\"] = hashlib.md5(base_string.encode(\"utf-8\")).hexdigest()\n    response = requests.post(\"https://api.1payment.com/init_payment\", data=params)\n    response.raise_for_status()\n    return response.json()\n\napi_key = os.environ[\"ONEPAYMENT_API_KEY\"]\n\nsetup_form_data = {\n    \"partner_id\": 1234,\n    \"project_id\": 5678,\n    \"amount\": \"50.00\",\n    \"subscription\": 1,\n    \"user_data\": \"card_setup_777\",\n    \"shop_url\": \"https://test.com\",\n}\n# print(setup_card_subscription_form(api_key, setup_form_data))\n\nsetup_gate_data = {\n    \"partner_id\": 1234,\n    \"payment_type\": \"card\",\n    \"project_id\": 5678,\n    \"account\": \"4111111111111111\",\n    \"card_holder\": \"TEST\",\n    \"year\": \"22\",\n    \"month\": \"01\",\n    \"cvc\": \"111\",\n    \"amount\": \"50.00\",\n    \"subscription\": 1,\n    \"user_data\": \"card_setup_777\",\n    \"shop_url\": \"https://test.com\",\n}\n# print(setup_card_subscription_gate(api_key, setup_gate_data))\n\nrecurring_data = {\n    \"partner_id\": 1234,\n    \"payment_type\": \"card\",\n    \"project_id\": 5678,\n    \"token\": \"card_t_1a2b3c\",\n    \"amount\": \"500.00\",\n    \"user_data\": \"card_order_888\",\n    \"shop_url\": \"https://test.com\",\n}\nprint(charge_card_by_token(api_key, recurring_data))\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"Tab","attributes":{"label":"PHP"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"<?php\n\nfunction signParams(string $prefix, string $apiKey, array $params): array\n{\n    ksort($params, SORT_LOCALE_STRING);\n    $tail = '';\n    foreach ($params as $k => $v) {\n        if ($k === 'sign') {\n            continue;\n        }\n        $tail .= \"{$k}={$v}&\";\n    }\n    $tail = substr($tail, 0, -1);\n    $params['sign'] = md5($prefix . $tail . $apiKey);\n    return $params;\n}\n\nfunction setupCardSubscriptionForm(string $apiKey, array $params): string\n{\n    $params = signParams('init_form', $apiKey, $params);\n    $ch = curl_init('https://api.1payment.com/init_form');\n    curl_setopt($ch, CURLOPT_POST, true);\n    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));\n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n    $response = curl_exec($ch);\n    curl_close($ch);\n    return $response;\n}\n\nfunction setupCardSubscriptionGate(string $apiKey, array $params): string\n{\n    $params = signParams('init_payment', $apiKey, $params);\n    $ch = curl_init('https://api.1payment.com/init_payment');\n    curl_setopt($ch, CURLOPT_POST, true);\n    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));\n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n    $response = curl_exec($ch);\n    curl_close($ch);\n    return $response;\n}\n\nfunction chargeCardByToken(string $apiKey, array $params): string\n{\n    $params = signParams('init_payment', $apiKey, $params);\n    $ch = curl_init('https://api.1payment.com/init_payment');\n    curl_setopt($ch, CURLOPT_POST, true);\n    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));\n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n    $response = curl_exec($ch);\n    curl_close($ch);\n    return $response;\n}\n\n$apiKey = getenv('ONEPAYMENT_API_KEY');\n\n$setupFormData = [\n    'partner_id' => 1234,\n    'project_id' => 5678,\n    'amount' => '50.00',\n    'subscription' => 1,\n    'user_data' => 'card_setup_777',\n    'shop_url' => 'https://test.com',\n];\n// echo setupCardSubscriptionForm($apiKey, $setupFormData);\n\n$setupGateData = [\n    'partner_id' => 1234,\n    'payment_type' => 'card',\n    'project_id' => 5678,\n    'account' => '4111111111111111',\n    'card_holder' => 'TEST',\n    'year' => '22',\n    'month' => '01',\n    'cvc' => '111',\n    'amount' => '50.00',\n    'subscription' => 1,\n    'user_data' => 'card_setup_777',\n    'shop_url' => 'https://test.com',\n];\n// echo setupCardSubscriptionGate($apiKey, $setupGateData);\n\n$recurringData = [\n    'partner_id' => 1234,\n    'payment_type' => 'card',\n    'project_id' => 5678,\n    'token' => 'card_t_1a2b3c',\n    'amount' => '500.00',\n    'user_data' => 'card_order_888',\n    'shop_url' => 'https://test.com',\n];\necho chargeCardByToken($apiKey, $recurringData);\n","lang":"php"},"children":[]}]},{"$$mdtype":"Tag","name":"Tab","attributes":{"label":"cURL"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Привязка через форму: sign = md5(\"init_form\" + amount=50.00&partner_id=1234&project_id=5678&shop_url=...&subscription=1&user_data=... + API_KEY)\ncurl -sS -X POST \"https://api.1payment.com/init_form\" \\\n  -d \"partner_id=1234&project_id=5678&amount=50.00&subscription=1&user_data=card_setup_777&shop_url=https%3A%2F%2Ftest.com&sign=PASTE_MD5_HEX\"\n\n# Рекуррент: sign = md5(\"init_payment\" + amount=500.00&partner_id=1234&payment_type=card&project_id=5678&shop_url=...&token=...&user_data=... + API_KEY)\ncurl -sS -X POST \"https://api.1payment.com/init_payment\" \\\n  -d \"partner_id=1234&payment_type=card&project_id=5678&token=card_t_1a2b3c&amount=500.00&user_data=card_order_888&shop_url=https%3A%2F%2Ftest.com&sign=PASTE_MD5_HEX\"\n","lang":"bash"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ответ-api","__idx":13},"children":["Ответ API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["При успешном ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["рекуррентном"]}," запросе (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},"):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"order_id\": \"8p3brmb19gfg0sg8gcwhws8kgc748s87\",\n  \"status\": 2,\n  \"status_description\": \"PENDING\",\n  \"status_code\": 0\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Поле"},"children":["Поле"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID платежа в системе 1Payment; используйте для ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/status"},"children":["запроса статуса"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Числовой код состояния (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2"]}," — ожидание)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Текстовое описание статуса (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PENDING"]}," и др.)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_code"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Код ошибки при отказе (см. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/decline-error-codes"},"children":["коды отказов"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redirect_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL для 3-D Secure, если требуется дополнительная аутентификация (может отсутствовать)."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["При ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["первом платеже с ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription=1"]}," через форму"]}," в ответе будет поле ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}," (см. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/init-form"},"children":["Создание платежа по форме"]},"); через GATE — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redirect_url"]}," при необходимости 3-D Secure (см. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/host2host"},"children":["Создание платежа по host2host (GATE)"]},"). После успешной оплаты поле ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," приходит в колбеке на ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notify_url"]}," или в ответе ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/status"},"children":["запроса статуса"]}," — без ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription=1"]}," токен не выдаётся."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ошибка запроса (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]},"):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"error_code\": 2\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"уведомления-о-статусе-колбеки","__idx":14},"children":["Уведомления о статусе (колбеки)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["При успешной привязке карты или рекуррентном списании система отправляет ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["POST"]},"-запрос в формате JSON на ваш ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notify_url"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Параметр"},"children":["Параметр"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип"},"children":["Тип"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Обяз."},"children":["Обяз."]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Тип платежа (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID платежа в системе 1Payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["project_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID вашего проекта."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Состояние: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2"]}," (ожидание), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3"]}," (успех), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4"]}," (отказ)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PENDING"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SUCCESS"]}," или ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FAILURE"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_time"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Время создания платежа."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_time"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Время получения финального статуса."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchant_price"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Стоимость для плательщика."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_price"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Нет"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Сумма при инициации."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_price"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Отчисления партнёра."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["currency"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Валюта платежа (ISO 4217)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Маска номера карты."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID транзакции, переданный при создании."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sign"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Контрольная подпись колбека."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Нет"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Токен для последующих списаний — ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["сохраните"]}," при первом успешном платеже."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["test"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Нет"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," при тестовых платежах."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_code"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Нет"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Код причины отказа."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Важно:"]}," ваш сервер должен вернуть ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HTTP 200 OK"]},". Иначе система повторяет отправку колбека ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["раз в минуту в течение 10 минут"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Проверка подписи колбека:"]}," MD5 от всех параметров в алфавитном порядке через ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["&"]}," + ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_KEY"]}," (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["без"]}," префикса ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_payment"]},"). Подробнее — в разделе ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/init-request#%D0%BA%D0%BE%D0%BB%D0%B1%D0%B5%D0%BA%D0%B8-%D1%83%D0%B2%D0%B5%D0%B4%D0%BE%D0%BC%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F"},"children":["Формат запроса к API"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Токен также можно получить через ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/status"},"children":["запрос статуса платежа"]}," — поле ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," в ответе API."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"связанные-разделы","__idx":15},"children":["Связанные разделы"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/init-form"},"children":["Создание платежа по форме"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/host2host"},"children":["Создание платежа по host2host (GATE)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/status"},"children":["Статусы платежей"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/card/refund"},"children":["Возвраты платежей"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/transaction-statuses"},"children":["Статусы транзакций"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/error-codes-api"},"children":["Коды ошибок (API)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/decline-error-codes"},"children":["Коды ошибок (отказы)"]}]}]}]},"headings":[{"value":"Создание подписочного платежа","id":"создание-подписочного-платежа","depth":1},{"value":"Принцип работы","id":"принцип-работы","depth":2},{"value":"Техническая информация","id":"техническая-информация","depth":2},{"value":"1. Получение токена (первый платёж)","id":"1-получение-токена-первый-платёж","depth":2},{"value":"Обязательные параметры (инициация через форму)","id":"обязательные-параметры-инициация-через-форму","depth":3},{"value":"Обязательные параметры (инициация через GATE)","id":"обязательные-параметры-инициация-через-gate","depth":3},{"value":"Дополнительные параметры (инициация)","id":"дополнительные-параметры-инициация","depth":3},{"value":"2. Рекуррентное списание (повторные платежи)","id":"2-рекуррентное-списание-повторные-платежи","depth":2},{"value":"Обязательные параметры (рекуррент)","id":"обязательные-параметры-рекуррент","depth":3},{"value":"Дополнительные параметры (рекуррент)","id":"дополнительные-параметры-рекуррент","depth":3},{"value":"Формирование подписи ( sign )","id":"формирование-подписи--sign-","depth":3},{"value":"Проверка подписи (рекуррентное списание)","id":"проверка-подписи-рекуррентное-списание","depth":3},{"value":"Примеры запроса","id":"примеры-запроса","depth":2},{"value":"Ответ API","id":"ответ-api","depth":2},{"value":"Уведомления о статусе (колбеки)","id":"уведомления-о-статусе-колбеки","depth":2},{"value":"Связанные разделы","id":"связанные-разделы","depth":2}],"frontmatter":{"seo":{"title":"Создание подписочного платежа"}},"lastModified":"2026-07-03T08:42:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/pages/card/recurring","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}