refunds

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: 11 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 refunds API

func (*Client) GetPaymentRefund

func (a *Client) GetPaymentRefund(params *GetPaymentRefundParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPaymentRefundOK, error)

GetPaymentRefund gets payment refund

Retrieves a specific refund using the `refund_id`.

func (*Client) ListPaymentRefunds

func (a *Client) ListPaymentRefunds(params *ListPaymentRefundsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPaymentRefundsOK, error)
ListPaymentRefunds lists payment refunds

Retrieves a list of refunds for the account making the request.

The maximum results per page is 100.

func (*Client) RefundPayment

func (a *Client) RefundPayment(params *RefundPaymentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefundPaymentOK, error)
RefundPayment refunds payment

Refunds a payment. You can refund the entire payment amount or a

portion of it.

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 {
	GetPaymentRefund(params *GetPaymentRefundParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPaymentRefundOK, error)

	ListPaymentRefunds(params *ListPaymentRefundsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPaymentRefundsOK, error)

	RefundPayment(params *RefundPaymentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefundPaymentOK, 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 refunds API client.

type GetPaymentRefundOK

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

Success

func NewGetPaymentRefundOK

func NewGetPaymentRefundOK() *GetPaymentRefundOK

NewGetPaymentRefundOK creates a GetPaymentRefundOK with default headers values

func (*GetPaymentRefundOK) Error

func (o *GetPaymentRefundOK) Error() string

func (*GetPaymentRefundOK) GetPayload

type GetPaymentRefundParams

type GetPaymentRefundParams struct {

	/* RefundID.

	   The unique ID for the desired `PaymentRefund`.
	*/
	RefundID string

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

GetPaymentRefundParams contains all the parameters to send to the API endpoint

for the get payment refund operation.

Typically these are written to a http.Request.

func NewGetPaymentRefundParams

func NewGetPaymentRefundParams() *GetPaymentRefundParams

NewGetPaymentRefundParams creates a new GetPaymentRefundParams 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 NewGetPaymentRefundParamsWithContext

func NewGetPaymentRefundParamsWithContext(ctx context.Context) *GetPaymentRefundParams

NewGetPaymentRefundParamsWithContext creates a new GetPaymentRefundParams object with the ability to set a context for a request.

func NewGetPaymentRefundParamsWithHTTPClient

func NewGetPaymentRefundParamsWithHTTPClient(client *http.Client) *GetPaymentRefundParams

NewGetPaymentRefundParamsWithHTTPClient creates a new GetPaymentRefundParams object with the ability to set a custom HTTPClient for a request.

func NewGetPaymentRefundParamsWithTimeout

func NewGetPaymentRefundParamsWithTimeout(timeout time.Duration) *GetPaymentRefundParams

NewGetPaymentRefundParamsWithTimeout creates a new GetPaymentRefundParams object with the ability to set a timeout on a request.

func (*GetPaymentRefundParams) SetContext

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

SetContext adds the context to the get payment refund params

func (*GetPaymentRefundParams) SetDefaults

func (o *GetPaymentRefundParams) SetDefaults()

SetDefaults hydrates default values in the get payment refund params (not the query body).

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

func (*GetPaymentRefundParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the get payment refund params

func (*GetPaymentRefundParams) SetRefundID

func (o *GetPaymentRefundParams) SetRefundID(refundID string)

SetRefundID adds the refundId to the get payment refund params

func (*GetPaymentRefundParams) SetTimeout

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

SetTimeout adds the timeout to the get payment refund params

func (*GetPaymentRefundParams) WithContext

WithContext adds the context to the get payment refund params

func (*GetPaymentRefundParams) WithDefaults

WithDefaults hydrates default values in the get payment refund params (not the query body).

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

func (*GetPaymentRefundParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the get payment refund params

func (*GetPaymentRefundParams) WithRefundID

func (o *GetPaymentRefundParams) WithRefundID(refundID string) *GetPaymentRefundParams

WithRefundID adds the refundID to the get payment refund params

func (*GetPaymentRefundParams) WithTimeout

WithTimeout adds the timeout to the get payment refund params

func (*GetPaymentRefundParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type GetPaymentRefundReader

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

GetPaymentRefundReader is a Reader for the GetPaymentRefund structure.

func (*GetPaymentRefundReader) ReadResponse

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

ReadResponse reads a server response into the received o.

type ListPaymentRefundsOK

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

Success

func NewListPaymentRefundsOK

func NewListPaymentRefundsOK() *ListPaymentRefundsOK

NewListPaymentRefundsOK creates a ListPaymentRefundsOK with default headers values

func (*ListPaymentRefundsOK) Error

func (o *ListPaymentRefundsOK) Error() string

func (*ListPaymentRefundsOK) GetPayload

type ListPaymentRefundsParams

type ListPaymentRefundsParams struct {

	/* BeginTime.

	     The timestamp for the beginning of the requested reporting period, in RFC 3339 format.

	Default: The current time minus one year.
	*/
	BeginTime *string

	/* Cursor.

	     A pagination cursor returned by a previous call to this endpoint.
	Provide this cursor to retrieve the next set of results for the original query.

	For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).
	*/
	Cursor *string

	/* EndTime.

	     The timestamp for the end of the requested reporting period, in RFC 3339 format.

	Default: The current time.
	*/
	EndTime *string

	/* Limit.

	     The maximum number of results to be returned in a single page.

	It is possible to receive fewer results than the specified limit on a given page.

	If the supplied value is greater than 100, no more than 100 results are returned.

	Default: 100
	*/
	Limit *int64

	/* LocationID.

	     Limit results to the location supplied. By default, results are returned
	for all locations associated with the seller.
	*/
	LocationID *string

	/* SortOrder.

	     The order in which results are listed:
	- `ASC` - Oldest to newest.
	- `DESC` - Newest to oldest (default).
	*/
	SortOrder *string

	/* SourceType.

	     If provided, only refunds with the given source type are returned.
	- `CARD` - List refunds only for payments where `CARD` was specified as the payment
	source.

	Default: If omitted, refunds are returned regardless of the source type.
	*/
	SourceType *string

	/* Status.

	     If provided, only refunds with the given status are returned.
	For a list of refund status values, see `PaymentRefund`.

	Default: If omitted, refunds are returned regardless of their status.
	*/
	Status *string

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

ListPaymentRefundsParams contains all the parameters to send to the API endpoint

for the list payment refunds operation.

Typically these are written to a http.Request.

func NewListPaymentRefundsParams

func NewListPaymentRefundsParams() *ListPaymentRefundsParams

NewListPaymentRefundsParams creates a new ListPaymentRefundsParams 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 NewListPaymentRefundsParamsWithContext

func NewListPaymentRefundsParamsWithContext(ctx context.Context) *ListPaymentRefundsParams

NewListPaymentRefundsParamsWithContext creates a new ListPaymentRefundsParams object with the ability to set a context for a request.

func NewListPaymentRefundsParamsWithHTTPClient

func NewListPaymentRefundsParamsWithHTTPClient(client *http.Client) *ListPaymentRefundsParams

NewListPaymentRefundsParamsWithHTTPClient creates a new ListPaymentRefundsParams object with the ability to set a custom HTTPClient for a request.

func NewListPaymentRefundsParamsWithTimeout

func NewListPaymentRefundsParamsWithTimeout(timeout time.Duration) *ListPaymentRefundsParams

NewListPaymentRefundsParamsWithTimeout creates a new ListPaymentRefundsParams object with the ability to set a timeout on a request.

func (*ListPaymentRefundsParams) SetBeginTime

func (o *ListPaymentRefundsParams) SetBeginTime(beginTime *string)

SetBeginTime adds the beginTime to the list payment refunds params

func (*ListPaymentRefundsParams) SetContext

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

SetContext adds the context to the list payment refunds params

func (*ListPaymentRefundsParams) SetCursor

func (o *ListPaymentRefundsParams) SetCursor(cursor *string)

SetCursor adds the cursor to the list payment refunds params

func (*ListPaymentRefundsParams) SetDefaults

func (o *ListPaymentRefundsParams) SetDefaults()

SetDefaults hydrates default values in the list payment refunds params (not the query body).

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

func (*ListPaymentRefundsParams) SetEndTime

func (o *ListPaymentRefundsParams) SetEndTime(endTime *string)

SetEndTime adds the endTime to the list payment refunds params

func (*ListPaymentRefundsParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the list payment refunds params

func (*ListPaymentRefundsParams) SetLimit

func (o *ListPaymentRefundsParams) SetLimit(limit *int64)

SetLimit adds the limit to the list payment refunds params

func (*ListPaymentRefundsParams) SetLocationID

func (o *ListPaymentRefundsParams) SetLocationID(locationID *string)

SetLocationID adds the locationId to the list payment refunds params

func (*ListPaymentRefundsParams) SetSortOrder

func (o *ListPaymentRefundsParams) SetSortOrder(sortOrder *string)

SetSortOrder adds the sortOrder to the list payment refunds params

func (*ListPaymentRefundsParams) SetSourceType

func (o *ListPaymentRefundsParams) SetSourceType(sourceType *string)

SetSourceType adds the sourceType to the list payment refunds params

func (*ListPaymentRefundsParams) SetStatus

func (o *ListPaymentRefundsParams) SetStatus(status *string)

SetStatus adds the status to the list payment refunds params

func (*ListPaymentRefundsParams) SetTimeout

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

SetTimeout adds the timeout to the list payment refunds params

func (*ListPaymentRefundsParams) WithBeginTime

func (o *ListPaymentRefundsParams) WithBeginTime(beginTime *string) *ListPaymentRefundsParams

WithBeginTime adds the beginTime to the list payment refunds params

func (*ListPaymentRefundsParams) WithContext

WithContext adds the context to the list payment refunds params

func (*ListPaymentRefundsParams) WithCursor

WithCursor adds the cursor to the list payment refunds params

func (*ListPaymentRefundsParams) WithDefaults

WithDefaults hydrates default values in the list payment refunds params (not the query body).

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

func (*ListPaymentRefundsParams) WithEndTime

func (o *ListPaymentRefundsParams) WithEndTime(endTime *string) *ListPaymentRefundsParams

WithEndTime adds the endTime to the list payment refunds params

func (*ListPaymentRefundsParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the list payment refunds params

func (*ListPaymentRefundsParams) WithLimit

WithLimit adds the limit to the list payment refunds params

func (*ListPaymentRefundsParams) WithLocationID

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

WithLocationID adds the locationID to the list payment refunds params

func (*ListPaymentRefundsParams) WithSortOrder

func (o *ListPaymentRefundsParams) WithSortOrder(sortOrder *string) *ListPaymentRefundsParams

WithSortOrder adds the sortOrder to the list payment refunds params

func (*ListPaymentRefundsParams) WithSourceType

func (o *ListPaymentRefundsParams) WithSourceType(sourceType *string) *ListPaymentRefundsParams

WithSourceType adds the sourceType to the list payment refunds params

func (*ListPaymentRefundsParams) WithStatus

WithStatus adds the status to the list payment refunds params

func (*ListPaymentRefundsParams) WithTimeout

WithTimeout adds the timeout to the list payment refunds params

func (*ListPaymentRefundsParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type ListPaymentRefundsReader

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

ListPaymentRefundsReader is a Reader for the ListPaymentRefunds structure.

func (*ListPaymentRefundsReader) ReadResponse

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

ReadResponse reads a server response into the received o.

type RefundPaymentOK

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

Success

func NewRefundPaymentOK

func NewRefundPaymentOK() *RefundPaymentOK

NewRefundPaymentOK creates a RefundPaymentOK with default headers values

func (*RefundPaymentOK) Error

func (o *RefundPaymentOK) Error() string

func (*RefundPaymentOK) GetPayload

func (o *RefundPaymentOK) GetPayload() *models.RefundPaymentResponse

type RefundPaymentParams

type RefundPaymentParams struct {

	/* Body.

	     An object containing the fields to POST for the request.

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

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

RefundPaymentParams contains all the parameters to send to the API endpoint

for the refund payment operation.

Typically these are written to a http.Request.

func NewRefundPaymentParams

func NewRefundPaymentParams() *RefundPaymentParams

NewRefundPaymentParams creates a new RefundPaymentParams 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 NewRefundPaymentParamsWithContext

func NewRefundPaymentParamsWithContext(ctx context.Context) *RefundPaymentParams

NewRefundPaymentParamsWithContext creates a new RefundPaymentParams object with the ability to set a context for a request.

func NewRefundPaymentParamsWithHTTPClient

func NewRefundPaymentParamsWithHTTPClient(client *http.Client) *RefundPaymentParams

NewRefundPaymentParamsWithHTTPClient creates a new RefundPaymentParams object with the ability to set a custom HTTPClient for a request.

func NewRefundPaymentParamsWithTimeout

func NewRefundPaymentParamsWithTimeout(timeout time.Duration) *RefundPaymentParams

NewRefundPaymentParamsWithTimeout creates a new RefundPaymentParams object with the ability to set a timeout on a request.

func (*RefundPaymentParams) SetBody

SetBody adds the body to the refund payment params

func (*RefundPaymentParams) SetContext

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

SetContext adds the context to the refund payment params

func (*RefundPaymentParams) SetDefaults

func (o *RefundPaymentParams) SetDefaults()

SetDefaults hydrates default values in the refund payment params (not the query body).

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

func (*RefundPaymentParams) SetHTTPClient

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

SetHTTPClient adds the HTTPClient to the refund payment params

func (*RefundPaymentParams) SetTimeout

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

SetTimeout adds the timeout to the refund payment params

func (*RefundPaymentParams) WithBody

WithBody adds the body to the refund payment params

func (*RefundPaymentParams) WithContext

WithContext adds the context to the refund payment params

func (*RefundPaymentParams) WithDefaults

func (o *RefundPaymentParams) WithDefaults() *RefundPaymentParams

WithDefaults hydrates default values in the refund payment params (not the query body).

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

func (*RefundPaymentParams) WithHTTPClient

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

WithHTTPClient adds the HTTPClient to the refund payment params

func (*RefundPaymentParams) WithTimeout

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

WithTimeout adds the timeout to the refund payment params

func (*RefundPaymentParams) WriteToRequest

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

WriteToRequest writes these params to a swagger request

type RefundPaymentReader

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

RefundPaymentReader is a Reader for the RefundPayment structure.

func (*RefundPaymentReader) ReadResponse

func (o *RefundPaymentReader) 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