accounts

package
v1.46.21 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 3 Imported by: 1 module, 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

This section is empty.

Types

type Account

type Account struct {
	Type Type `json:"type"`

	// Deprecated
	AffirmAccount
	PayPalAccount
	StripeAccount
	// PlaidAccount
	BitcoinTransaction
	EthereumTransaction
	AuthorizeNetAccount

	Affirm AffirmAccount `json:"affirm,omitempty"`
	PayPal PayPalAccount `json:"paypal,omitempty"`
	Square SquareAccount `json:"square,omitempty"`
	Stripe StripeAccount `json:"stripe,omitempty"`
	// Plaid        PlaidAccount        `json:"plaid,omitempty"`
	Bitcoin      BitcoinTransaction  `json:"bitcoin,omitempty"`
	Ethereum     EthereumTransaction `json:"ethereum,omitempty"`
	AuthorizeNet AuthorizeNetAccount `json:"authorizenet,omitempty"`

	Error string `json:"error,omitempty"`
}

Sort of a union type of all possible payment accounts, used everywhere for convenience

type AffirmAccount

type AffirmAccount struct {
	CaptureId     string `json:"captureId,omitempty"`
	TransactionId string `json:"transactionId,omitempty"`
	CheckoutToken string `json:"checkoutToken,omitempty"`
}

type AuthorizeNetAccount

type AuthorizeNetAccount struct {
	AuthCode       string `json:"authCode,omitempty"`
	AvsResultCode  string `json:"avsResultCode,omitempty"`
	CvvResultCode  string `json:"cvvResultCode,omitempty"`
	CavvResultCode string `json:"cavvResultCode,omitempty"`
	TransId        string `json:"transId,omitempty"`
	RefTransId     string `json:"refTransId,omitempty"`
	TransHash      string `json:"transHash,omitempty"`
	TestRequest    string `json:"testRequest,omitempty"`
	AccountNumber  string `json:"accountNumber,omitempty"`
	AccountType    string `json:"accountType,omitempty"`
	Messages       string `json:"message,omitempty"`
	ErrorMessages  string `json:"errorMessage,omitempty"`
}

type BitcoinTransaction

type BitcoinTransaction struct {
	BitcoinTransactionTxId string           `json:"bitcoinTransactionTxId,omitempty"`
	BitcoinChainType       blockchains.Type `json:"bitcoinChainType,omitempty"`
	BitcoinAmount          currency.Cents   `json:"bitcoinAmount,omitempty"`

	// Denotes whether or not a successful transfer occurred
	BitcoinTransferred bool `json:"bitcoinTransfered"`

	BitcoinFinalTransactionTxId string         `json:"finalbitcoinTransactionTxId,omitempty"`
	BitcoinFinalTransactionCost currency.Cents `json:"finalbitcoinTransactionCost,omitempty"`
	BitcoinFinalAddress         string         `json:"finalbitcoinAddress,omitempty"`
	BitcoinFinalAmount          currency.Cents `json:"finalbitcoinAmount,omitempty"`
}

type EthereumTransaction

type EthereumTransaction struct {
	EthereumTransactionHash string                `json:"ethereumTransactionHash,omitempty"`
	EthereumChainType       blockchains.Type      `json:"ethereumChainType,omitempty"`
	EthereumAmount          blockchains.BigNumber `json:"ethereumAmount,omitempty"`
	EthereumFromAddress     string                `json:"ethereumFromAddress,omitempty"`
	EthereumToAddress       string                `json:"ethereumToAddress,omitempty"`

	// Denotes whether or not a successful transfer occurred
	EthereumTransferred bool `json:"ethereumTransfered"`

	EthereumFinalTransactionHash string                `json:"finalEthereumTransactionHash,omitempty"`
	EthereumFinalTransactionCost blockchains.BigNumber `json:"finalEthereumTransactionCost,omitempty"`
	EthereumFinalAddress         string                `json:"finalEthereumAddress,omitempty"`
	EthereumFinalAmount          blockchains.BigNumber `json:"finalEthereumAmount,omitempty"`
}

type PayPalAccount

type PayPalAccount struct {
	Email       string `json:"email,omitempty"`
	SellerEmail string `json:"sellerEmail,omitempty"`
	RedirectUrl string `json:"redirectUrl,omitempty"`
	Ipn         string `json:"ipn,omitempty"`

	PayKey         string `json:"payKey,omitempty"`
	PreapprovalKey string `json:"preapprovalKey,omitempty"`

	// Preapproval expiration date (Unix timestamp in milliseconds).
	Ending int `json:"ending,omitempty"`

	// Preapproval expiration date (ISO 8601 timestamp).
	EndingDate string `json:"endingDate,omitempty"`
}

type SquareAccount

type SquareAccount struct {
	PaymentId  string `json:"paymentId,omitempty"`
	CustomerId string `json:"customerId,omitempty"`
	LocationId string `json:"locationId,omitempty"`
	CardBrand  string `json:"cardBrand,omitempty"`
	LastFour   string `json:"lastFour,omitempty"`
	ReceiptURL string `json:"receiptUrl,omitempty"`
}

type StripeAccount

type StripeAccount struct {
	// Very important to never store these!
	Name   string `json:"name,omitempty" datastore:"-"`
	Number string `json:"number,omitempty" datastore:"-"`
	CVC    string `json:"cvc,omitempty" datastore:"-"`

	BalanceTransactionId string `json:"balanceTransactionId,omitempty"`
	CardId               string `json:"cardId,omitempty"`
	ChargeId             string `json:"chargeId,omitempty"`
	CustomerId           string `json:"customerId,omitempty"`

	Fingerprint string `json:"fingerprint,omitempty"`
	Funding     string `json:"funding,omitempty"`
	Brand       string `json:"brand,omitempty"`
	LastFour    string `json:"lastFour,omitempty"`
	Month       int    `json:"month,string,omitempty"`
	Year        int    `json:"year,string,omitempty"`
	Country     string `json:"country,omitempty"`

	CVCCheck string `json:"cvcCheck,omitempty"`
}

func (StripeAccount) CardMatches

func (sa StripeAccount) CardMatches(acct Account) bool

type Type

type Type string
const (
	AffirmType       Type = "affirm"
	AuthorizeNetType Type = "authorizenet"
	BalanceType      Type = "balance"
	EthereumType     Type = "ethereum"
	BitcoinType      Type = "bitcoin"
	NullType         Type = "null"
	PayPalType       Type = "paypal"
	SquareType       Type = "square"
	StripeType       Type = "stripe"
	PlaidType        Type = "plaid"
)

Jump to

Keyboard shortcuts

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