ch some
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

This commit is contained in:
guwandyk committed 2026-09-21 19:12:07 +05:00
1 parent febd190d6e
commit 235ef5ec9e
8 files changed
+96 -19

No files matched your search

@@ -294,8 +294,8 @@ func (r *repository) Pay(ctx context.Context, orderID int64, dto visamasterpay.P
return visamasterpay.PaymentInitResultDTO{}, err
}
println("[pay] step 13 done: paymentId=", paymentID, "formUrl=", result.FormUrl)
return visamasterpay.PaymentInitResultDTO{PaymentId: paymentID, FormUrl: result.FormUrl}, nil
println("[pay] step 13 done: paymentId=", paymentID, "formUrl=", result.FormUrl, "successUrl=", returnURL)
return visamasterpay.PaymentInitResultDTO{PaymentId: paymentID, OrderId: orderID, FormUrl: result.FormUrl, SuccessUrl: returnURL}, nil
}
// HandleCallback is hit (unauthenticated - see rbac.isPublicAdminPath) when
@@ -409,9 +409,9 @@ func (r *repository) HandleCallback(ctx context.Context, paymentID int64) (visam
}
println("[callback] step 7b ok: lockedPaid=", lockedPaid)
if !lockedPaid {
println("[callback] step 7c: marking order paid")
println("[callback] step 7c: marking order paid and completed")
if _, err := tx.Exec(ctx,
`UPDATE visa_master_payment_orders SET paid = true, updated_at = (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') WHERE id = $1`,
`UPDATE visa_master_payment_orders SET paid = true, status = 'completed', updated_at = (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') WHERE id = $1`,
orderID,
); err != nil {
println("[callback] step 7c FAILED: mark order paid:", err.Error())
+7 -2
View File
@@ -45,9 +45,14 @@ type PayOrderDTO struct {
// - the customer (or the operator, in-branch) must complete payment there.
// The definitive outcome only becomes known once GBÜS redirects back to
// our callback, which verifies and finalizes it - see PaymentResultDTO.
// SuccessUrl is that same callback URL (embedded in the GBÜS register
// request as ReturnURL) - the frontend can watch for navigation to it
// inside the hosted-payment-page webview to know the flow has ended.
type PaymentInitResultDTO struct {
PaymentId int64 `json:"paymentId"`
FormUrl string `json:"formUrl"`
PaymentId int64 `json:"paymentId"`
OrderId int64 `json:"orderId"`
FormUrl string `json:"formUrl"`
SuccessUrl string `json:"successUrl"`
}
// PaymentResultDTO is one payout attempt's final, verified state, recorded