{"id":503846,"date":"2026-11-18T23:33:48","date_gmt":"2026-11-18T20:33:48","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=503846"},"modified":"2026-11-18T23:33:48","modified_gmt":"2026-11-18T20:33:48","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=503846","title":{"rendered":"Payme Merchant API: \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u0448\u043b\u0451\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u0432\u0430\u0436\u0434\u044b, \u0438 \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u0442\u0435\u0441\u0442 \u0432\u0430\u0448\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435 Payme \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: \u0437\u0430\u043f\u0440\u043e\u0441\u044b <code>CreateTransaction<\/code>, <code>PerformTransaction<\/code> \u0438 <code>CancelTransaction<\/code> \u043e\u043d\u0430 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0434\u0432\u0430\u0436\u0434\u044b, \u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0432\u043f\u0430\u0441\u0442\u044c \u0441 \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439. \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u00ab\u043f\u043e \u0448\u0430\u0433\u0430\u043c\u00bb, \u043d\u0430 \u044d\u0442\u043e\u043c \u0438 \u043f\u0430\u0434\u0430\u0435\u0442. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0437-\u0437\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438: <code>perform_time: Date.now()<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u043d\u0435 \u043f\u0440\u0438\u0434\u0438\u0440\u0430\u0435\u0442\u0441\u044f. \u041e\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432 \u0431\u043e\u044e: \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043b\u0441\u044f \u043f\u043e \u0434\u043e\u0440\u043e\u0433\u0435, Payme Business \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0442\u043e\u0442 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0435\u0449\u0451 \u0440\u0430\u0437 \u0438 \u0436\u0434\u0451\u0442, \u0447\u0442\u043e \u0432\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u0435 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u0430, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043b\u0438\u0431\u043e \u043f\u043b\u0430\u0442\u0451\u0436, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0438\u0441\u0438\u0442 \u0443 Payme \u043d\u0430 \u0440\u0443\u0447\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u043e\u0440\u0435, \u043b\u0438\u0431\u043e \u0441\u0430\u043c\u044b\u0439 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0442\u0438\u043a\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435: \u00ab\u0434\u0435\u043d\u044c\u0433\u0438 \u0441\u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c, \u0430 \u0437\u0430\u043a\u0430\u0437 \u043d\u0435\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u00bb.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u2014 \u043a\u0430\u043a \u044f \u0441\u0442\u0440\u043e\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a Merchant API, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u0442\u043e\u0440 \u043b\u044e\u0431\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u044b\u043b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0435\u043d. \u041a\u043e\u0434 \u043d\u0430 TypeScript \u0438 PostgreSQL, \u043d\u043e \u043e\u0442 \u044f\u0437\u044b\u043a\u0430 \u0442\u0443\u0442 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442.<\/p>\n<h3>\u0427\u0442\u043e Payme \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0438 \u0447\u0435\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442<\/h3>\n<p>\u041f\u044f\u0442\u044c \u0444\u0430\u043a\u0442\u043e\u0432 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435.<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u2014 JSON-RPC 2.0 \u043f\u043e\u0432\u0435\u0440\u0445 HTTP POST. \u041e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e <strong>\u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c 200<\/strong>, \u0434\u0430\u0436\u0435 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443: \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0448\u0438\u0431\u043a\u0430 \u043b\u0435\u0436\u0438\u0442 \u0432 \u043f\u043e\u043b\u0435 <code>error<\/code> \u0442\u0435\u043b\u0430. \u041b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 Payme \u0437\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 <code>-32400<\/code>, \u0430 \u043d\u0435 \u043a\u0430\u043a \u0432\u0430\u0448 \u043e\u0442\u043a\u0430\u0437.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0443\u043c\u043c\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0446\u0435\u043b\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0432 <strong>\u0442\u0438\u0439\u0438\u043d\u0430\u0445<\/strong>. 15 000 \u0441\u0443\u043c\u043e\u0432 \u2014 \u044d\u0442\u043e <code>1500000<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0440\u0435\u043c\u044f \u2014 13-\u0437\u043d\u0430\u0447\u043d\u044b\u0439 timestamp \u0432 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 <code>CreateTransaction<\/code> \u0438\u043b\u0438 <code>PerformTransaction<\/code> \u043d\u0435 \u0434\u043e\u0448\u0451\u043b, Payme \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0442\u0435\u043c\u0438 \u0436\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u00ab\u0441\u043e\u0437\u0434\u0430\u043d\u0430\u00bb \u0436\u0438\u0432\u0451\u0442 12 \u0447\u0430\u0441\u043e\u0432 (43 200 000 \u043c\u0441), \u043f\u043e\u0442\u043e\u043c \u0435\u0451 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0437 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 Payme (<code>params.id<\/code>) \u2014 \u044d\u0442\u043e \u043a\u043b\u044e\u0447 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438. \u0421\u0432\u043e\u0439 \u043a\u043b\u044e\u0447 \u043f\u043e\u0432\u0435\u0440\u0445 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e. \u0410 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u00ab\u0431\u044b\u043b \u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u00bb \u0447\u0435\u0440\u0435\u0437 <code>select<\/code> \u043f\u0435\u0440\u0435\u0434 <code>insert<\/code> \u043d\u0435\u043b\u044c\u0437\u044f: \u0434\u0432\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u043e\u0439\u0434\u0443\u0442 \u0442\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043e\u0431\u0430.<\/p>\n<h3>\u0422\u0430\u0431\u043b\u0438\u0446\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0451<\/h3>\n<p>\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u044f \u0445\u0440\u0430\u043d\u044e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0437\u0430\u043a\u0430\u0437\u043e\u0432. \u0423 \u0437\u0430\u043a\u0430\u0437\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043e\u043f\u043b\u0430\u0442\u044b, \u043e\u0442\u043c\u0435\u043d\u044b \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u044b, \u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e.<\/p>\n<pre><code class=\"sql\">create table provider_txn (  id            serial primary key,  provider      text   not null,             -- 'payme' | 'click'  external_id   text   not null,             -- params.id \u043e\u0442 Payme  order_id      bigint not null references orders(id),  amount_tiyin  bigint not null,  state         smallint not null,           -- 1, 2, -1, -2  reason        smallint,  provider_time bigint,                      -- params.time, \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f GetStatement  create_time   bigint not null,             -- \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437  perform_time  bigint not null default 0,   -- \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437  cancel_time   bigint not null default 0,   -- \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437  raw_last      jsonb,  unique (provider, external_id));-- \u0423 \u0437\u0430\u043a\u0430\u0437\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 Payme, \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0435\u0439 \u043e\u043f\u043b\u0430\u0442\u044b.create unique index one_pending_per_order  on provider_txn (order_id) where provider = 'payme' and state = 1;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper\"><\/span><\/a><\/div><\/pre>\n<p>\u0414\u0432\u0435 \u0437\u0430\u0449\u0438\u0442\u044b \u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u0430\u0437\u0430, \u0430 \u043d\u0435 \u043a\u043e\u0434. \u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c <code>(provider, external_id)<\/code> \u043b\u043e\u0432\u0438\u0442 \u0433\u043e\u043d\u043a\u0443 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0443\u0431\u043b\u0435\u0439. \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u0435 \u0434\u0430\u0451\u0442 \u0437\u0430\u043a\u0430\u0437\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0443\u044e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e. \u041e\u0431\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0438 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e.<\/p>\n<p>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u00ab\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437\u00bb \u0443 \u0442\u0440\u0451\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u043d\u0435 \u0443\u043a\u0440\u0430\u0448\u0435\u043d\u0438\u0435. \u041d\u0430 \u043d\u0438\u0445 \u0438 \u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430.<\/p>\n<h3>\u0427\u0435\u0442\u044b\u0440\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u0432\u0441\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b<\/h3>\n<pre><code>                PerformTransaction  [\u043d\u0435\u0442] \u2500Create\u2500\u25ba (1) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba (2)                   \u2502                    \u2502    Cancel\/\u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u2502                    \u2502 Cancel, \u0435\u0441\u043b\u0438 \u0443\u0441\u043b\u0443\u0433\u0430 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043d\u0430                   \u25bc                    \u25bc                 (-1)                 (-2)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p><code>1<\/code> \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0438 \u0436\u0434\u0451\u0442, <code>2<\/code> \u2014 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0430, <code>-1<\/code> \u2014 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430 \u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, <code>-2<\/code> \u2014 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430 \u043f\u043e\u0441\u043b\u0435. \u0412\u0441\u0451, \u0447\u0435\u0433\u043e \u043d\u0435\u0442 \u043d\u0430 \u0441\u0445\u0435\u043c\u0435, \u2014 \u043e\u0448\u0438\u0431\u043a\u0430 <code>-31008<\/code>, \u00ab\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e\u00bb. \u041e\u0442\u043c\u0435\u043d\u0430 \u043f\u043e \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0443 \u0441\u0442\u0430\u0432\u0438\u0442 <code>-1<\/code> \u0441 \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 <code>4<\/code>.<\/p>\n<h3>CreateTransaction<\/h3>\n<pre><code>const TIMEOUT_MS = 43_200_000;async function createTransaction(p: CreateParams): Promise&lt;RpcResult&gt; {  return db.tx(async (tx) =&gt; {    const existing = await tx.oneOrNone&lt;ProviderTxn&gt;(      `select * from provider_txn        where provider = 'payme' and external_id = $1        for update`,      [p.id],    );    if (existing) {      if (existing.state !== 1) throw rpcError(-31008);      if (Date.now() - existing.create_time &gt; TIMEOUT_MS) {        await cancel(tx, existing, -1, 4);        throw rpcError(-31008);      }      \/\/ \u041f\u043e\u0432\u0442\u043e\u0440: \u0442\u043e\u0442 \u0436\u0435 \u043e\u0442\u0432\u0435\u0442, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437.      return { create_time: existing.create_time, transaction: String(existing.id), state: 1 };    }    const order = await tx.findOrderForUpdate(p.account.order_id);    if (!order) throw rpcError(-31050, 'order_id');    if (order.amount_tiyin !== p.amount) throw rpcError(-31001);    if (order.status !== 'awaiting_payment') throw rpcError(-31008);    const row = await tx.insertOrNull('provider_txn', {      provider: 'payme', external_id: p.id, order_id: order.id,      amount_tiyin: p.amount, state: 1,      provider_time: p.time, create_time: Date.now(),    });    if (!row) {      \/\/ \u041a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0443\u0431\u043b\u044c \u0442\u043e\u0433\u043e \u0436\u0435 params.id \u2014      \/\/ \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u043c \u043a\u0430\u043a \u0432 \u0432\u0435\u0442\u043a\u0435 existing. \u0418\u043d\u0430\u0447\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b      \/\/ one_pending_per_order: \u0443 \u0437\u0430\u043a\u0430\u0437\u0430 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f.      const twin = await tx.findTxn('payme', p.id);      if (twin) return { create_time: twin.create_time, transaction: String(twin.id), state: twin.state };      throw rpcError(-31008);    }    return { create_time: row.create_time, transaction: String(row.id), state: 1 };  });}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043a\u0430\u0437 \u0443\u0436\u0435 \u0436\u0434\u0451\u0442 \u043e\u043f\u043b\u0430\u0442\u044b \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0438 \u0436\u0434\u0451\u0442 <code>-31008<\/code>. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0430\u043a \u043f\u0440\u044f\u043c\u043e \u043d\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437 \u0434\u043e \u043e\u043f\u043b\u0430\u0442\u044b \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u044b \u043f\u043e \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0443. \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0438.<\/p>\n<h3>PerformTransaction: \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u043d\u044c\u0433\u0438<\/h3>\n<pre><code>async function performTransaction(p: { id: string }): Promise&lt;RpcResult&gt; {  return db.tx(async (tx) =&gt; {    const t = await tx.lockTxn('payme', p.id);    if (!t) throw rpcError(-31003);    if (t.state === 2) {      \/\/ \u041f\u043e\u0432\u0442\u043e\u0440. \u0421\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0435 perform_time, \u043d\u0435 \u043d\u043e\u0432\u043e\u0435.      return { transaction: String(t.id), perform_time: t.perform_time, state: 2 };    }    if (t.state !== 1) throw rpcError(-31008);    if (Date.now() - t.create_time &gt; TIMEOUT_MS) {      await cancel(tx, t, -1, 4);      throw rpcError(-31008);    }    const performTime = Date.now();    await tx.update('provider_txn', t.id, { state: 2, perform_time: performTime });    await tx.markOrderPaid(t.order_id, t.id);    await tx.insert('outbox', { type: 'order.paid', order_id: t.order_id });    return { transaction: String(t.id), perform_time: performTime, state: 2 };  });}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0421\u043c\u0435\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0437\u0430\u043a\u0430\u0437\u0430 \u0438\u0434\u0443\u0442 <strong>\u0432 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0431\u0430\u0437\u044b<\/strong>. \u0418\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0440\u044b\u0432 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0434\u0430\u0451\u0442 \u00ab\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043e, \u0430 \u0437\u0430\u043a\u0430\u0437\u0430 \u043d\u0435\u0442\u00bb. \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0430\u043b <code>state = 2<\/code>, \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0448\u0451\u043b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c SMS \u0438\u043b\u0438 \u0447\u0435\u043a, \u0443\u043f\u0430\u043b \u043d\u0430 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0435 \u0438 \u043d\u0435 \u0434\u043e\u0448\u0451\u043b \u0434\u043e \u0437\u0430\u043a\u0430\u0437\u0430. Payme \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0443\u0432\u0438\u0434\u0438\u0442 <code>state = 2<\/code>, \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442, \u0438 \u0437\u0430\u043a\u0430\u0437 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0451, \u0447\u0442\u043e \u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u0435\u0442\u044c, \u0443\u0445\u043e\u0434\u0438\u0442 \u0432 outbox \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u0430.<\/p>\n<h3>CancelTransaction<\/h3>\n<pre><code>async function cancelTransaction(p: { id: string; reason: number }) {  return db.tx(async (tx) =&gt; {    const t = await tx.lockTxn('payme', p.id);    if (!t) throw rpcError(-31003);    if (t.state === 1) {      await cancel(tx, t, -1, p.reason);    } else if (t.state === 2) {      if (await tx.isOrderFulfilled(t.order_id)) throw rpcError(-31007);      await cancel(tx, t, -2, p.reason);    }    \/\/ -1 \u0438 -2: \u0443\u0436\u0435 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430, \u043e\u0442\u0434\u0430\u0451\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0435.    const fresh = await tx.getTxn(t.id);    return { transaction: String(fresh.id), cancel_time: fresh.cancel_time, state: fresh.state };  });}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p><code>-31007<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u00ab\u0442\u043e\u0432\u0430\u0440 \u0438\u043b\u0438 \u0443\u0441\u043b\u0443\u0433\u0430 \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b, \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f\u00bb. \u0420\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e \u0444\u043b\u0430\u0433\u0443 \u00ab\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u00bb \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e: \u043e\u043f\u043b\u0430\u0447\u0435\u043d \u0438 \u043e\u0442\u0433\u0440\u0443\u0436\u0435\u043d \u2014 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438. \u041d\u0443\u0436\u0435\u043d \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0438\u0437 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b: \u043e\u0442\u0433\u0440\u0443\u0437\u043a\u0430, \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u043e\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u0443\u0441\u043b\u0443\u0433\u0430.<\/p>\n<h3>CheckTransaction \u0438 GetStatement<\/h3>\n<p><code>CheckTransaction<\/code> \u043e\u0442\u0434\u0430\u0451\u0442 \u0438\u0437 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 <code>create_time<\/code>, <code>perform_time<\/code>, <code>cancel_time<\/code>, <code>transaction<\/code>, <code>state<\/code> \u0438 <code>reason<\/code>. \u041d\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u2014 <code>-31003<\/code>.<\/p>\n<p>\u041f\u0440\u043e <code>GetStatement<\/code> \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043d\u0435\u043c\u0443 Payme \u0441\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0441 \u0432\u0430\u043c\u0438. \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432 Payme (<code>time<\/code> \u0438\u0437 <code>CreateTransaction<\/code>) \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d <code>from \u2264 time \u2264 to<\/code>, \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e. \u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 <code>CreateTransaction<\/code> \u0432\u0435\u0440\u043d\u0443\u043b \u043e\u0448\u0438\u0431\u043a\u0443, \u0442\u0443\u0434\u0430 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442. \u0420\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 <code>provider_time<\/code> \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e <code>create_time<\/code>: \u044d\u0442\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438 \u043f\u0443\u0442\u0430\u0442\u044c \u0438\u0445 \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<h3>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>Payme \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 <code>Authorization: Basic \u2026<\/code>, \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0441\u043b\u0443\u0436\u0438\u0442 \u043a\u043b\u044e\u0447 \u043a\u0430\u0441\u0441\u044b \u2014 \u0432 \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0435 \u043e\u043d \u0442\u0430\u043a \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u00ab\u043a\u043b\u044e\u0447-\u043f\u0430\u0440\u043e\u043b\u044c\u00bb. \u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u2014 <code>-32504<\/code>. \u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0438 \u044d\u0442\u043e\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439. \u041a\u043b\u044e\u0447 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0439\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c (<code>crypto.timingSafeEqual<\/code>), \u0430 \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 <code>===<\/code>.<\/p>\n<h3>\u0427\u0435\u043a-\u043b\u0438\u0441\u0442 \u043f\u0435\u0440\u0435\u0434 \u0431\u043e\u0435\u043c<\/h3>\n<ol>\n<li>\n<p><code>params.id<\/code> \u2014 \u043a\u043b\u044e\u0447 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 <code>create_time<\/code>, <code>perform_time<\/code>, <code>cancel_time<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0432\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441 HTTP 200, \u043e\u0448\u0438\u0431\u043a\u0438 \u2014 \u0432 \u0442\u0435\u043b\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0443\u043c\u043c\u044b \u2014 \u0446\u0435\u043b\u044b\u0435 \u0442\u0438\u0439\u0438\u043d\u044b, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e <code>float<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0439\u043c\u0430\u0443\u0442 43 200 000 \u043c\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432 <code>CreateTransaction<\/code> \u0438 <code>PerformTransaction<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f Payme \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043a\u0430\u0437\u0430 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0431\u0430\u0437\u044b; \u0432\u0441\u0451 \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u2014 \u0432 outbox.<\/p>\n<\/li>\n<li>\n<p><code>-31007<\/code> \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043e\u0442\u0433\u0440\u0443\u0437\u043a\u0438, \u0430 \u043d\u0435 \u043f\u043e \u0444\u043b\u0430\u0433\u0443 \u043e\u043f\u043b\u0430\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 test.paycom.uz \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/1109616\/\" rel=\"noopener nofollow\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u2014 Click: \u0442\u0430\u043c \u0434\u0432\u0430 \u0448\u0430\u0433\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0448\u0435\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043f\u043e\u0434\u043f\u0438\u0441\u044c MD5 \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043f\u043e\u0432\u0442\u043e\u0440. \u0418 \u043d\u043e\u0447\u043d\u0430\u044f \u0441\u0432\u0435\u0440\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043b\u043e\u0432\u0438\u0442 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043e\u0431\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<h3>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h3>\n<ul>\n<li>\n<p>Payme Business, \u043c\u0435\u0442\u043e\u0434\u044b Merchant API: <a href=\"https:\/\/developer.help.paycom.uz\/metody-merchant-api\/\" rel=\"noopener nofollow\">https:\/\/developer.help.paycom.uz\/metody-merchant-api\/<\/a><\/p>\n<\/li>\n<li>\n<p>CreateTransaction \u0438 \u0442\u0430\u0439\u043c\u0430\u0443\u0442: <a href=\"https:\/\/developer.help.paycom.uz\/metody-merchant-api\/createtransaction\" rel=\"noopener nofollow\">https:\/\/developer.help.paycom.uz\/metody-merchant-api\/createtransaction<\/a><\/p>\n<\/li>\n<li>\n<p>\u0422\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (State, Reason, Timestamp): <a href=\"https:\/\/developer.help.paycom.uz\/metody-merchant-api\/tipy-dannykh\" rel=\"noopener nofollow\">https:\/\/developer.help.paycom.uz\/metody-merchant-api\/tipy-dannykh<\/a><\/p>\n<\/li>\n<li>\n<p>\u041e\u0448\u0438\u0431\u043a\u0438: <a href=\"https:\/\/developer.help.paycom.uz\/metody-merchant-api\/oshibki-errors\" rel=\"noopener nofollow\">https:\/\/developer.help.paycom.uz\/metody-merchant-api\/oshibki-errors<\/a><\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0438 HTTP 200: <a href=\"https:\/\/developer.help.paycom.uz\/protokol-merchant-api\/\" rel=\"noopener nofollow\">https:\/\/developer.help.paycom.uz\/protokol-merchant-api\/<\/a><\/p>\n<\/li>\n<li>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043f\u043e\u0432\u0442\u043e\u0440\u044b: <a href=\"https:\/\/developer.help.paycom.uz\/protokol-merchant-api\/skhema-vzaimodeystviya\" rel=\"noopener nofollow\">https:\/\/developer.help.paycom.uz\/protokol-merchant-api\/skhema-vzaimodeystviya<\/a><\/p>\n<\/li>\n<li>\n<p>GetStatement: <a href=\"https:\/\/developer.help.paycom.uz\/metody-merchant-api\/getstatement\" rel=\"noopener nofollow\">https:\/\/developer.help.paycom.uz\/metody-merchant-api\/getstatement<\/a><\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430: <a href=\"https:\/\/developer.help.paycom.uz\/pesochnitsa\/\" rel=\"noopener nofollow\">https:\/\/developer.help.paycom.uz\/pesochnitsa\/<\/a><\/p>\n<\/li>\n<li>\n<p>Transactional outbox: <a href=\"https:\/\/microservices.io\/patterns\/data\/transactional-outbox.html\" rel=\"noopener nofollow\">https:\/\/microservices.io\/patterns\/data\/transactional-outbox.html<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1109614\/\">https:\/\/habr.com\/ru\/articles\/1109614\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435 Payme \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: \u0437\u0430\u043f\u0440\u043e\u0441\u044b CreateTransaction, PerformTransaction \u0438 CancelTransaction \u043e\u043d\u0430 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0434\u0432\u0430\u0436\u0434\u044b, \u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0432\u043f\u0430\u0441\u0442\u044c \u0441 \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439. \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u00ab\u043f\u043e \u0448\u0430\u0433\u0430\u043c\u00bb, \u043d\u0430 \u044d\u0442\u043e\u043c \u0438 \u043f\u0430\u0434\u0430\u0435\u0442. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0437-\u0437\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438: perform_time: Date.now(), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u043d\u0435 \u043f\u0440\u0438\u0434\u0438\u0440\u0430\u0435\u0442\u0441\u044f. \u041e\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432 \u0431\u043e\u044e: \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043b\u0441\u044f \u043f\u043e \u0434\u043e\u0440\u043e\u0433\u0435, Payme Business \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0442\u043e\u0442 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0435\u0449\u0451 \u0440\u0430\u0437 \u0438 \u0436\u0434\u0451\u0442, \u0447\u0442\u043e \u0432\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u0435 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u0430, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043b\u0438\u0431\u043e \u043f\u043b\u0430\u0442\u0451\u0436, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0438\u0441\u0438\u0442 \u0443 Payme \u043d\u0430 \u0440\u0443\u0447\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u043e\u0440\u0435, \u043b\u0438\u0431\u043e \u0441\u0430\u043c\u044b\u0439 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0442\u0438\u043a\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435: \u00ab\u0434\u0435\u043d\u044c\u0433\u0438 \u0441\u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c, \u0430 \u0437\u0430\u043a\u0430\u0437 \u043d\u0435\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u00bb.\u0414\u0430\u043b\u044c\u0448\u0435 \u2014 \u043a\u0430\u043a \u044f \u0441\u0442\u0440\u043e\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a Merchant API, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u0442\u043e\u0440 \u043b\u044e\u0431\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u044b\u043b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0435\u043d. \u041a\u043e\u0434 \u043d\u0430 TypeScript \u0438 PostgreSQL, \u043d\u043e \u043e\u0442 \u044f\u0437\u044b\u043a\u0430 \u0442\u0443\u0442 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442.\u0427\u0442\u043e Payme \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0438 \u0447\u0435\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u041f\u044f\u0442\u044c \u0444\u0430\u043a\u0442\u043e\u0432 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435.\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u2014 JSON-RPC 2.0 \u043f\u043e\u0432\u0435\u0440\u0445 HTTP POST. \u041e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c 200, \u0434\u0430\u0436\u0435 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443: \u0431\u0438\u0437\u043d\u0435\u0441-\u043e\u0448\u0438\u0431\u043a\u0430 \u043b\u0435\u0436\u0438\u0442 \u0432 \u043f\u043e\u043b\u0435 error \u0442\u0435\u043b\u0430. \u041b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 Payme \u0437\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 -32400, \u0430 \u043d\u0435 \u043a\u0430\u043a \u0432\u0430\u0448 \u043e\u0442\u043a\u0430\u0437.\u0421\u0443\u043c\u043c\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0446\u0435\u043b\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0432 \u0442\u0438\u0439\u0438\u043d\u0430\u0445. 15 000 \u0441\u0443\u043c\u043e\u0432 \u2014 \u044d\u0442\u043e 1500000.\u0412\u0440\u0435\u043c\u044f \u2014 13-\u0437\u043d\u0430\u0447\u043d\u044b\u0439 timestamp \u0432 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445.\u0415\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 CreateTransaction \u0438\u043b\u0438 PerformTransaction \u043d\u0435 \u0434\u043e\u0448\u0451\u043b, Payme \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0442\u0435\u043c\u0438 \u0436\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438.\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u00ab\u0441\u043e\u0437\u0434\u0430\u043d\u0430\u00bb \u0436\u0438\u0432\u0451\u0442 12 \u0447\u0430\u0441\u043e\u0432 (43 200 000 \u043c\u0441), \u043f\u043e\u0442\u043e\u043c \u0435\u0451 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c.\u0418\u0437 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 Payme (params.id) \u2014 \u044d\u0442\u043e \u043a\u043b\u044e\u0447 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438. \u0421\u0432\u043e\u0439 \u043a\u043b\u044e\u0447 \u043f\u043e\u0432\u0435\u0440\u0445 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e. \u0410 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u00ab\u0431\u044b\u043b \u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u00bb \u0447\u0435\u0440\u0435\u0437 select \u043f\u0435\u0440\u0435\u0434 insert \u043d\u0435\u043b\u044c\u0437\u044f: \u0434\u0432\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u043e\u0439\u0434\u0443\u0442 \u0442\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043e\u0431\u0430.\u0422\u0430\u0431\u043b\u0438\u0446\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0451\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u044f \u0445\u0440\u0430\u043d\u044e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0437\u0430\u043a\u0430\u0437\u043e\u0432. \u0423 \u0437\u0430\u043a\u0430\u0437\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043e\u043f\u043b\u0430\u0442\u044b, \u043e\u0442\u043c\u0435\u043d\u044b \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u044b, \u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e.create table provider_txn (  id            serial primary key,  provider      text   not null,             &#8212; &#8216;payme&#8217; | &#8216;click&#8217;  external_id   text   not null,             &#8212; params.id \u043e\u0442 Payme  order_id      bigint not null references orders(id),  amount_tiyin  bigint not null,  state         smallint not null,           &#8212; 1, 2, -1, -2  reason        smallint,  provider_time bigint,                      &#8212; params.time, \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f GetStatement  create_time   bigint not null,             &#8212; \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437  perform_time  bigint not null default 0,   &#8212; \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437  cancel_time   bigint not null default 0,   &#8212; \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437  raw_last      jsonb,  unique (provider, external_id));&#8212; \u0423 \u0437\u0430\u043a\u0430\u0437\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 Payme, \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0435\u0439 \u043e\u043f\u043b\u0430\u0442\u044b.create unique index one_pending_per_order  on provider_txn (order_id) where provider = &#8216;payme&#8217; and state = 1;\u0414\u0432\u0435 \u0437\u0430\u0449\u0438\u0442\u044b \u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u0430\u0437\u0430, \u0430 \u043d\u0435 \u043a\u043e\u0434. \u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c (provider, external_id) \u043b\u043e\u0432\u0438\u0442 \u0433\u043e\u043d\u043a\u0443 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0443\u0431\u043b\u0435\u0439. \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u0435 \u0434\u0430\u0451\u0442 \u0437\u0430\u043a\u0430\u0437\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0443\u044e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e. \u041e\u0431\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0438 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e.\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u00ab\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437\u00bb \u0443 \u0442\u0440\u0451\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u043d\u0435 \u0443\u043a\u0440\u0430\u0448\u0435\u043d\u0438\u0435. \u041d\u0430 \u043d\u0438\u0445 \u0438 \u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430.\u0427\u0435\u0442\u044b\u0440\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u0432\u0441\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b                PerformTransaction  [\u043d\u0435\u0442] \u2500Create\u2500\u25ba (1) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba (2)                   \u2502                    \u2502    Cancel\/\u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u2502                    \u2502 Cancel, \u0435\u0441\u043b\u0438 \u0443\u0441\u043b\u0443\u0433\u0430 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043d\u0430                   \u25bc                    \u25bc                 (-1)                 (-2)1 \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0438 \u0436\u0434\u0451\u0442, 2 \u2014 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0430, -1 \u2014 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430 \u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, -2 \u2014 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430 \u043f\u043e\u0441\u043b\u0435. \u0412\u0441\u0451, \u0447\u0435\u0433\u043e \u043d\u0435\u0442 \u043d\u0430 \u0441\u0445\u0435\u043c\u0435, \u2014 \u043e\u0448\u0438\u0431\u043a\u0430 -31008, \u00ab\u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e\u00bb. \u041e\u0442\u043c\u0435\u043d\u0430 \u043f\u043e \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0443 \u0441\u0442\u0430\u0432\u0438\u0442 -1 \u0441 \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 4.CreateTransactionconst TIMEOUT_MS = 43_200_000;async function createTransaction(p: CreateParams): Promise&lt;RpcResult&gt; {  return db.tx(async (tx) =&gt; {    const existing = await tx.oneOrNone&lt;ProviderTxn&gt;(      `select * from provider_txn        where provider = &#8216;payme&#8217; and external_id = $1        for update`,      [p.id],    );    if (existing) {      if (existing.state !== 1) throw rpcError(-31008);      if (Date.now() &#8212; existing.create_time &gt; TIMEOUT_MS) {        await cancel(tx, existing, -1, 4);        throw rpcError(-31008);      }      \/\/ \u041f\u043e\u0432\u0442\u043e\u0440: \u0442\u043e\u0442 \u0436\u0435 \u043e\u0442\u0432\u0435\u0442, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437.      return { create_time: existing.create_time, transaction: String(existing.id), state: 1 };    }    const order = await tx.findOrderForUpdate(p.account.order_id);    if (!order) throw rpcError(-31050, &#8216;order_id&#8217;);    if (order.amount_tiyin !== p.amount) throw rpcError(-31001);    if (order.status !== &#8216;awaiting_payment&#8217;) throw rpcError(-31008);    const row = await tx.insertOrNull(&#8216;provider_txn&#8217;, {      provider: &#8216;payme&#8217;, external_id: p.id, order_id: order.id,      amount_tiyin: p.amount, state: 1,      provider_time: p.time, create_time: Date.now(),    });    if (!row) {      \/\/ \u041a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0443\u0431\u043b\u044c \u0442\u043e\u0433\u043e \u0436\u0435 params.id \u2014      \/\/ \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u043c \u043a\u0430\u043a \u0432 \u0432\u0435\u0442\u043a\u0435 existing. \u0418\u043d\u0430\u0447\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b      \/\/ one_pending_per_order: \u0443 \u0437\u0430\u043a\u0430\u0437\u0430 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f.      const twin = await tx.findTxn(&#8216;payme&#8217;, p.id);      if (twin) return { create_time: twin.create_time, transaction: String(twin.id), state: twin.state };      throw rpcError(-31008);    }    return { create_time: row.create_time, transaction: String(row.id), state: 1 };  });}\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043a\u0430\u0437 \u0443\u0436\u0435 \u0436\u0434\u0451\u0442 \u043e\u043f\u043b\u0430\u0442\u044b \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0438 \u0436\u0434\u0451\u0442 -31008. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0430\u043a \u043f\u0440\u044f\u043c\u043e \u043d\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437 \u0434\u043e \u043e\u043f\u043b\u0430\u0442\u044b \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u044b \u043f\u043e \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0443. \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0438.PerformTransaction: \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u043d\u044c\u0433\u0438async function performTransaction(p: { id: string }): Promise&lt;RpcResult&gt; {  return db.tx(async (tx) =&gt; {    const t = await tx.lockTxn(&#8216;payme&#8217;, p.id);    if (!t) throw rpcError(-31003);    if (t.state === 2) {      \/\/ \u041f\u043e\u0432\u0442\u043e\u0440. \u0421\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0435 perform_time, \u043d\u0435 \u043d\u043e\u0432\u043e\u0435.      return { transaction: String(t.id), perform_time: t.perform_time, state: 2 };    }    if (t.state !== 1) throw rpcError(-31008);    if (Date.now() &#8212; t.create_time &gt; TIMEOUT_MS) {      await cancel(tx, t, -1, 4);      throw rpcError(-31008);    }    const performTime = Date.now();    await tx.update(&#8216;provider_txn&#8217;, t.id, { state: 2, perform_time: performTime });    await tx.markOrderPaid(t.order_id, t.id);    await tx.insert(&#8216;outbox&#8217;, { type: &#8216;order.paid&#8217;, order_id: t.order_id });    return { transaction: String(t.id), perform_time: performTime, state: 2 };  });}\u0421\u043c\u0435\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0437\u0430\u043a\u0430\u0437\u0430 \u0438\u0434\u0443\u0442 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0431\u0430\u0437\u044b. \u0418\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0440\u044b\u0432 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0434\u0430\u0451\u0442 \u00ab\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043e, \u0430 \u0437\u0430\u043a\u0430\u0437\u0430 \u043d\u0435\u0442\u00bb. \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0430\u043b state = 2, \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0448\u0451\u043b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c SMS \u0438\u043b\u0438 \u0447\u0435\u043a, \u0443\u043f\u0430\u043b \u043d\u0430 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0435 \u0438 \u043d\u0435 \u0434\u043e\u0448\u0451\u043b \u0434\u043e \u0437\u0430\u043a\u0430\u0437\u0430. Payme \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0443\u0432\u0438\u0434\u0438\u0442 state = 2, \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442, \u0438 \u0437\u0430\u043a\u0430\u0437 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0451, \u0447\u0442\u043e \u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u0435\u0442\u044c, \u0443\u0445\u043e\u0434\u0438\u0442 \u0432 outbox \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u0430.CancelTransactionasync function cancelTransaction(p: { id: string; reason: number }) {  return db.tx(async (tx) =&gt; {    const t = await tx.lockTxn(&#8216;payme&#8217;, p.id);    if (!t) throw rpcError(-31003);    if (t.state === 1) {      await cancel(tx, t, -1, p.reason);    } else if (t.state === 2) {      if (await tx.isOrderFulfilled(t.order_id)) throw rpcError(-31007);      await cancel(tx, t, -2, p.reason);    }    \/\/ -1 \u0438 -2: \u0443\u0436\u0435 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430, \u043e\u0442\u0434\u0430\u0451\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0435.    const fresh = await tx.getTxn(t.id);    return { transaction: String(fresh.id), cancel_time: fresh.cancel_time, state: fresh.state };  });}-31007 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u00ab\u0442\u043e\u0432\u0430\u0440 \u0438\u043b\u0438 \u0443\u0441\u043b\u0443\u0433\u0430 \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b, \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f\u00bb. \u0420\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e \u0444\u043b\u0430\u0433\u0443 \u00ab\u043e\u043f\u043b\u0430\u0447\u0435\u043d\u00bb \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e: \u043e\u043f\u043b\u0430\u0447\u0435\u043d \u0438 \u043e\u0442\u0433\u0440\u0443\u0436\u0435\u043d \u2014 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438. \u041d\u0443\u0436\u0435\u043d \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0438\u0437 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b: \u043e\u0442\u0433\u0440\u0443\u0437\u043a\u0430, \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u043e\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u0443\u0441\u043b\u0443\u0433\u0430.CheckTransaction \u0438 GetStatementCheckTransaction \u043e\u0442\u0434\u0430\u0451\u0442 \u0438\u0437 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 create_time, perform_time, cancel_time, transaction, state \u0438 reason. \u041d\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u2014 -31003.\u041f\u0440\u043e GetStatement \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043d\u0435\u043c\u0443 Payme \u0441\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0441 \u0432\u0430\u043c\u0438. \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432 Payme (time \u0438\u0437 CreateTransaction) \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d from \u2264 time \u2264 to, \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e. \u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 CreateTransaction \u0432\u0435\u0440\u043d\u0443\u043b \u043e\u0448\u0438\u0431\u043a\u0443, \u0442\u0443\u0434\u0430 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442. \u0420\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 provider_time \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e create_time: \u044d\u0442\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438 \u043f\u0443\u0442\u0430\u0442\u044c \u0438\u0445 \u043d\u0435\u043b\u044c\u0437\u044f.\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044fPayme \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 Authorization: Basic \u2026, \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0441\u043b\u0443\u0436\u0438\u0442 \u043a\u043b\u044e\u0447 \u043a\u0430\u0441\u0441\u044b \u2014 \u0432 \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0435 \u043e\u043d \u0442\u0430\u043a \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u00ab\u043a\u043b\u044e\u0447-\u043f\u0430\u0440\u043e\u043b\u044c\u00bb. \u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u2014 -32504. \u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0438 \u044d\u0442\u043e\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439. \u041a\u043b\u044e\u0447 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0439\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c (crypto.timingSafeEqual), \u0430 \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 ===.\u0427\u0435\u043a-\u043b\u0438\u0441\u0442 \u043f\u0435\u0440\u0435\u0434 \u0431\u043e\u0435\u043cparams.id \u2014 \u043a\u043b\u044e\u0447 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0432 \u043a\u043e\u0434\u0435.\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 create_time, perform_time, cancel_time.\u041e\u0442\u0432\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441 HTTP 200, \u043e\u0448\u0438\u0431\u043a\u0438 \u2014 \u0432 \u0442\u0435\u043b\u0435.\u0421\u0443\u043c\u043c\u044b \u2014 \u0446\u0435\u043b\u044b\u0435 \u0442\u0438\u0439\u0438\u043d\u044b, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e float.\u0422\u0430\u0439\u043c\u0430\u0443\u0442 43 200 000 \u043c\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432 CreateTransaction \u0438 PerformTransaction.\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f Payme \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043a\u0430\u0437\u0430 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0431\u0430\u0437\u044b; \u0432\u0441\u0451 \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u2014 \u0432 outbox.-31007 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043e\u0442\u0433\u0440\u0443\u0437\u043a\u0438, \u0430 \u043d\u0435 \u043f\u043e \u0444\u043b\u0430\u0433\u0443 \u043e\u043f\u043b\u0430\u0442\u044b.\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 test.paycom.uz \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0430.\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u2014 Click: \u0442\u0430\u043c \u0434\u0432\u0430 \u0448\u0430\u0433\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0448\u0435\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043f\u043e\u0434\u043f\u0438\u0441\u044c MD5 \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043f\u043e\u0432\u0442\u043e\u0440. \u0418 \u043d\u043e\u0447\u043d\u0430\u044f \u0441\u0432\u0435\u0440\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043b\u043e\u0432\u0438\u0442 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043e\u0431\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438Payme Business, \u043c\u0435\u0442\u043e\u0434\u044b Merchant API: https:\/\/developer.help.paycom.uz\/metody-merchant-api\/CreateTransaction \u0438 \u0442\u0430\u0439\u043c\u0430\u0443\u0442: https:\/\/developer.help.paycom.uz\/metody-merchant-api\/createtransaction\u0422\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (State, Reason, Timestamp): https:\/\/developer.help.paycom.uz\/metody-merchant-api\/tipy-dannykh\u041e\u0448\u0438\u0431\u043a\u0438: https:\/\/developer.help.paycom.uz\/metody-merchant-api\/oshibki-errors\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0438 HTTP 200: https:\/\/developer.help.paycom.uz\/protokol-merchant-api\/\u0421\u0445\u0435\u043c\u0430&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-503846","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/503846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=503846"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/503846\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=503846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=503846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=503846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}