Bootstrap copied BFF and local accounts with public Sendico contracts (#34)
This commit is contained in:
1 parent
67dc5b5b1e
commit
7062672a87
556 files changed
+42291
-777
No files matched your search
@@ -0,0 +1,47 @@
|
||||
package merrors
|
||||
|
||||
import "strings"
|
||||
|
||||
const ReasonPaymentExecutionNotAccepted = "PAYMENT_EXECUTION_NOT_ACCEPTED"
|
||||
|
||||
var ErrPaymentExecutionNotAccepted = Define("payment.execution_not_accepted")
|
||||
|
||||
type paymentExecutionNotAcceptedError struct {
|
||||
classifiedError
|
||||
cause error
|
||||
}
|
||||
|
||||
func (e paymentExecutionNotAcceptedError) Unwrap() []error {
|
||||
causes := e.classifiedError.Unwrap()
|
||||
if e.cause != nil {
|
||||
causes = append(causes, e.cause)
|
||||
}
|
||||
return causes
|
||||
}
|
||||
|
||||
// PaymentExecutionNotAccepted reports that the orchestrator proved an
|
||||
// execution request did not create or reuse any payment. Callers may release
|
||||
// request-side reservations only for this outcome; ordinary transport and
|
||||
// internal errors have an ambiguous ownership result.
|
||||
func PaymentExecutionNotAccepted(msg string) error {
|
||||
return PaymentExecutionNotAcceptedWrap(nil, msg)
|
||||
}
|
||||
|
||||
// PaymentExecutionNotAcceptedWrap adds the definitive rejection
|
||||
// classification while retaining the underlying cause for diagnostics.
|
||||
func PaymentExecutionNotAcceptedWrap(cause error, msg string) error {
|
||||
msg = strings.TrimSpace(msg)
|
||||
if msg == "" {
|
||||
msg = "payment execution was not accepted before a payment was created"
|
||||
}
|
||||
return paymentExecutionNotAcceptedError{
|
||||
classifiedError: classifiedError{
|
||||
base: ErrFailedPrecondition,
|
||||
code: ErrPaymentExecutionNotAccepted,
|
||||
msg: msg,
|
||||
reason: ReasonPaymentExecutionNotAccepted,
|
||||
publicMessage: true,
|
||||
},
|
||||
cause: cause,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user