From 0fde2de8f15844dd78a9c017eb7c34a9926461c3 Mon Sep 17 00:00:00 2001 From: Brooke Bryan Date: Mon, 14 Oct 2024 11:22:23 +0100 Subject: [PATCH] Connector retry type --- v1/scheduler/attempt_config.go | 3 +++ v1/scheduler/enums.go | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/v1/scheduler/attempt_config.go b/v1/scheduler/attempt_config.go index f59682b..152287f 100644 --- a/v1/scheduler/attempt_config.go +++ b/v1/scheduler/attempt_config.go @@ -10,6 +10,9 @@ type AttemptConfig struct { // MethodSelector indicates how payment method should be selected for this attempt MethodSelector MethodSelector `json:"methodSelector" yaml:"methodSelector" validate:"oneof=primary backup all all-backup"` + // ConnectorRetryType indicates how the attempt should retry (on the same connector), if needed + ConnectorRetryType ConnectorRetryType `json:"connectorRetryType" yaml:"connectorRetryType" validate:"oneof='' token-pan pan-token"` + // ConnectorLimit is a maximum number of connectors to process within an attempt per method ConnectorLimit int32 `json:"connectorLimit" yaml:"connectorLimit" validate:"min=0,max=1000"` diff --git a/v1/scheduler/enums.go b/v1/scheduler/enums.go index 7dc11a2..c9d168e 100644 --- a/v1/scheduler/enums.go +++ b/v1/scheduler/enums.go @@ -154,3 +154,14 @@ const ( // DayShiftClosest move the date to the closest day DayShiftClosest DayShift = "closest" ) + +type ConnectorRetryType string + +const ( + // ConnectorRetryTypeNone No retry + ConnectorRetryTypeNone ConnectorRetryType = "" + // ConnectorRetryTypeTokenToPan Use the token first, cascade to Pan if available + ConnectorRetryTypeTokenToPan ConnectorRetryType = "token-pan" + // ConnectorRetryTypePanToToken Use the Pan first, cascade to Token if available + ConnectorRetryTypePanToToken ConnectorRetryType = "pan-token" +)