instruments

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountHolder

type AccountHolder struct {
	BillingAddress *common.Address `json:"billing_address,omitempty"`
	Phone          *common.Phone   `json:"phone,omitempty"`
}

AccountHolder -

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"`
	Default *bool  `json:"default,omitempty"`
}

Customer -

type Instrument

type Instrument struct {
	Type  string `json:"type" binding:"required"`
	Token string `json:"token" binding:"required"`
}

Instrument -

type InstrumentResponse

type InstrumentResponse struct {
	Type        string `json:"type" binding:"required"`
	Fingerprint string `json:"fingerprint,omitempty"`
}

InstrumentResponse -

type Request

type Request struct {
	*Instrument
	*Source
}

Request -

type Response

type Response struct {
	StatusResponse     *checkout.StatusResponse `json:"api_response,omitempty"`
	Source             *payments.SourceResponse `json:"source,omitempty"`
	InstrumentResponse *InstrumentResponse      `json:"instrument_response,omitempty"`
}

Response -

type Source

type Source struct {
	ExpiryMonth   uint64         `json:"expiry_month,omitempty"`
	ExpiryYear    uint64         `json:"expiry_year,omitempty"`
	Name          string         `json:"name,omitempty"`
	AccountHolder *AccountHolder `json:"account_holder,omitempty"`
	Customer      *Customer      `json:"customer,omitempty"`
}

Source -

Jump to

Keyboard shortcuts

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