feat(hardlink): unify kiosk payments and finalize legacy cleanup

This commit is contained in:
2026-11-04 17:43:10 +00:00
parent 568adc034b
commit 814d87768d
57 changed files with 3624 additions and 1762 deletions
+44
View File
@@ -0,0 +1,44 @@
package trustpayments
// These are provider-call values, not persistent operations or kiosk sessions.
const (
Approved = "APPROVED_VALIDATED"
Declined = "DECLINED"
Cancelled = "CANCELLED"
Pending = "PENDING"
Unknown = "UNKNOWN"
Review = "REVIEW_REQUIRED"
)
type Request struct {
Kind string
Amount int64
Currency string
}
type Operation struct {
Request Request
RefID, TxnDate string
}
type Metadata struct {
Receipt, Sequence, AuthCode, CardType, LastFour string
}
func (m Metadata) Description(ref string) string {
s := "Tx " + ref
for _, v := range [][2]string{{"Rec", m.Receipt}, {"Seq", m.Sequence}, {"Hash", m.AuthCode}, {"Ref", m.CardType + m.LastFour}} {
if v[1] != "" {
s += " " + v[0] + " " + v[1]
}
}
return s
}
type Result struct {
State, RefID, Currency, Code string
Amount int64
Metadata Metadata
ObservedAmount, ObservedFinalAmount int64
ObservedAmountKnown, ObservedFinalKnown bool
}