payment-history: GET /{id}/gateway - all of an order's payments with their HALKBANK JSON
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

The gateway view now takes an order ID and returns every payment of the
order, newest first, each in the same PaymentGatewayDTO shape with its
own last stored GBÜS response. It moves from /payments/{id}/gateway to
/{id}/gateway, next to the other order-scoped routes (/{id}, /{id}/logs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 20:05:18 +05:00
parent ef3a1baee2
commit a3cbb52f4b
7 changed files with 182 additions and 118 deletions

View File

@@ -5430,25 +5430,25 @@ const docTemplate = `{
}
}
},
"/payment-history/payments/{id}/gateway": {
"/payment-history/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns one payment the way the per-order payment table shows it - 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) - 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": "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.",
"produces": [
"application/json"
],
"tags": [
"payment-history"
],
"summary": "Get a payment with its HALKBANK response",
"summary": "List an order's payments",
"parameters": [
{
"type": "integer",
"description": "Payment ID",
"description": "Order ID",
"name": "id",
"in": "path",
"required": true
@@ -5458,7 +5458,10 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/paymenthistory.PaymentGatewayDTO"
"type": "array",
"items": {
"$ref": "#/definitions/paymenthistory.PaymentHistoryItemDTO"
}
}
},
"400": {
@@ -5488,21 +5491,21 @@ const docTemplate = `{
}
}
},
"/payment-history/{id}": {
"/payment-history/{id}/gateway": {
"get": {
"security": [
{
"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}; the step-by-step logs are at /payment-history/{id}/logs.",
"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.",
"produces": [
"application/json"
],
"tags": [
"payment-history"
],
"summary": "List an order's payments",
"summary": "List an order's payments with their HALKBANK responses",
"parameters": [
{
"type": "integer",
@@ -5518,7 +5521,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/paymenthistory.PaymentHistoryItemDTO"
"$ref": "#/definitions/paymenthistory.PaymentGatewayDTO"
}
}
},

View File

@@ -5424,25 +5424,25 @@
}
}
},
"/payment-history/payments/{id}/gateway": {
"/payment-history/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns one payment the way the per-order payment table shows it - 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) - 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": "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.",
"produces": [
"application/json"
],
"tags": [
"payment-history"
],
"summary": "Get a payment with its HALKBANK response",
"summary": "List an order's payments",
"parameters": [
{
"type": "integer",
"description": "Payment ID",
"description": "Order ID",
"name": "id",
"in": "path",
"required": true
@@ -5452,7 +5452,10 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/paymenthistory.PaymentGatewayDTO"
"type": "array",
"items": {
"$ref": "#/definitions/paymenthistory.PaymentHistoryItemDTO"
}
}
},
"400": {
@@ -5482,21 +5485,21 @@
}
}
},
"/payment-history/{id}": {
"/payment-history/{id}/gateway": {
"get": {
"security": [
{
"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}; the step-by-step logs are at /payment-history/{id}/logs.",
"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.",
"produces": [
"application/json"
],
"tags": [
"payment-history"
],
"summary": "List an order's payments",
"summary": "List an order's payments with their HALKBANK responses",
"parameters": [
{
"type": "integer",
@@ -5512,7 +5515,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/paymenthistory.PaymentHistoryItemDTO"
"$ref": "#/definitions/paymenthistory.PaymentGatewayDTO"
}
}
},

View File

@@ -5635,7 +5635,8 @@ paths:
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}; the step-by-step logs are at /payment-history/{id}/logs.
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.
parameters:
- description: Order ID
in: path
@@ -5672,6 +5673,50 @@ paths:
summary: List an order's payments
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.
parameters:
- description: Order ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/paymenthistory.PaymentGatewayDTO'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"403":
description: Forbidden
schema:
$ref: '#/definitions/appresult.AppError'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: List an order's payments with their HALKBANK responses
tags:
- payment-history
/payment-history/{id}/logs:
get:
description: Returns the full step-by-step audit trail (visa_master_payment_logs)
@@ -5752,48 +5797,6 @@ paths:
summary: Get a single payment attempt
tags:
- payment-history
/payment-history/payments/{id}/gateway:
get:
description: Returns one payment the way the per-order payment table shows it
- 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) - together with the last GBÜS (HALKBANK) response
stored for it (gatewayResponse, null if GBÜS never answered). Backs the table's
storage icon.
parameters:
- description: Payment ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/paymenthistory.PaymentGatewayDTO'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"403":
description: Forbidden
schema:
$ref: '#/definitions/appresult.AppError'
"404":
description: Not Found
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Get a payment with its HALKBANK response
tags:
- payment-history
/payment-settings:
get:
description: Returns the admin-configurable bank and GBÜS commission fees used