fixed verification code

This commit is contained in:
Stephan D
2026-02-09 16:40:52 +01:00
parent f8a3bef2e6
commit eda6b75f74
78 changed files with 1118 additions and 487 deletions

View File

@@ -196,6 +196,9 @@ func updateExecutionStepsFromGatewayExecution(
}
setExecutionStepStatus(execStep, status)
if exec.Error != "" && execStep.Error == "" {
execStep.Error = strings.TrimSpace(exec.Error)
}
log.Debug("Execution step state updated",
zap.Int("step_index", idx),

View File

@@ -60,9 +60,17 @@ func TestGatewayExecutionRejectedFailsPayment(t *testing.T) {
payment := &paymodel.Payment{
PaymentRef: "pi-2", State: paymodel.PaymentStateSubmitted, IdempotencyKey: "idem-1",
PaymentPlan: &paymodel.PaymentPlan{
Steps: []*paymodel.PaymentStep{
{StepID: "crypto_send"},
},
},
ExecutionPlan: &paymodel.ExecutionPlan{
Steps: []*paymodel.ExecutionStep{
{OperationRef: "s1", State: paymodel.OperationStatePlanned, TransferRef: "trn-1"}}}}
{Code: "crypto_send", OperationRef: "s1", State: paymodel.OperationStateWaiting, TransferRef: "trn-1"},
},
},
}
if err := store.Create(context.Background(), payment); err != nil {
t.Fatalf("failed to seed payment: %v", err)
@@ -74,9 +82,11 @@ func TestGatewayExecutionRejectedFailsPayment(t *testing.T) {
}
exec := &model.PaymentGatewayExecution{
PaymentRef: "pi-2",
TransferRef: "trn-1",
Status: rail.OperationResultFailed,
PaymentRef: "pi-2",
OperationRef: "s1",
TransferRef: "trn-1",
Status: rail.OperationResultFailed,
Error: "execution_plan_failed",
}
if err := svc.onGatewayExecution(context.Background(), exec); err != nil {

View File

@@ -165,6 +165,7 @@ func (p *paymentExecutor) pickIndependentSteps(
if blocked {
lg.Debug("Step permanently blocked by dependency failure")
setExecutionStepStatus(execStep, model.OperationStateCancelled)
continue
}

View File

@@ -66,8 +66,8 @@ func TestReleasePaymentHold_RejectsLegacyLedgerRelease(t *testing.T) {
store.payments[payment.PaymentRef] = payment
execPlan := ensureExecutionPlanForPlan(payment, payment.PaymentPlan)
steps := executionStepsByCode(execPlan)
payment.ExecutionPlan = ensureExecutionPlanForPlan(payment, payment.PaymentPlan)
steps := executionStepsByCode(payment.ExecutionPlan)
blockStep := steps["ledger_block"]
if blockStep == nil {
t.Fatalf("expected block step in execution plan")