fixed rail & operation names
This commit is contained in:
@@ -2,6 +2,7 @@ package execution
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/tech/sendico/pkg/discovery"
|
||||
"strings"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -83,7 +84,7 @@ func blockStepConfirmed(plan *model.PaymentPlan, execPlan *model.ExecutionPlan)
|
||||
}
|
||||
execSteps := executionStepsByCode(execPlan)
|
||||
for idx, step := range plan.Steps {
|
||||
if step == nil || step.Action != model.RailOperationBlock {
|
||||
if step == nil || step.Action != discovery.RailOperationBlock {
|
||||
continue
|
||||
}
|
||||
execStep := execSteps[planStepID(step, idx)]
|
||||
@@ -106,7 +107,7 @@ func roleHintsForStep(plan *model.PaymentPlan, idx int) (*account_role.AccountRo
|
||||
if step == nil {
|
||||
continue
|
||||
}
|
||||
if step.Rail != model.RailLedger || step.Action != model.RailOperationMove {
|
||||
if step.Rail != discovery.RailLedger || step.Action != discovery.RailOperationMove {
|
||||
continue
|
||||
}
|
||||
if step.ToRole != nil && strings.TrimSpace(string(*step.ToRole)) != "" {
|
||||
@@ -135,7 +136,7 @@ func linkRailObservation(payment *model.Payment, rail model.Rail, referenceID, d
|
||||
if planStep == nil {
|
||||
continue
|
||||
}
|
||||
if planStep.Rail != rail || planStep.Action != model.RailOperationObserveConfirm {
|
||||
if planStep.Rail != rail || planStep.Action != discovery.RailOperationObserveConfirm {
|
||||
continue
|
||||
}
|
||||
if dep != "" {
|
||||
@@ -206,12 +207,12 @@ func failureCodeForStep(step *model.PaymentStep) model.PaymentFailureCode {
|
||||
return model.PaymentFailureCodePolicy
|
||||
}
|
||||
switch step.Rail {
|
||||
case model.RailLedger:
|
||||
if step.Action == model.RailOperationFXConvert {
|
||||
case discovery.RailLedger:
|
||||
if step.Action == discovery.RailOperationFXConvert {
|
||||
return model.PaymentFailureCodeFX
|
||||
}
|
||||
return model.PaymentFailureCodeLedger
|
||||
case model.RailCrypto:
|
||||
case discovery.RailCrypto:
|
||||
return model.PaymentFailureCodeChain
|
||||
default:
|
||||
return model.PaymentFailureCodePolicy
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package execution
|
||||
|
||||
import (
|
||||
"github.com/tech/sendico/pkg/discovery"
|
||||
"strings"
|
||||
|
||||
"github.com/tech/sendico/payments/storage/model"
|
||||
@@ -199,8 +200,8 @@ func cardPayoutDependenciesConfirmed(
|
||||
continue
|
||||
}
|
||||
|
||||
if step.Rail != model.RailCardPayout ||
|
||||
step.Action != model.RailOperationSend {
|
||||
if step.Rail != discovery.RailCardPayout ||
|
||||
step.Action != discovery.RailOperationSend {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user