Documentation ¶
Index ¶
Constants ¶
View Source
const ( ClientCollection = "clients" InvitationCollection = "invitations" PermissionCollection = "permissions" RoleCollection = "roles" KeyCollection = "keys" UserCollection = "users" )
Variables ¶
View Source
var AllTransactionMethod = []TransactionMethod{ TransactionMethodCreditCard, TransactionMethodDebitCard, TransactionMethodPaypal, TransactionMethodStripe, }
View Source
var AllTransactionStatus = []TransactionStatus{ TransactionStatusPending, TransactionStatusCompleted, TransactionStatusFailed, TransactionStatusRefunded, }
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct { Model `bson:",inline"` UID primitive.ObjectID `json:"uid" bson:"uid"` Wallet *primitive.ObjectID `json:"wallet" bson:"wallet"` Name string `json:"name" bson:"name"` Number string `json:"number" bson:"number"` ExpMonth int `json:"exp_month" bson:"exp_month"` ExpYear int `json:"exp_year" bson:"exp_year"` Cvv string `json:"cvv" bson:"cvv"` Last4 string `json:"last4" bson:"last4"` Brand string `json:"brand" bson:"brand"` Country string `json:"country" bson:"country"` Funding string `json:"funding" bson:"funding"` Fingerprint string `json:"fingerprint" bson:"fingerprint"` Billing primitive.M `json:"billing" bson:"billing"` Status string `json:"status" bson:"status"` }
func (*Card) Collection ¶
func (*Card) Index ¶
func (i *Card) Index() []mongo.IndexModel
func (*Card) MarshalBSON ¶
type Model ¶
type Model struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` Workspace primitive.ObjectID `json:"workspace,omitempty" bson:"workspace,omitempty"` Metadata primitive.M `json:"metadata,omitempty" bson:"metadata,omitempty"` Created primitive.Timestamp `json:"created,omitempty" bson:"created,omitempty"` Updated primitive.Timestamp `json:"updated,omitempty" bson:"updated,omitempty"` Deleted primitive.Timestamp `json:"deleted,omitempty" bson:"deleted,omitempty"` Timestamp primitive.Timestamp `json:"timestamp,omitempty" bson:"timestamp,omitempty"` }
type NewCardInput ¶
type NewTransaction ¶
type NewTransaction struct { Type string `json:"type"` Status string `json:"status"` Amount float64 `json:"amount"` Currency string `json:"currency"` Metadata map[string]interface{} `json:"metadata,omitempty"` Date string `json:"date"` Description string `json:"description"` Card string `json:"card"` UID string `json:"uid"` Wallet string `json:"wallet"` }
type Transaction ¶
type Transaction struct { Model `bson:",inline"` UID primitive.ObjectID `json:"uid" bson:"uid"` Wallet *primitive.ObjectID `json:"wallet" bson:"wallet"` Card *primitive.ObjectID `json:"card" bson:"card"` Type string `json:"type" bson:"type"` Status string `json:"status" bson:"status"` Amount float64 `json:"amount" bson:"amount"` Currency string `json:"currency" bson:"currency"` Date primitive.DateTime `json:"date" bson:"date"` Description *string `json:"description,omitempty" bson:"description,omitempty"` }
func (*Transaction) Collection ¶
func (i *Transaction) Collection() string
func (*Transaction) Index ¶
func (i *Transaction) Index() []mongo.IndexModel
func (*Transaction) MarshalBSON ¶
func (i *Transaction) MarshalBSON() ([]byte, error)
type TransactionMethod ¶
type TransactionMethod string
const ( TransactionMethodCreditCard TransactionMethod = "CREDIT_CARD" TransactionMethodDebitCard TransactionMethod = "DEBIT_CARD" TransactionMethodPaypal TransactionMethod = "PAYPAL" TransactionMethodStripe TransactionMethod = "STRIPE" )
func (TransactionMethod) IsValid ¶
func (e TransactionMethod) IsValid() bool
func (TransactionMethod) MarshalGQL ¶
func (e TransactionMethod) MarshalGQL(w io.Writer)
func (TransactionMethod) String ¶
func (e TransactionMethod) String() string
func (*TransactionMethod) UnmarshalGQL ¶
func (e *TransactionMethod) UnmarshalGQL(v interface{}) error
type TransactionStatus ¶
type TransactionStatus string
const ( TransactionStatusPending TransactionStatus = "PENDING" TransactionStatusCompleted TransactionStatus = "COMPLETED" TransactionStatusFailed TransactionStatus = "FAILED" TransactionStatusRefunded TransactionStatus = "REFUNDED" )
func (TransactionStatus) IsValid ¶
func (e TransactionStatus) IsValid() bool
func (TransactionStatus) MarshalGQL ¶
func (e TransactionStatus) MarshalGQL(w io.Writer)
func (TransactionStatus) String ¶
func (e TransactionStatus) String() string
func (*TransactionStatus) UnmarshalGQL ¶
func (e *TransactionStatus) UnmarshalGQL(v interface{}) error
type Transactions ¶
type Transactions struct { Data []*Transaction `json:"data,omitempty"` Count int `json:"count"` }
type UpdateCardInput ¶
type UpdateCardInput struct { Name *string `json:"name,omitempty"` ExpMonth *int `json:"exp_month,omitempty"` ExpYear *int `json:"exp_year,omitempty"` Cvv *string `json:"cvv,omitempty"` Billing map[string]interface{} `json:"billing,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
type UpdateTransaction ¶
type UpdateWallet ¶
type Wallet ¶
type Wallet struct { Model `bson:",inline"` UID primitive.ObjectID `json:"uid" bson:"uid"` Balance float64 `json:"balance" bson:"balance"` Currency string `json:"currency" bson:"currency"` Status string `json:"status" bson:"status"` }
func (*Wallet) Collection ¶
func (*Wallet) Index ¶
func (i *Wallet) Index() []mongo.IndexModel
func (*Wallet) MarshalBSON ¶
Click to show internal directories.
Click to hide internal directories.