tokens

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Type           common.TokenType `json:"type" binding:"required"`
	Number         string           `json:"number" binding:"required"`
	ExpiryMonth    uint64           `json:"expiry_month" binding:"required"`
	ExpiryYear     uint64           `json:"expiry_year" binding:"required"`
	Name           string           `json:"name,omitempty"`
	CVV            string           `json:"cvv,omitempty"`
	BillingAddress *common.Address  `json:"billing_address,omitempty"`
	Phone          *common.Phone    `json:"phone,omitempty"`
}

Card -

type Client

type Client struct {
	API checkout.HTTPClient
}

Client ...

func NewClient

func NewClient(config checkout.Config) *Client

NewClient ...

func (*Client) Request

func (c *Client) Request(request *Request) (*Response, error)

Request ...

type Created

type Created struct {
	Type          string              `json:"type,omitempty"`
	Token         string              `json:"token" binding:"required"`
	ExpiresOn     time.Time           `json:"expires_on,omitempty"`
	ExpiryMonth   uint64              `json:"expiry_month,omitempty"`
	ExpiryYear    uint64              `json:"expiry_year,omitempty"`
	Scheme        string              `json:"scheme,omitempty"`
	Last4         string              `json:"last4,omitempty"`
	Bin           string              `json:"bin,omitempty"`
	CardType      common.CardType     `json:"card_type,omitempty"`
	CardCategory  common.CardCategory `json:"card_category,omitempty"`
	Issuer        string              `json:"issuer,omitempty"`
	IssuerCountry string              `json:"issuer_country,omitempty"`
	ProductID     string              `json:"product_id,omitempty"`
	ProductType   string              `json:"product_type,omitempty"`
}

Created -

type Request

type Request struct {
	*Card
	*Wallet
}

Request -

func (*Request) MarshalJSON

func (s *Request) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (*Request) UnmarshalJSON

func (s *Request) UnmarshalJSON(data []byte) error

UnmarshalJSON ...

type Response

type Response struct {
	StatusResponse *checkout.StatusResponse `json:"api_response,omitempty"`
	Created        *Created                 `json:"created,omitempty"`
}

Response -

type Wallet

type Wallet struct {
	Type      common.TokenType       `json:"type" binding:"required"`
	TokenData map[string]interface{} `json:"token_data" binding:"required"`
}

Wallet -

Jump to

Keyboard shortcuts

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