outbox for gateways
This commit is contained in:
11
api/payments/quotation/internal/shared/account.go
Normal file
11
api/payments/quotation/internal/shared/account.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package shared
|
||||
|
||||
import "github.com/tech/sendico/pkg/model/account_role"
|
||||
|
||||
func CloneAccountRole(role *account_role.AccountRole) *account_role.AccountRole {
|
||||
if role == nil {
|
||||
return nil
|
||||
}
|
||||
cloned := *role
|
||||
return &cloned
|
||||
}
|
||||
20
api/payments/quotation/internal/shared/funding.go
Normal file
20
api/payments/quotation/internal/shared/funding.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package shared
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/tech/sendico/payments/storage/model"
|
||||
)
|
||||
|
||||
func NormalizeFundingMode(mode model.FundingMode) model.FundingMode {
|
||||
switch strings.ToLower(strings.TrimSpace(string(mode))) {
|
||||
case string(model.FundingModeNone):
|
||||
return model.FundingModeNone
|
||||
case string(model.FundingModeBalanceReserve):
|
||||
return model.FundingModeBalanceReserve
|
||||
case string(model.FundingModeDepositObserved):
|
||||
return model.FundingModeDepositObserved
|
||||
default:
|
||||
return model.FundingModeUnspecified
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user