multi: implement Fail method for sql backend

This commit is contained in:
ziggie committed 2026-02-25 08:02:15 +01:00
1 parent caf73c59da
commit fd6796e561
4 files changed
+83

No files matched your search

+13
View File
@@ -85,6 +85,19 @@ func (q *Queries) FailAttempt(ctx context.Context, arg FailAttemptParams) error
return err
}
const failPayment = `-- name: FailPayment :execresult
UPDATE payments SET fail_reason = $1 WHERE payment_identifier = $2
`
type FailPaymentParams struct {
FailReason sql.NullInt32
PaymentIdentifier []byte
}
func (q *Queries) FailPayment(ctx context.Context, arg FailPaymentParams) (sql.Result, error) {
return q.db.ExecContext(ctx, failPayment, arg.FailReason, arg.PaymentIdentifier)
}
const fetchAllInflightAttempts = `-- name: FetchAllInflightAttempts :many
SELECT
ha.id,