customers

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: 7 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 a customer

func (*Client) Get

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

Get customer details

func (*Client) Update

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

Update customer details

type Customer

type Customer struct {
	Email    string                 `json:"email" binding:"required"`
	Name     string                 `json:"name,omitempty"`
	Phone    *common.Phone          `json:"phone,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

Customer request

type CustomerResponse

type CustomerResponse struct {
	ID          string                   `json:"id"`
	Email       string                   `json:"email,omitempty"`
	Default     string                   `json:"default,omitempty"`
	Name        string                   `json:"name,omitempty"`
	Phone       *common.Phone            `json:"phone,omitempty"`
	Metadata    map[string]interface{}   `json:"metadata,omitempty"`
	Instruments []instruments.Instrument `json:"instruments,omitempty"`
}

CustomerResponse - When the create endpoint is called, only ID fill be filled

type Request

type Request struct {
	*Customer
}

Request -

type Response

type Response struct {
	StatusResponse *checkout.StatusResponse `json:"api_response,omitempty"`
	Customer       *CustomerResponse        `json:"customer,omitempty"`
}

Response for customer

Jump to

Keyboard shortcuts

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