networktoken

package
v1.42.45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type Network

type Network string

Network represents the card network.

const (
	Visa       Network = "visa"
	Mastercard Network = "mastercard"
	Amex       Network = "amex"
)

type NetworkToken

type NetworkToken struct {
	mixin.Model[NetworkToken]

	// Reference to the vault card token (tok_...)
	CardTokenId string `json:"cardTokenId"`

	// EMV payment token (DPAN) — NOT the real PAN
	NetworkToken string `json:"networkToken,omitempty"`

	// Token expiry (may differ from card expiry)
	TokenExpiry string `json:"tokenExpiry,omitempty"`

	// TSP reference ID for lifecycle management
	TokenReference string `json:"tokenReference"`

	// Payment Account Reference — links tokens across networks
	PAR string `json:"par,omitempty"`

	// Card network: visa, mastercard, amex
	Network Network `json:"network"`

	// Current status
	Status Status `json:"status"`

	// Token Requestor ID (identifies the merchant/platform)
	TokenRequestorId string `json:"tokenRequestorId,omitempty"`

	// Last successful cryptogram refresh
	LastRefreshed time.Time `json:"lastRefreshed,omitempty"`

	// Metadata for wallet integrations (Apple Pay, Google Pay)
	WalletType string `json:"walletType,omitempty"` // apple_pay, google_pay, none

	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

func New

func (*NetworkToken) Defaults

func (nt *NetworkToken) Defaults()

func (*NetworkToken) IsUsable

func (nt *NetworkToken) IsUsable() bool

IsUsable returns true if the token can be used for transactions.

func (*NetworkToken) MarkDeleted

func (nt *NetworkToken) MarkDeleted() error

Delete marks the token for deletion.

func (*NetworkToken) Resume

func (nt *NetworkToken) Resume() error

Resume reactivates a suspended token.

func (*NetworkToken) Suspend

func (nt *NetworkToken) Suspend() error

Suspend marks the token as suspended (e.g., lost card).

type Status

type Status string

Status represents the lifecycle state of a network token.

const (
	Active    Status = "active"
	Suspended Status = "suspended"
	Deleted   Status = "deleted"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL