instruments

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 Client

type Client struct {
	API checkout.HTTPClient
}

Client ...

func NewClient

func NewClient(config checkout.Config) *Client

NewClient ...

func (*Client) Create

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

Create an instrument

func (*Client) Get

func (c *Client) Get(sourceID string) (*Response, error)

Get instrument details

func (*Client) Update

func (c *Client) Update(sourceID string, request *Request) (*Response, error)

Update instrument details

type Customer

type Customer struct {
	ID      string        `json:"id,omitempty"`
	Email   string        `json:"email,omitempty"`
	Name    string        `json:"name,omitempty"`
	Phone   *common.Phone `json:"phone,omitempty"`
	Default *bool         `json:"default,omitempty"`
}

Customer -

type Instrument

type Instrument struct {
	ID            string               `json:"id"`
	Type          string               `json:"type,omitempty"`
	Fingerprint   string               `json:"fingerprint,omitempty"`
	ExpiryMonth   int                  `json:"expiry_month,omitempty"`
	ExpiryYear    int                  `json:"expiry_year,omitempty"`
	Name          string               `json:"name,omitempty"`
	Scheme        string               `json:"scheme,omitempty"`
	Last4         string               `json:"last4,omitempty"`
	Bin           string               `json:"bin,omitempty"`
	CardType      string               `json:"card_type,omitempty"`
	CardCategory  string               `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"`
	AccountHolder common.AccountHolder `json:"account_holder,omitempty"`
}

type InstrumentResponse

type InstrumentResponse struct {
	*Instrument
	Customer *Customer `json:"customer,omitempty"`
}

InstrumentResponse -

type Request

type Request struct {
	Type          string                `json:"type" binding:"required"`
	Token         string                `json:"token" binding:"required"`
	AccountHolder *common.AccountHolder `json:"account_holder,omitempty"`
	Customer      *Customer             `json:"customer,omitempty"`
}

Request -

type Response

type Response struct {
	StatusResponse *checkout.StatusResponse `json:"api_response,omitempty"`
	Instrument     *InstrumentResponse      `json:"instrument_response,omitempty"`
}

Response -

Jump to

Keyboard shortcuts

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