diff --git a/app.go b/app.go index 627831b..7896b38 100755 --- a/app.go +++ b/app.go @@ -24,9 +24,6 @@ import ( // @description Online payment system admin API. Localized fields ({en, ru, tm} objects) come back as a plain string in the language of the `lang` query parameter: tm, ru or en (default tm), falling back to tm, ru, en when that translation is empty. lang=all returns the full {en, ru, tm} objects (for edit forms); any other value is 400. // @host localhost:5005 // @BasePath /api/admin -// @securityDefinitions.apikey BearerAuth -// @in header -// @name Authorization // @schemes http // @tag.name auth // @tag.description Authentication @@ -50,12 +47,22 @@ import ( // @tag.description Card rekwizit (card details) orders // @tag.name activity-logs // @tag.description User activity audit trail -// @tag.name visa-master-payment-orders -// @tag.description Visa/Master student-transfer payment orders +// @tag.name visa-master-orders +// @tag.description Visa/Master and Sber student-transfer orders: list, view, create, edit, delete +// @tag.name visa-master-payment +// @tag.description Paying a Visa/Master or Sber order through GBÜS (HALKBANK): quote, pay, status re-check, bank callback +// @tag.name payment-history +// @tag.description Visa/Master we Sber töleg synanyşyklarynyň taryhy. Ulanylyş tertibi: 1) GET /payment-history - ähli tölegler; 2) GET /payment-history/{id} - bir sargydyň tölegleri; 3) GET /payment-history/payments/{id} - bir tölegiň jikme-jikligi; 4) GET /payment-history/{id}/gateway - sargydyň tölegleri GBÜS jogaplary bilen; 5) GET /payment-history/{id}/logs - sargydyň ädimme-ädim töleg loglary // @tag.name backups // @tag.description Database SQL backups // @tag.name currencies // @tag.description Currency exchange rates +// +// Security definitions go last: swag reads every line after one as its +// attributes, so anything declared below it (tags, schemes) is dropped. +// @securityDefinitions.apikey BearerAuth +// @in header +// @name Authorization func main() { cfg := config.GetConfig() logger := logging.GetLogger() diff --git a/docs/docs.go b/docs/docs.go index 0065a03..c2acf6e 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -6498,42 +6498,42 @@ const docTemplate = `{ "BearerAuth": [] } ], - "description": "Returns a paginated, branch-scoped audit trail of visa/master/sber payout attempts (paid, failed, or pending), across orders", + "description": "Ähli sargytlaryň Visa/Master we Sber töleg synanyşyklaryny (tölenen, şowsuz, garaşylýan) sahypalap gaýtarýar. Tertip: sort/order boýunça (adaty ýagdaýda iň täzesi birinji). Bellik: diňe ulanyjynyň öz şahamçasynyň tölegleri görünýär.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "List payment history", + "summary": "Tölegleriň taryhy", "parameters": [ { "type": "integer", - "description": "Filter by order ID", + "description": "Sargyt ID-si boýunça süzmek", "name": "order_id", "in": "query" }, { "type": "integer", - "description": "Filter by branch ID", + "description": "Şahamça ID-si boýunça süzmek", "name": "branch_id", "in": "query" }, { "type": "integer", - "description": "Filter by order owner (client) user ID", + "description": "Sargyt eýesiniň (müşderiniň) ulanyjy ID-si boýunça süzmek", "name": "user_id", "in": "query" }, { "type": "string", - "description": "Filter by gateway status (pending, success, failed)", + "description": "GBÜS statusy boýunça süzmek (pending, success, failed)", "name": "status", "in": "query" }, { "type": "string", - "description": "Filter by passport name/surname or order unique ID", + "description": "Pasport ady/familiýasy ýa-da sargydyň unique ID-si boýunça gözlemek", "name": "search", "in": "query" }, @@ -6546,7 +6546,7 @@ const docTemplate = `{ ], "type": "string", "default": "id", - "description": "Sort column", + "description": "Tertiplenýän sütün", "name": "sort", "in": "query" }, @@ -6557,21 +6557,21 @@ const docTemplate = `{ ], "type": "string", "default": "desc", - "description": "Sort direction", + "description": "Tertip ugry", "name": "order", "in": "query" }, { "type": "integer", "default": 1, - "description": "Page number", + "description": "Sahypa belgisi", "name": "page", "in": "query" }, { "type": "integer", "default": 10, - "description": "Items per page", + "description": "Bir sahypadaky ýazgy sany", "name": "limit", "in": "query" }, @@ -6584,7 +6584,7 @@ const docTemplate = `{ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6618,18 +6618,18 @@ const docTemplate = `{ "BearerAuth": [] } ], - "description": "Returns one visa/master/sber payout attempt by its payment ID, with the raw GBÜS response - the detail view behind a payment-history list row", + "description": "Töleg ID-si boýunça bir Visa/Master ýa-da Sber töleg synanyşygyny GBÜS-iň soňky jogaby (gatewayResponse) bilen gaýtarýar. Tertip: ýeke ýazgy. Bellik: taryh sanawyndaky bir setiriň jikme-jik görnüşi.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "Get a single payment attempt", + "summary": "Bir tölegiň jikme-jikligi", "parameters": [ { "type": "integer", - "description": "Payment ID", + "description": "Töleg ID-si", "name": "id", "in": "path", "required": true @@ -6643,7 +6643,7 @@ const docTemplate = `{ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6689,18 +6689,18 @@ const docTemplate = `{ "BearerAuth": [] } ], - "description": "Returns every payment of one order, newest first, the way the per-order payment table shows them - paid or not, the card it was paid from (cardholderName/maskedPan, null until GBÜS reports them), its time (createdAt), payment year/month, amounts and reference (orderNumber) - each together with the last GBÜS (HALKBANK) response stored for it (gatewayResponse, null if GBÜS never answered). Backs the table's storage icon.", + "description": "Bir sargydyň ähli tölegini her biriniň GBÜS (HALKBANK) soňky jogaby (gatewayResponse) bilen gaýtarýar: tölendimi, haýsy kartdan tölendi (cardholderName/maskedPan), wagty (createdAt), töleg ýyly/aýy, mukdarlary we belgisi (orderNumber). Tertip: iň täzesi birinji. Bellik: GBÜS kart maglumatyny habar berýänçä cardholderName/maskedPan null, GBÜS asla jogap bermedik bolsa gatewayResponse null; tablisadaky ammar nyşany şu endpoint-den işleýär.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "List an order's payments with their HALKBANK responses", + "summary": "Sargydyň tölegleri GBÜS jogaplary bilen", "parameters": [ { "type": "integer", - "description": "Order ID", + "description": "Sargyt ID-si", "name": "id", "in": "path", "required": true @@ -6714,7 +6714,7 @@ const docTemplate = `{ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6763,18 +6763,18 @@ const docTemplate = `{ "BearerAuth": [] } ], - "description": "Returns every visa/master/sber payout attempt of one order, newest first - one row per payment with whether it was paid (paid/gatewayStatus), the card it was paid from (cardholderName/maskedPan, once GBÜS reports them), its time (createdAt) and period (paymentPeriod). The raw GBÜS response of a row is at /payment-history/payments/{id}, of every row at once at /payment-history/{id}/gateway; the step-by-step logs are at /payment-history/{id}/logs.", + "description": "Bir sargydyň ähli Visa/Master we Sber töleg synanyşyklaryny gaýtarýar: her töleg üçin bir setir - tölendimi (paid/gatewayStatus), haýsy kartdan tölendi (cardholderName/maskedPan), wagty (createdAt) we döwri (paymentPeriod). Tertip: iň täzesi birinji. Bellik: bir tölegiň GBÜS jogaby /payment-history/payments/{id}, ähli tölegleriňki /payment-history/{id}/gateway, ädimme-ädim loglar /payment-history/{id}/logs salgysynda.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "List an order's payments", + "summary": "Sargydyň tölegleri", "parameters": [ { "type": "integer", - "description": "Order ID", + "description": "Sargyt ID-si", "name": "id", "in": "path", "required": true @@ -6788,7 +6788,7 @@ const docTemplate = `{ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6837,18 +6837,18 @@ const docTemplate = `{ "BearerAuth": [] } ], - "description": "Returns every payment of one order, newest first, the way the per-order payment table shows them - paid or not, the card it was paid from (cardholderName/maskedPan, null until GBÜS reports them), its time (createdAt), payment year/month, amounts and reference (orderNumber) - each together with the last GBÜS (HALKBANK) response stored for it (gatewayResponse, null if GBÜS never answered). Backs the table's storage icon.", + "description": "Bir sargydyň ähli tölegini her biriniň GBÜS (HALKBANK) soňky jogaby (gatewayResponse) bilen gaýtarýar: tölendimi, haýsy kartdan tölendi (cardholderName/maskedPan), wagty (createdAt), töleg ýyly/aýy, mukdarlary we belgisi (orderNumber). Tertip: iň täzesi birinji. Bellik: GBÜS kart maglumatyny habar berýänçä cardholderName/maskedPan null, GBÜS asla jogap bermedik bolsa gatewayResponse null; tablisadaky ammar nyşany şu endpoint-den işleýär.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "List an order's payments with their HALKBANK responses", + "summary": "Sargydyň tölegleri GBÜS jogaplary bilen", "parameters": [ { "type": "integer", - "description": "Order ID", + "description": "Sargyt ID-si", "name": "id", "in": "path", "required": true @@ -6862,7 +6862,7 @@ const docTemplate = `{ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6911,18 +6911,18 @@ const docTemplate = `{ "BearerAuth": [] } ], - "description": "Returns the full step-by-step audit trail (visa_master_payment_logs) recorded while processing an order's payout, newest first - evidence of what actually happened, independent of the summary rows returned by /payment-history/{id}", + "description": "Sargydyň tölegi işlenende ýazylan ähli ädimleri (visa_master_payment_logs) gaýtarýar. Tertip: iň täzesi birinji. Bellik: /payment-history/{id} setirlerinden garaşsyz, hakykatda näme bolandygynyň subutnamasy.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "Get payment logs for an order", + "summary": "Sargydyň töleg loglary", "parameters": [ { "type": "integer", - "description": "Order ID", + "description": "Sargyt ID-si", "name": "id", "in": "path", "required": true @@ -6936,7 +6936,7 @@ const docTemplate = `{ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -9361,7 +9361,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "List visa/master payment orders", "parameters": [ @@ -9464,7 +9464,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "Create visa/master payment order", "parameters": [ @@ -9520,7 +9520,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-payment" ], "summary": "GBÜS payment callback", "parameters": [ @@ -9567,7 +9567,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "List sber payment orders", "parameters": [ @@ -9663,7 +9663,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "Get visa/master payment order by ID", "parameters": [ @@ -9729,7 +9729,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "Update visa/master payment order", "parameters": [ @@ -9801,7 +9801,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "Delete visa/master payment order", "parameters": [ @@ -9869,7 +9869,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-payment" ], "summary": "Start a visa/master/sber payout", "parameters": [ @@ -9943,7 +9943,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-payment" ], "summary": "Quote a visa/master/sber payment", "parameters": [ @@ -10008,7 +10008,7 @@ const docTemplate = `{ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-payment" ], "summary": "Re-check a visa/master/sber order's latest payment attempt", "parameters": [ @@ -13152,7 +13152,73 @@ const docTemplate = `{ "name": "Authorization", "in": "header" } - } + }, + "tags": [ + { + "description": "Authentication", + "name": "auth" + }, + { + "description": "Provinces", + "name": "province" + }, + { + "description": "Branches", + "name": "branches" + }, + { + "description": "Payment cards", + "name": "payment-card" + }, + { + "description": "Reason cards", + "name": "reason-card" + }, + { + "description": "Loan types", + "name": "loan-type" + }, + { + "description": "Loan required documents", + "name": "loan-document" + }, + { + "description": "Loan repayments", + "name": "loans-repayment" + }, + { + "description": "Card orders", + "name": "card-orders" + }, + { + "description": "Card rekwizit (card details) orders", + "name": "card-rekwizit-orders" + }, + { + "description": "User activity audit trail", + "name": "activity-logs" + }, + { + "description": "Visa/Master and Sber student-transfer orders: list, view, create, edit, delete", + "name": "visa-master-orders" + }, + { + "description": "Paying a Visa/Master or Sber order through GBÜS (HALKBANK): quote, pay, status re-check, bank callback", + "name": "visa-master-payment" + }, + { + "description": "Visa/Master we Sber töleg synanyşyklarynyň taryhy. Ulanylyş tertibi: 1) GET /payment-history - ähli tölegler; 2) GET /payment-history/{id} - bir sargydyň tölegleri; 3) GET /payment-history/payments/{id} - bir tölegiň jikme-jikligi; 4) GET /payment-history/{id}/gateway - sargydyň tölegleri GBÜS jogaplary bilen; 5) GET /payment-history/{id}/logs - sargydyň ädimme-ädim töleg loglary", + "name": "payment-history" + }, + { + "description": "Database SQL backups", + "name": "backups" + }, + { + "description": "Currency exchange rates", + "name": "currencies" + } + ] }` // SwaggerInfo holds exported Swagger Info so clients can modify it @@ -13160,7 +13226,7 @@ var SwaggerInfo = &swag.Spec{ Version: "1.0", Host: "localhost:5005", BasePath: "/api/admin", - Schemes: []string{}, + Schemes: []string{"http"}, Title: "Service APIs", Description: "Online payment system admin API. Localized fields ({en, ru, tm} objects) come back as a plain string in the language of the `lang` query parameter: tm, ru or en (default tm), falling back to tm, ru, en when that translation is empty. lang=all returns the full {en, ru, tm} objects (for edit forms); any other value is 400.", InfoInstanceName: "swagger", diff --git a/docs/swagger.json b/docs/swagger.json index 22b8e5f..d15cbe5 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1,4 +1,7 @@ { + "schemes": [ + "http" + ], "swagger": "2.0", "info": { "description": "Online payment system admin API. Localized fields ({en, ru, tm} objects) come back as a plain string in the language of the `lang` query parameter: tm, ru or en (default tm), falling back to tm, ru, en when that translation is empty. lang=all returns the full {en, ru, tm} objects (for edit forms); any other value is 400.", @@ -6492,42 +6495,42 @@ "BearerAuth": [] } ], - "description": "Returns a paginated, branch-scoped audit trail of visa/master/sber payout attempts (paid, failed, or pending), across orders", + "description": "Ähli sargytlaryň Visa/Master we Sber töleg synanyşyklaryny (tölenen, şowsuz, garaşylýan) sahypalap gaýtarýar. Tertip: sort/order boýunça (adaty ýagdaýda iň täzesi birinji). Bellik: diňe ulanyjynyň öz şahamçasynyň tölegleri görünýär.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "List payment history", + "summary": "Tölegleriň taryhy", "parameters": [ { "type": "integer", - "description": "Filter by order ID", + "description": "Sargyt ID-si boýunça süzmek", "name": "order_id", "in": "query" }, { "type": "integer", - "description": "Filter by branch ID", + "description": "Şahamça ID-si boýunça süzmek", "name": "branch_id", "in": "query" }, { "type": "integer", - "description": "Filter by order owner (client) user ID", + "description": "Sargyt eýesiniň (müşderiniň) ulanyjy ID-si boýunça süzmek", "name": "user_id", "in": "query" }, { "type": "string", - "description": "Filter by gateway status (pending, success, failed)", + "description": "GBÜS statusy boýunça süzmek (pending, success, failed)", "name": "status", "in": "query" }, { "type": "string", - "description": "Filter by passport name/surname or order unique ID", + "description": "Pasport ady/familiýasy ýa-da sargydyň unique ID-si boýunça gözlemek", "name": "search", "in": "query" }, @@ -6540,7 +6543,7 @@ ], "type": "string", "default": "id", - "description": "Sort column", + "description": "Tertiplenýän sütün", "name": "sort", "in": "query" }, @@ -6551,21 +6554,21 @@ ], "type": "string", "default": "desc", - "description": "Sort direction", + "description": "Tertip ugry", "name": "order", "in": "query" }, { "type": "integer", "default": 1, - "description": "Page number", + "description": "Sahypa belgisi", "name": "page", "in": "query" }, { "type": "integer", "default": 10, - "description": "Items per page", + "description": "Bir sahypadaky ýazgy sany", "name": "limit", "in": "query" }, @@ -6578,7 +6581,7 @@ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6612,18 +6615,18 @@ "BearerAuth": [] } ], - "description": "Returns one visa/master/sber payout attempt by its payment ID, with the raw GBÜS response - the detail view behind a payment-history list row", + "description": "Töleg ID-si boýunça bir Visa/Master ýa-da Sber töleg synanyşygyny GBÜS-iň soňky jogaby (gatewayResponse) bilen gaýtarýar. Tertip: ýeke ýazgy. Bellik: taryh sanawyndaky bir setiriň jikme-jik görnüşi.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "Get a single payment attempt", + "summary": "Bir tölegiň jikme-jikligi", "parameters": [ { "type": "integer", - "description": "Payment ID", + "description": "Töleg ID-si", "name": "id", "in": "path", "required": true @@ -6637,7 +6640,7 @@ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6683,18 +6686,18 @@ "BearerAuth": [] } ], - "description": "Returns every payment of one order, newest first, the way the per-order payment table shows them - paid or not, the card it was paid from (cardholderName/maskedPan, null until GBÜS reports them), its time (createdAt), payment year/month, amounts and reference (orderNumber) - each together with the last GBÜS (HALKBANK) response stored for it (gatewayResponse, null if GBÜS never answered). Backs the table's storage icon.", + "description": "Bir sargydyň ähli tölegini her biriniň GBÜS (HALKBANK) soňky jogaby (gatewayResponse) bilen gaýtarýar: tölendimi, haýsy kartdan tölendi (cardholderName/maskedPan), wagty (createdAt), töleg ýyly/aýy, mukdarlary we belgisi (orderNumber). Tertip: iň täzesi birinji. Bellik: GBÜS kart maglumatyny habar berýänçä cardholderName/maskedPan null, GBÜS asla jogap bermedik bolsa gatewayResponse null; tablisadaky ammar nyşany şu endpoint-den işleýär.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "List an order's payments with their HALKBANK responses", + "summary": "Sargydyň tölegleri GBÜS jogaplary bilen", "parameters": [ { "type": "integer", - "description": "Order ID", + "description": "Sargyt ID-si", "name": "id", "in": "path", "required": true @@ -6708,7 +6711,7 @@ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6757,18 +6760,18 @@ "BearerAuth": [] } ], - "description": "Returns every visa/master/sber payout attempt of one order, newest first - one row per payment with whether it was paid (paid/gatewayStatus), the card it was paid from (cardholderName/maskedPan, once GBÜS reports them), its time (createdAt) and period (paymentPeriod). The raw GBÜS response of a row is at /payment-history/payments/{id}, of every row at once at /payment-history/{id}/gateway; the step-by-step logs are at /payment-history/{id}/logs.", + "description": "Bir sargydyň ähli Visa/Master we Sber töleg synanyşyklaryny gaýtarýar: her töleg üçin bir setir - tölendimi (paid/gatewayStatus), haýsy kartdan tölendi (cardholderName/maskedPan), wagty (createdAt) we döwri (paymentPeriod). Tertip: iň täzesi birinji. Bellik: bir tölegiň GBÜS jogaby /payment-history/payments/{id}, ähli tölegleriňki /payment-history/{id}/gateway, ädimme-ädim loglar /payment-history/{id}/logs salgysynda.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "List an order's payments", + "summary": "Sargydyň tölegleri", "parameters": [ { "type": "integer", - "description": "Order ID", + "description": "Sargyt ID-si", "name": "id", "in": "path", "required": true @@ -6782,7 +6785,7 @@ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6831,18 +6834,18 @@ "BearerAuth": [] } ], - "description": "Returns every payment of one order, newest first, the way the per-order payment table shows them - paid or not, the card it was paid from (cardholderName/maskedPan, null until GBÜS reports them), its time (createdAt), payment year/month, amounts and reference (orderNumber) - each together with the last GBÜS (HALKBANK) response stored for it (gatewayResponse, null if GBÜS never answered). Backs the table's storage icon.", + "description": "Bir sargydyň ähli tölegini her biriniň GBÜS (HALKBANK) soňky jogaby (gatewayResponse) bilen gaýtarýar: tölendimi, haýsy kartdan tölendi (cardholderName/maskedPan), wagty (createdAt), töleg ýyly/aýy, mukdarlary we belgisi (orderNumber). Tertip: iň täzesi birinji. Bellik: GBÜS kart maglumatyny habar berýänçä cardholderName/maskedPan null, GBÜS asla jogap bermedik bolsa gatewayResponse null; tablisadaky ammar nyşany şu endpoint-den işleýär.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "List an order's payments with their HALKBANK responses", + "summary": "Sargydyň tölegleri GBÜS jogaplary bilen", "parameters": [ { "type": "integer", - "description": "Order ID", + "description": "Sargyt ID-si", "name": "id", "in": "path", "required": true @@ -6856,7 +6859,7 @@ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -6905,18 +6908,18 @@ "BearerAuth": [] } ], - "description": "Returns the full step-by-step audit trail (visa_master_payment_logs) recorded while processing an order's payout, newest first - evidence of what actually happened, independent of the summary rows returned by /payment-history/{id}", + "description": "Sargydyň tölegi işlenende ýazylan ähli ädimleri (visa_master_payment_logs) gaýtarýar. Tertip: iň täzesi birinji. Bellik: /payment-history/{id} setirlerinden garaşsyz, hakykatda näme bolandygynyň subutnamasy.", "produces": [ "application/json" ], "tags": [ "payment-history" ], - "summary": "Get payment logs for an order", + "summary": "Sargydyň töleg loglary", "parameters": [ { "type": "integer", - "description": "Order ID", + "description": "Sargyt ID-si", "name": "id", "in": "path", "required": true @@ -6930,7 +6933,7 @@ ], "type": "string", "default": "tm", - "description": "Language of localized fields; all returns the full {en, ru, tm} objects", + "description": "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri", "name": "lang", "in": "query" } @@ -9355,7 +9358,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "List visa/master payment orders", "parameters": [ @@ -9458,7 +9461,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "Create visa/master payment order", "parameters": [ @@ -9514,7 +9517,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-payment" ], "summary": "GBÜS payment callback", "parameters": [ @@ -9561,7 +9564,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "List sber payment orders", "parameters": [ @@ -9657,7 +9660,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "Get visa/master payment order by ID", "parameters": [ @@ -9723,7 +9726,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "Update visa/master payment order", "parameters": [ @@ -9795,7 +9798,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-orders" ], "summary": "Delete visa/master payment order", "parameters": [ @@ -9863,7 +9866,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-payment" ], "summary": "Start a visa/master/sber payout", "parameters": [ @@ -9937,7 +9940,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-payment" ], "summary": "Quote a visa/master/sber payment", "parameters": [ @@ -10002,7 +10005,7 @@ "application/json" ], "tags": [ - "visa-master-payment-orders" + "visa-master-payment" ], "summary": "Re-check a visa/master/sber order's latest payment attempt", "parameters": [ @@ -13146,5 +13149,71 @@ "name": "Authorization", "in": "header" } - } + }, + "tags": [ + { + "description": "Authentication", + "name": "auth" + }, + { + "description": "Provinces", + "name": "province" + }, + { + "description": "Branches", + "name": "branches" + }, + { + "description": "Payment cards", + "name": "payment-card" + }, + { + "description": "Reason cards", + "name": "reason-card" + }, + { + "description": "Loan types", + "name": "loan-type" + }, + { + "description": "Loan required documents", + "name": "loan-document" + }, + { + "description": "Loan repayments", + "name": "loans-repayment" + }, + { + "description": "Card orders", + "name": "card-orders" + }, + { + "description": "Card rekwizit (card details) orders", + "name": "card-rekwizit-orders" + }, + { + "description": "User activity audit trail", + "name": "activity-logs" + }, + { + "description": "Visa/Master and Sber student-transfer orders: list, view, create, edit, delete", + "name": "visa-master-orders" + }, + { + "description": "Paying a Visa/Master or Sber order through GBÜS (HALKBANK): quote, pay, status re-check, bank callback", + "name": "visa-master-payment" + }, + { + "description": "Visa/Master we Sber töleg synanyşyklarynyň taryhy. Ulanylyş tertibi: 1) GET /payment-history - ähli tölegler; 2) GET /payment-history/{id} - bir sargydyň tölegleri; 3) GET /payment-history/payments/{id} - bir tölegiň jikme-jikligi; 4) GET /payment-history/{id}/gateway - sargydyň tölegleri GBÜS jogaplary bilen; 5) GET /payment-history/{id}/logs - sargydyň ädimme-ädim töleg loglary", + "name": "payment-history" + }, + { + "description": "Database SQL backups", + "name": "backups" + }, + { + "description": "Currency exchange rates", + "name": "currencies" + } + ] } \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 60be998..0897708 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -6589,31 +6589,33 @@ paths: - payment-card /payment-history: get: - description: Returns a paginated, branch-scoped audit trail of visa/master/sber - payout attempts (paid, failed, or pending), across orders + description: 'Ähli sargytlaryň Visa/Master we Sber töleg synanyşyklaryny (tölenen, + şowsuz, garaşylýan) sahypalap gaýtarýar. Tertip: sort/order boýunça (adaty + ýagdaýda iň täzesi birinji). Bellik: diňe ulanyjynyň öz şahamçasynyň tölegleri + görünýär.' parameters: - - description: Filter by order ID + - description: Sargyt ID-si boýunça süzmek in: query name: order_id type: integer - - description: Filter by branch ID + - description: Şahamça ID-si boýunça süzmek in: query name: branch_id type: integer - - description: Filter by order owner (client) user ID + - description: Sargyt eýesiniň (müşderiniň) ulanyjy ID-si boýunça süzmek in: query name: user_id type: integer - - description: Filter by gateway status (pending, success, failed) + - description: GBÜS statusy boýunça süzmek (pending, success, failed) in: query name: status type: string - - description: Filter by passport name/surname or order unique ID + - description: Pasport ady/familiýasy ýa-da sargydyň unique ID-si boýunça gözlemek in: query name: search type: string - default: id - description: Sort column + description: Tertiplenýän sütün enum: - id - created_at @@ -6623,7 +6625,7 @@ paths: name: sort type: string - default: desc - description: Sort direction + description: Tertip ugry enum: - asc - desc @@ -6631,18 +6633,17 @@ paths: name: order type: string - default: 1 - description: Page number + description: Sahypa belgisi in: query name: page type: integer - default: 10 - description: Items per page + description: Bir sahypadaky ýazgy sany in: query name: limit type: integer - default: tm - description: Language of localized fields; all returns the full {en, ru, tm} - objects + description: Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri enum: - tm - ru @@ -6668,26 +6669,25 @@ paths: $ref: '#/definitions/appresult.AppError' security: - BearerAuth: [] - summary: List payment history + summary: Tölegleriň taryhy tags: - payment-history /payment-history/{id}: get: - description: Returns every visa/master/sber payout attempt of one order, newest - first - one row per payment with whether it was paid (paid/gatewayStatus), - the card it was paid from (cardholderName/maskedPan, once GBÜS reports them), - its time (createdAt) and period (paymentPeriod). The raw GBÜS response of - a row is at /payment-history/payments/{id}, of every row at once at /payment-history/{id}/gateway; - the step-by-step logs are at /payment-history/{id}/logs. + description: 'Bir sargydyň ähli Visa/Master we Sber töleg synanyşyklaryny gaýtarýar: + her töleg üçin bir setir - tölendimi (paid/gatewayStatus), haýsy kartdan tölendi + (cardholderName/maskedPan), wagty (createdAt) we döwri (paymentPeriod). Tertip: + iň täzesi birinji. Bellik: bir tölegiň GBÜS jogaby /payment-history/payments/{id}, + ähli tölegleriňki /payment-history/{id}/gateway, ädimme-ädim loglar /payment-history/{id}/logs + salgysynda.' parameters: - - description: Order ID + - description: Sargyt ID-si in: path name: id required: true type: integer - default: tm - description: Language of localized fields; all returns the full {en, ru, tm} - objects + description: Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri enum: - tm - ru @@ -6723,26 +6723,25 @@ paths: $ref: '#/definitions/appresult.AppError' security: - BearerAuth: [] - summary: List an order's payments + summary: Sargydyň tölegleri tags: - payment-history /payment-history/{id}/gateway: get: - description: Returns every payment of one order, newest first, the way the per-order - payment table shows them - paid or not, the card it was paid from (cardholderName/maskedPan, - null until GBÜS reports them), its time (createdAt), payment year/month, amounts - and reference (orderNumber) - each together with the last GBÜS (HALKBANK) - response stored for it (gatewayResponse, null if GBÜS never answered). Backs - the table's storage icon. + description: 'Bir sargydyň ähli tölegini her biriniň GBÜS (HALKBANK) soňky jogaby + (gatewayResponse) bilen gaýtarýar: tölendimi, haýsy kartdan tölendi (cardholderName/maskedPan), + wagty (createdAt), töleg ýyly/aýy, mukdarlary we belgisi (orderNumber). Tertip: + iň täzesi birinji. Bellik: GBÜS kart maglumatyny habar berýänçä cardholderName/maskedPan + null, GBÜS asla jogap bermedik bolsa gatewayResponse null; tablisadaky ammar + nyşany şu endpoint-den işleýär.' parameters: - - description: Order ID + - description: Sargyt ID-si in: path name: id required: true type: integer - default: tm - description: Language of localized fields; all returns the full {en, ru, tm} - objects + description: Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri enum: - tm - ru @@ -6778,23 +6777,22 @@ paths: $ref: '#/definitions/appresult.AppError' security: - BearerAuth: [] - summary: List an order's payments with their HALKBANK responses + summary: Sargydyň tölegleri GBÜS jogaplary bilen tags: - payment-history /payment-history/{id}/logs: get: - description: Returns the full step-by-step audit trail (visa_master_payment_logs) - recorded while processing an order's payout, newest first - evidence of what - actually happened, independent of the summary rows returned by /payment-history/{id} + description: 'Sargydyň tölegi işlenende ýazylan ähli ädimleri (visa_master_payment_logs) + gaýtarýar. Tertip: iň täzesi birinji. Bellik: /payment-history/{id} setirlerinden + garaşsyz, hakykatda näme bolandygynyň subutnamasy.' parameters: - - description: Order ID + - description: Sargyt ID-si in: path name: id required: true type: integer - default: tm - description: Language of localized fields; all returns the full {en, ru, tm} - objects + description: Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri enum: - tm - ru @@ -6830,23 +6828,22 @@ paths: $ref: '#/definitions/appresult.AppError' security: - BearerAuth: [] - summary: Get payment logs for an order + summary: Sargydyň töleg loglary tags: - payment-history /payment-history/payments/{id}: get: - description: Returns one visa/master/sber payout attempt by its payment ID, - with the raw GBÜS response - the detail view behind a payment-history list - row + description: 'Töleg ID-si boýunça bir Visa/Master ýa-da Sber töleg synanyşygyny + GBÜS-iň soňky jogaby (gatewayResponse) bilen gaýtarýar. Tertip: ýeke ýazgy. + Bellik: taryh sanawyndaky bir setiriň jikme-jik görnüşi.' parameters: - - description: Payment ID + - description: Töleg ID-si in: path name: id required: true type: integer - default: tm - description: Language of localized fields; all returns the full {en, ru, tm} - objects + description: Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri enum: - tm - ru @@ -6880,26 +6877,25 @@ paths: $ref: '#/definitions/appresult.AppError' security: - BearerAuth: [] - summary: Get a single payment attempt + summary: Bir tölegiň jikme-jikligi tags: - payment-history /payment-history/payments/{id}/gateway: get: - description: Returns every payment of one order, newest first, the way the per-order - payment table shows them - paid or not, the card it was paid from (cardholderName/maskedPan, - null until GBÜS reports them), its time (createdAt), payment year/month, amounts - and reference (orderNumber) - each together with the last GBÜS (HALKBANK) - response stored for it (gatewayResponse, null if GBÜS never answered). Backs - the table's storage icon. + description: 'Bir sargydyň ähli tölegini her biriniň GBÜS (HALKBANK) soňky jogaby + (gatewayResponse) bilen gaýtarýar: tölendimi, haýsy kartdan tölendi (cardholderName/maskedPan), + wagty (createdAt), töleg ýyly/aýy, mukdarlary we belgisi (orderNumber). Tertip: + iň täzesi birinji. Bellik: GBÜS kart maglumatyny habar berýänçä cardholderName/maskedPan + null, GBÜS asla jogap bermedik bolsa gatewayResponse null; tablisadaky ammar + nyşany şu endpoint-den işleýär.' parameters: - - description: Order ID + - description: Sargyt ID-si in: path name: id required: true type: integer - default: tm - description: Language of localized fields; all returns the full {en, ru, tm} - objects + description: Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri enum: - tm - ru @@ -6935,7 +6931,7 @@ paths: $ref: '#/definitions/appresult.AppError' security: - BearerAuth: [] - summary: List an order's payments with their HALKBANK responses + summary: Sargydyň tölegleri GBÜS jogaplary bilen tags: - payment-history /payment-settings: @@ -8644,7 +8640,7 @@ paths: - BearerAuth: [] summary: List visa/master payment orders tags: - - visa-master-payment-orders + - visa-master-orders post: consumes: - application/json @@ -8686,7 +8682,7 @@ paths: - BearerAuth: [] summary: Create visa/master payment order tags: - - visa-master-payment-orders + - visa-master-orders /visa-master-payment-orders/{id}: delete: description: Deletes a visa/master payment order @@ -8730,7 +8726,7 @@ paths: - BearerAuth: [] summary: Delete visa/master payment order tags: - - visa-master-payment-orders + - visa-master-orders get: description: Returns a single visa/master payment order with branch and user details @@ -8774,7 +8770,7 @@ paths: - BearerAuth: [] summary: Get visa/master payment order by ID tags: - - visa-master-payment-orders + - visa-master-orders put: consumes: - application/json @@ -8825,7 +8821,7 @@ paths: - BearerAuth: [] summary: Update visa/master payment order tags: - - visa-master-payment-orders + - visa-master-orders /visa-master-payment-orders/{id}/pay: post: consumes: @@ -8879,7 +8875,7 @@ paths: - BearerAuth: [] summary: Start a visa/master/sber payout tags: - - visa-master-payment-orders + - visa-master-payment /visa-master-payment-orders/{id}/quote: get: description: Returns the current rate, configured fees, and max payable amount @@ -8924,7 +8920,7 @@ paths: - BearerAuth: [] summary: Quote a visa/master/sber payment tags: - - visa-master-payment-orders + - visa-master-payment /visa-master-payment-orders/{id}/status: get: description: For when the frontend can't rely on GBÜS's redirect having reached @@ -8971,7 +8967,7 @@ paths: - BearerAuth: [] summary: Re-check a visa/master/sber order's latest payment attempt tags: - - visa-master-payment-orders + - visa-master-payment /visa-master-payment-orders/callback: get: description: GBÜS redirects the browser here after payment; the real outcome @@ -9002,7 +8998,7 @@ paths: $ref: '#/definitions/visamasterpay.CallbackResultDTO' summary: GBÜS payment callback tags: - - visa-master-payment-orders + - visa-master-payment /visa-master-payment-orders/sber: get: description: Returns paginated payment orders of type sber @@ -9067,10 +9063,51 @@ paths: - BearerAuth: [] summary: List sber payment orders tags: - - visa-master-payment-orders + - visa-master-orders +schemes: +- http securityDefinitions: BearerAuth: in: header name: Authorization type: apiKey swagger: "2.0" +tags: +- description: Authentication + name: auth +- description: Provinces + name: province +- description: Branches + name: branches +- description: Payment cards + name: payment-card +- description: Reason cards + name: reason-card +- description: Loan types + name: loan-type +- description: Loan required documents + name: loan-document +- description: Loan repayments + name: loans-repayment +- description: Card orders + name: card-orders +- description: Card rekwizit (card details) orders + name: card-rekwizit-orders +- description: User activity audit trail + name: activity-logs +- description: 'Visa/Master and Sber student-transfer orders: list, view, create, + edit, delete' + name: visa-master-orders +- description: 'Paying a Visa/Master or Sber order through GBÜS (HALKBANK): quote, + pay, status re-check, bank callback' + name: visa-master-payment +- description: 'Visa/Master we Sber töleg synanyşyklarynyň taryhy. Ulanylyş tertibi: + 1) GET /payment-history - ähli tölegler; 2) GET /payment-history/{id} - bir sargydyň + tölegleri; 3) GET /payment-history/payments/{id} - bir tölegiň jikme-jikligi; + 4) GET /payment-history/{id}/gateway - sargydyň tölegleri GBÜS jogaplary bilen; + 5) GET /payment-history/{id}/logs - sargydyň ädimme-ädim töleg loglary' + name: payment-history +- description: Database SQL backups + name: backups +- description: Currency exchange rates + name: currencies diff --git a/internal/cards/visamaster/handler.go b/internal/cards/visamaster/handler.go index f277e3e..74e6efd 100644 --- a/internal/cards/visamaster/handler.go +++ b/internal/cards/visamaster/handler.go @@ -43,7 +43,7 @@ func (h *handler) Register(router *gin.RouterGroup) { // list godoc // @Summary List visa/master payment orders // @Description Returns paginated visa/master payment orders; sber orders are excluded (see /visa-master-payment-orders/sber) -// @Tags visa-master-payment-orders +// @Tags visa-master-orders // @Produce json // @Security BearerAuth // @Param name query string false "Filter by passport name or surname" @@ -72,7 +72,7 @@ func (h *handler) list(c *gin.Context) { // listSber godoc // @Summary List sber payment orders // @Description Returns paginated payment orders of type sber -// @Tags visa-master-payment-orders +// @Tags visa-master-orders // @Produce json // @Security BearerAuth // @Param name query string false "Filter by passport name or surname" @@ -111,7 +111,7 @@ func (h *handler) respondList(c *gin.Context, filter ListFilter) { // getByID godoc // @Summary Get visa/master payment order by ID // @Description Returns a single visa/master payment order with branch and user details -// @Tags visa-master-payment-orders +// @Tags visa-master-orders // @Produce json // @Security BearerAuth // @Param id path int true "Visa/master payment order ID" @@ -148,7 +148,7 @@ func (h *handler) getByID(c *gin.Context) { // create godoc // @Summary Create visa/master payment order // @Description Creates a new visa/master payment order -// @Tags visa-master-payment-orders +// @Tags visa-master-orders // @Accept json // @Produce json // @Security BearerAuth @@ -178,7 +178,7 @@ func (h *handler) create(c *gin.Context) { // update godoc // @Summary Update visa/master payment order // @Description Updates an existing visa/master payment order -// @Tags visa-master-payment-orders +// @Tags visa-master-orders // @Accept json // @Produce json // @Security BearerAuth @@ -224,7 +224,7 @@ func (h *handler) update(c *gin.Context) { // delete godoc // @Summary Delete visa/master payment order // @Description Deletes a visa/master payment order -// @Tags visa-master-payment-orders +// @Tags visa-master-orders // @Produce json // @Security BearerAuth // @Param id path int true "Visa/master payment order ID" diff --git a/internal/payment/paymenthistory/handler.go b/internal/payment/paymenthistory/handler.go index e8ac83b..3adc487 100644 --- a/internal/payment/paymenthistory/handler.go +++ b/internal/payment/paymenthistory/handler.go @@ -38,21 +38,21 @@ func (h *handler) Register(router *gin.RouterGroup) { } // list godoc -// @Summary List payment history -// @Description Returns a paginated, branch-scoped audit trail of visa/master/sber payout attempts (paid, failed, or pending), across orders +// @Summary Tölegleriň taryhy +// @Description Ähli sargytlaryň Visa/Master we Sber töleg synanyşyklaryny (tölenen, şowsuz, garaşylýan) sahypalap gaýtarýar. Tertip: sort/order boýunça (adaty ýagdaýda iň täzesi birinji). Bellik: diňe ulanyjynyň öz şahamçasynyň tölegleri görünýär. // @Tags payment-history // @Produce json // @Security BearerAuth -// @Param order_id query int false "Filter by order ID" -// @Param branch_id query int false "Filter by branch ID" -// @Param user_id query int false "Filter by order owner (client) user ID" -// @Param status query string false "Filter by gateway status (pending, success, failed)" -// @Param search query string false "Filter by passport name/surname or order unique ID" -// @Param sort query string false "Sort column" Enums(id, created_at, status, amount) default(id) -// @Param order query string false "Sort direction" Enums(asc, desc) default(desc) -// @Param page query int false "Page number" default(1) -// @Param limit query int false "Items per page" default(10) -// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm) +// @Param order_id query int false "Sargyt ID-si boýunça süzmek" +// @Param branch_id query int false "Şahamça ID-si boýunça süzmek" +// @Param user_id query int false "Sargyt eýesiniň (müşderiniň) ulanyjy ID-si boýunça süzmek" +// @Param status query string false "GBÜS statusy boýunça süzmek (pending, success, failed)" +// @Param search query string false "Pasport ady/familiýasy ýa-da sargydyň unique ID-si boýunça gözlemek" +// @Param sort query string false "Tertiplenýän sütün" Enums(id, created_at, status, amount) default(id) +// @Param order query string false "Tertip ugry" Enums(asc, desc) default(desc) +// @Param page query int false "Sahypa belgisi" default(1) +// @Param limit query int false "Bir sahypadaky ýazgy sany" default(10) +// @Param lang query string false "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri" Enums(tm, ru, en, all) default(tm) // @Success 200 {object} ListPaymentHistoryDTO // @Failure 400 {object} appresult.AppError // @Failure 500 {object} appresult.AppError @@ -75,13 +75,13 @@ func (h *handler) list(c *gin.Context) { } // get godoc -// @Summary Get a single payment attempt -// @Description Returns one visa/master/sber payout attempt by its payment ID, with the raw GBÜS response - the detail view behind a payment-history list row +// @Summary Bir tölegiň jikme-jikligi +// @Description Töleg ID-si boýunça bir Visa/Master ýa-da Sber töleg synanyşygyny GBÜS-iň soňky jogaby (gatewayResponse) bilen gaýtarýar. Tertip: ýeke ýazgy. Bellik: taryh sanawyndaky bir setiriň jikme-jik görnüşi. // @Tags payment-history // @Produce json // @Security BearerAuth -// @Param id path int true "Payment ID" -// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm) +// @Param id path int true "Töleg ID-si" +// @Param lang query string false "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri" Enums(tm, ru, en, all) default(tm) // @Success 200 {object} PaymentHistoryDetailDTO // @Failure 400 {object} appresult.AppError // @Failure 403 {object} appresult.AppError @@ -113,13 +113,13 @@ func (h *handler) get(c *gin.Context) { } // gateway godoc -// @Summary List an order's payments with their HALKBANK responses -// @Description Returns every payment of one order, newest first, the way the per-order payment table shows them - paid or not, the card it was paid from (cardholderName/maskedPan, null until GBÜS reports them), its time (createdAt), payment year/month, amounts and reference (orderNumber) - each together with the last GBÜS (HALKBANK) response stored for it (gatewayResponse, null if GBÜS never answered). Backs the table's storage icon. +// @Summary Sargydyň tölegleri GBÜS jogaplary bilen +// @Description Bir sargydyň ähli tölegini her biriniň GBÜS (HALKBANK) soňky jogaby (gatewayResponse) bilen gaýtarýar: tölendimi, haýsy kartdan tölendi (cardholderName/maskedPan), wagty (createdAt), töleg ýyly/aýy, mukdarlary we belgisi (orderNumber). Tertip: iň täzesi birinji. Bellik: GBÜS kart maglumatyny habar berýänçä cardholderName/maskedPan null, GBÜS asla jogap bermedik bolsa gatewayResponse null; tablisadaky ammar nyşany şu endpoint-den işleýär. // @Tags payment-history // @Produce json // @Security BearerAuth -// @Param id path int true "Order ID" -// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm) +// @Param id path int true "Sargyt ID-si" +// @Param lang query string false "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri" Enums(tm, ru, en, all) default(tm) // @Success 200 {array} PaymentGatewayDTO // @Failure 400 {object} appresult.AppError // @Failure 403 {object} appresult.AppError @@ -153,13 +153,13 @@ func (h *handler) gateway(c *gin.Context) { } // orderPayments godoc -// @Summary List an order's payments -// @Description Returns every visa/master/sber payout attempt of one order, newest first - one row per payment with whether it was paid (paid/gatewayStatus), the card it was paid from (cardholderName/maskedPan, once GBÜS reports them), its time (createdAt) and period (paymentPeriod). The raw GBÜS response of a row is at /payment-history/payments/{id}, of every row at once at /payment-history/{id}/gateway; the step-by-step logs are at /payment-history/{id}/logs. +// @Summary Sargydyň tölegleri +// @Description Bir sargydyň ähli Visa/Master we Sber töleg synanyşyklaryny gaýtarýar: her töleg üçin bir setir - tölendimi (paid/gatewayStatus), haýsy kartdan tölendi (cardholderName/maskedPan), wagty (createdAt) we döwri (paymentPeriod). Tertip: iň täzesi birinji. Bellik: bir tölegiň GBÜS jogaby /payment-history/payments/{id}, ähli tölegleriňki /payment-history/{id}/gateway, ädimme-ädim loglar /payment-history/{id}/logs salgysynda. // @Tags payment-history // @Produce json // @Security BearerAuth -// @Param id path int true "Order ID" -// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm) +// @Param id path int true "Sargyt ID-si" +// @Param lang query string false "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri" Enums(tm, ru, en, all) default(tm) // @Success 200 {array} PaymentHistoryItemDTO // @Failure 400 {object} appresult.AppError // @Failure 403 {object} appresult.AppError @@ -188,13 +188,13 @@ func (h *handler) orderPayments(c *gin.Context) { } // logs godoc -// @Summary Get payment logs for an order -// @Description Returns the full step-by-step audit trail (visa_master_payment_logs) recorded while processing an order's payout, newest first - evidence of what actually happened, independent of the summary rows returned by /payment-history/{id} +// @Summary Sargydyň töleg loglary +// @Description Sargydyň tölegi işlenende ýazylan ähli ädimleri (visa_master_payment_logs) gaýtarýar. Tertip: iň täzesi birinji. Bellik: /payment-history/{id} setirlerinden garaşsyz, hakykatda näme bolandygynyň subutnamasy. // @Tags payment-history // @Produce json // @Security BearerAuth -// @Param id path int true "Order ID" -// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm) +// @Param id path int true "Sargyt ID-si" +// @Param lang query string false "Lokallaşdyrylan meýdanlaryň dili; all - doly {en, ru, tm} obýektleri" Enums(tm, ru, en, all) default(tm) // @Success 200 {array} PaymentLogDTO // @Failure 400 {object} appresult.AppError // @Failure 403 {object} appresult.AppError diff --git a/internal/payment/visamasterpay/handler.go b/internal/payment/visamasterpay/handler.go index de8e19c..07111de 100644 --- a/internal/payment/visamasterpay/handler.go +++ b/internal/payment/visamasterpay/handler.go @@ -40,7 +40,7 @@ func (h *handler) Register(router *gin.RouterGroup) { // quote godoc // @Summary Quote a visa/master/sber payment // @Description Returns the current rate, configured fees, and max payable amount for an order's payout -// @Tags visa-master-payment-orders +// @Tags visa-master-payment // @Produce json // @Security BearerAuth // @Param id path int true "Visa/master payment order ID" @@ -72,7 +72,7 @@ func (h *handler) quote(c *gin.Context) { // pay godoc // @Summary Start a visa/master/sber payout // @Description Registers the payment with GBÜS and returns the hosted-payment-page URL to complete it on. The final outcome is only known once GBÜS redirects back to the callback, which verifies and finalizes it. -// @Tags visa-master-payment-orders +// @Tags visa-master-payment // @Accept json // @Produce json // @Security BearerAuth @@ -115,7 +115,7 @@ func (h *handler) pay(c *gin.Context) { // status godoc // @Summary Re-check a visa/master/sber order's latest payment attempt // @Description For when the frontend can't rely on GBÜS's redirect having reached the callback (e.g. the user closed the hosted payment page first) - re-verifies the latest attempt with GBÜS server-to-server, the same way the callback does, and finalizes it if needed. Safe to call repeatedly. -// @Tags visa-master-payment-orders +// @Tags visa-master-payment // @Produce json // @Security BearerAuth // @Param id path int true "Visa/master payment order ID" @@ -152,7 +152,7 @@ func (h *handler) status(c *gin.Context) { // callback godoc // @Summary GBÜS payment callback // @Description GBÜS redirects the browser here after payment; the real outcome is verified server-to-server before anything is finalized -// @Tags visa-master-payment-orders +// @Tags visa-master-payment // @Produce json // @Param paymentId query int true "Payment attempt ID" // @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)