File size: 1,115 Bytes
429334c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | package payment
import (
"net/http"
"github.com/openmeterio/openmeter/pkg/framework/commonhttp"
"github.com/openmeterio/openmeter/pkg/models"
)
const ErrCodePaymentAlreadyAuthorized models.ErrorCode = "payment_already_authorized"
var ErrPaymentAlreadyAuthorized = models.NewValidationIssue(
ErrCodePaymentAlreadyAuthorized,
"payment already authorized",
models.WithCriticalSeverity(),
commonhttp.WithHTTPStatusCodeAttribute(http.StatusBadRequest),
)
const ErrCodePaymentAlreadySettled models.ErrorCode = "payment_already_settled"
var ErrPaymentAlreadySettled = models.NewValidationIssue(
ErrCodePaymentAlreadySettled,
"payment already settled",
models.WithCriticalSeverity(),
commonhttp.WithHTTPStatusCodeAttribute(http.StatusBadRequest),
)
const ErrCodeCannotSettleNotAuthorizedPayment models.ErrorCode = "cannot_settle_not_authorized_payment"
var ErrCannotSettleNotAuthorizedPayment = models.NewValidationIssue(
ErrCodeCannotSettleNotAuthorizedPayment,
"cannot settle an unauthorized payment",
models.WithCriticalSeverity(),
commonhttp.WithHTTPStatusCodeAttribute(http.StatusBadRequest),
)
|