tokens

package
v0.0.0-...-ff628f3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplePayTokenData

type ApplePayTokenData struct {
	Version   string            `json:"version,omitempty"`
	Data      string            `json:"data,omitempty"`
	Signature string            `json:"signature,omitempty"`
	Header    map[string]string `json:"header,omitempty"`
}

func (*ApplePayTokenData) GetType

func (t *ApplePayTokenData) GetType() TokenType

type CardTokenRequest

type CardTokenRequest struct {
	Type           TokenType       `json:"type" binding:"required"`
	Number         string          `json:"number" binding:"required"`
	ExpiryMonth    int             `json:"expiry_month" binding:"required"`
	ExpiryYear     int             `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"`
}

type CardTokenResponse

type CardTokenResponse struct {
	HttpMetadata   common.HttpMetadata
	Type           TokenType           `json:"type,omitempty"`
	Token          string              `json:"token" binding:"required"`
	ExpiresOn      *time.Time          `json:"expires_on,omitempty"`
	ExpiryMonth    int                 `json:"expiry_month,omitempty"`
	ExpiryYear     int                 `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"`
	TokenFormat    string              `json:"token_format,omitempty"`
	Name           string              `json:"name,omitempty"`
	BillingAddress *common.Address     `json:"billing_address,omitempty"`
	Phone          *common.Phone       `json:"phone,omitempty"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(configuration *configuration.Configuration, apiClient client.HttpClient) *Client

func (*Client) RequestCardToken

func (c *Client) RequestCardToken(request CardTokenRequest) (*CardTokenResponse, error)

func (*Client) RequestCardTokenWithContext

func (c *Client) RequestCardTokenWithContext(ctx context.Context, request CardTokenRequest) (*CardTokenResponse, error)

func (*Client) RequestWalletToken

func (c *Client) RequestWalletToken(request WalletTokenRequest) (*CardTokenResponse, error)

func (*Client) RequestWalletTokenWithContext

func (c *Client) RequestWalletTokenWithContext(ctx context.Context, request WalletTokenRequest) (*CardTokenResponse, error)

type GooglePayTokenData

type GooglePayTokenData struct {
	Signature       string `json:"signature,omitempty"`
	ProtocolVersion string `json:"protocolVersion,omitempty"`
	SignedMessage   string `json:"signedMessage,omitempty"`
}

func (*GooglePayTokenData) GetType

func (t *GooglePayTokenData) GetType() TokenType

type TokenData

type TokenData interface {
	GetType() TokenType
}

type TokenType

type TokenType string
const (
	Card      TokenType = "card"
	ApplePay  TokenType = "applepay"
	GooglePay TokenType = "googlepay"
)

type WalletTokenRequest

type WalletTokenRequest struct {
	Type      TokenType `json:"type" binding:"required"`
	TokenData TokenData `json:"token_data" binding:"required"`
}

Jump to

Keyboard shortcuts

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