checkout

package
v0.0.0-...-dc3cc4a Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 10 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 {
	// contains filtered or unexported fields
}

Client for checkout API

func (*Client) CreateCheckout

func (a *Client) CreateCheckout(params *CreateCheckoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCheckoutOK, error)
CreateCheckout creates checkout

Links a `checkoutId` to a `checkout_page_url` that customers will

be directed to in order to provide their payment information using a payment processing workflow hosted on connect.squareup.com.

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client

type ClientOption

type ClientOption func(*runtime.ClientOperation)

ClientOption is the option for Client methods

type ClientService

type ClientService interface {
	CreateCheckout(params *CreateCheckoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCheckoutOK, error)

	SetTransport(transport runtime.ClientTransport)
}

ClientService is the interface for Client methods

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService

New creates a new checkout API client.

type CreateCheckoutOK

type CreateCheckoutOK struct {
	Payload *models.CreateCheckoutResponse
}
CreateCheckoutOK describes a response with status code 200, with default header values.

Success

func NewCreateCheckoutOK

func NewCreateCheckoutOK() *CreateCheckoutOK

NewCreateCheckoutOK creates a CreateCheckoutOK with default headers values

func (*CreateCheckoutOK) Error

func (o *CreateCheckoutOK) Error() string

func (*CreateCheckoutOK) GetPayload

type CreateCheckoutParams

type CreateCheckoutParams struct {

	/* Body.

	     An object containing the fields to POST for the request.

	See the corresponding object definition for field details.
	*/
	Body *models.CreateCheckoutRequest

	/* LocationID.

	   The ID of the business location to associate the checkout with.
	*/
	LocationID string

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

CreateCheckoutParams contains all the parameters to send to the API endpoint

for the create checkout operation.

Typically these are written to a http.Request.

func NewCreateCheckoutParams

func NewCreateCheckoutParams() *CreateCheckoutParams

NewCreateCheckoutParams creates a new CreateCheckoutParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewCreateCheckoutParamsWithContext

func NewCreateCheckoutParamsWithContext(ctx context.Context) *CreateCheckoutParams

NewCreateCheckoutParamsWithContext creates a new CreateCheckoutParams object with the ability to set a context for a request.

func NewCreateCheckoutParamsWithHTTPClient

func NewCreateCheckoutParamsWithHTTPClient(client *http.Client) *CreateCheckoutParams

NewCreateCheckoutParamsWithHTTPClient creates a new CreateCheckoutParams object with the ability to set a custom HTTPClient for a request.

func NewCreateCheckoutParamsWithTimeout

func NewCreateCheckoutParamsWithTimeout(timeout time.Duration) *CreateCheckoutParams

NewCreateCheckoutParamsWithTimeout creates a new CreateCheckoutParams object with the ability to set a timeout on a request.

func (*CreateCheckoutParams) SetBody

SetBody adds the body to the create checkout params

func (*CreateCheckoutParams) SetContext

func (o *CreateCheckoutParams) SetContext(ctx context.Context)

SetContext adds the context to the create checkout params

func (*CreateCheckoutParams) SetDefaults

func (o *CreateCheckoutParams) SetDefaults()

SetDefaults hydrates default values in the create checkout params (not the query body).

All values with no default are reset to their zero value.

func (*CreateCheckoutParams) SetHTTPClient

func (o *CreateCheckoutParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the create checkout params

func (*CreateCheckoutParams) SetLocationID

func (o *CreateCheckoutParams) SetLocationID(locationID string)

SetLocationID adds the locationId to the create checkout params

func (*CreateCheckoutParams) SetTimeout

func (o *CreateCheckoutParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the create checkout params

func (*CreateCheckoutParams) WithBody

WithBody adds the body to the create checkout params

func (*CreateCheckoutParams) WithContext

WithContext adds the context to the create checkout params

func (*CreateCheckoutParams) WithDefaults

func (o *CreateCheckoutParams) WithDefaults() *CreateCheckoutParams

WithDefaults hydrates default values in the create checkout params (not the query body).

All values with no default are reset to their zero value.

func (*CreateCheckoutParams) WithHTTPClient

func (o *CreateCheckoutParams) WithHTTPClient(client *http.Client) *CreateCheckoutParams

WithHTTPClient adds the HTTPClient to the create checkout params

func (*CreateCheckoutParams) WithLocationID

func (o *CreateCheckoutParams) WithLocationID(locationID string) *CreateCheckoutParams

WithLocationID adds the locationID to the create checkout params

func (*CreateCheckoutParams) WithTimeout

func (o *CreateCheckoutParams) WithTimeout(timeout time.Duration) *CreateCheckoutParams

WithTimeout adds the timeout to the create checkout params

func (*CreateCheckoutParams) WriteToRequest

func (o *CreateCheckoutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type CreateCheckoutReader

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

CreateCheckoutReader is a Reader for the CreateCheckout structure.

func (*CreateCheckoutReader) ReadResponse

func (o *CreateCheckoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

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