mirror of
https://github.com/luxfi/bank.git
synced 2026-10-30 17:02:07 +00:00
Dead code removed (deadcode + staticcheck U1000 now silent module-wide): - DetectRail + its sepaCountries map (hooks/rails.go) — never wired up; the rail is selected downstream by treasuryd. - paymentTypeFees (hooks/fees.go) — orphaned by the fee-scope refactor. - the unused bv struct type in handleListBeneficiaries. Decomplect: the three screen functions (AML, sanctions, PEP) each read COMPLIANCE_SERVICE_URL and re-implemented the same call+policy dance. One screen(kind, blockValue, failOpen, payload) now owns the mechanism and the fail policy — the single place that talks to the compliance service; each caller declares only its payload and policy. One and one way. staticcheck, go vet, and deadcode all clean; full suite + coverage (~74%) green. Co-authored-by: Hanzo Dev <[email protected]>
44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package hooks
|
|
|
|
// Payment rails and their flat fees.
|
|
// IOM MTL covers EU e-money (SEPA), UK (FPS), and international (SWIFT).
|
|
// All rails route through the forex service which has CurrencyCloud, LMAX, Circle.
|
|
|
|
// PaymentRail identifies the payment network to use.
|
|
type PaymentRail string
|
|
|
|
const (
|
|
RailSEPA PaymentRail = "sepa" // EUR, EU/EEA — IOM MTL
|
|
RailSEPAInst PaymentRail = "sepa_inst" // EUR instant — IOM MTL
|
|
RailFPS PaymentRail = "fps" // GBP, UK — IOM MTL
|
|
RailACH PaymentRail = "ach" // USD, US domestic
|
|
RailWire PaymentRail = "wire" // USD, international (SWIFT)
|
|
RailSWIFT PaymentRail = "swift" // Any currency, international
|
|
RailInterac PaymentRail = "interac" // CAD, Canada
|
|
RailInternal PaymentRail = "internal" // Same-platform transfer
|
|
)
|
|
|
|
// RailFee returns the flat fee in minor units for a given rail.
|
|
func RailFee(rail PaymentRail) int64 {
|
|
switch rail {
|
|
case RailSEPA:
|
|
return 500 // €5.00
|
|
case RailSEPAInst:
|
|
return 1000 // €10.00
|
|
case RailFPS:
|
|
return 0 // free
|
|
case RailACH:
|
|
return 0 // free
|
|
case RailWire:
|
|
return 2500 // $25.00
|
|
case RailSWIFT:
|
|
return 3500 // $35.00
|
|
case RailInterac:
|
|
return 150 // C$1.50
|
|
case RailInternal:
|
|
return 0
|
|
default:
|
|
return 2500
|
|
}
|
|
}
|