payment-history: payment detail with GBÜS response, sorting, newest-first logs
- GET /payment-history/payments/{id}: single payment attempt with the raw
gateway_response (last HALKBANK JSON) for the "storage" icon modal
- GET /payment-history: sort (id/created_at/status/amount) and order
(asc/desc, default desc) query params
- GET /payment-history/{id}: order logs now newest first
- index on visa_master_order_payments (gateway_status, id DESC)
- regenerate swagger docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e5f01d0e94
commit
a715cd23ea
10 files changed
+2140
-60
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"online-back/internal/payment/paymenthistory"
|
||||
)
|
||||
|
||||
func TestOrderByClause(t *testing.T) {
|
||||
cases := []struct {
|
||||
filter paymenthistory.ListFilter
|
||||
want string
|
||||
}{
|
||||
{paymenthistory.ListFilter{Desc: true}, "p.id DESC"},
|
||||
{paymenthistory.ListFilter{Sort: "id"}, "p.id ASC"},
|
||||
{paymenthistory.ListFilter{Sort: "status", Desc: true}, "p.gateway_status DESC, p.id DESC"},
|
||||
{paymenthistory.ListFilter{Sort: "amount"}, "p.amount_tmt ASC, p.id DESC"},
|
||||
{paymenthistory.ListFilter{Sort: "p.id; DROP TABLE users", Desc: true}, "p.id DESC"},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
if got := orderByClause(tc.filter); got != tc.want {
|
||||
t.Errorf("orderByClause(%+v) = %q, want %q", tc.filter, got, tc.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user