payment

package
v0.0.0-...-3cf217b Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package payment provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func NewCreatePaymentRequest

func NewCreatePaymentRequest(server string, params *CreatePaymentParams, body CreatePaymentJSONRequestBody) (*http.Request, error)

NewCreatePaymentRequest calls the generic CreatePayment builder with application/json body

func NewCreatePaymentRequestWithBody

func NewCreatePaymentRequestWithBody(server string, params *CreatePaymentParams, contentType string, body io.Reader) (*http.Request, error)

NewCreatePaymentRequestWithBody constructs an http.Request for the CreatePayment method, with any body, and a specified content type

func NewGetPaymentRequest

func NewGetPaymentRequest(server string, paymentId Uuid, params *GetPaymentParams) (*http.Request, error)

NewGetPaymentRequest constructs an http.Request for the GetPayment method

func NewHandleStripeWebhookRequest

func NewHandleStripeWebhookRequest(server string, params *HandleStripeWebhookParams, body HandleStripeWebhookJSONRequestBody) (*http.Request, error)

NewHandleStripeWebhookRequest calls the generic HandleStripeWebhook builder with application/json body

func NewHandleStripeWebhookRequestWithBody

func NewHandleStripeWebhookRequestWithBody(server string, params *HandleStripeWebhookParams, contentType string, body io.Reader) (*http.Request, error)

NewHandleStripeWebhookRequestWithBody constructs an http.Request for the HandleStripeWebhook method, with any body, and a specified content type

func NewPaymentHealthzRequest

func NewPaymentHealthzRequest(server string) (*http.Request, error)

NewPaymentHealthzRequest constructs an http.Request for the PaymentHealthz method

func NewPaymentReadyzRequest

func NewPaymentReadyzRequest(server string) (*http.Request, error)

NewPaymentReadyzRequest constructs an http.Request for the PaymentReadyz method

Types

type BadRequest

type BadRequest = Error

BadRequest defines model for BadRequest.

type BadRequestJSONResponse

type BadRequestJSONResponse Error

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CreatePayment

func (c *Client) CreatePayment(ctx context.Context, params *CreatePaymentParams, body CreatePaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreatePayment Start a payment for a held booking

Creates a Stripe PaymentIntent for the booking's authoritative amount and returns its client secret so the browser can complete the charge directly with Stripe.

Returns `pending`. The real outcome arrives asynchronously via the Stripe webhook, which is what emits `PaymentSucceeded`/`PaymentFailed`. Do NOT treat a 201 here as a successful payment.

The amount is read from the booking — never from the request. A client-supplied amount would let a customer set their own price.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/payments (the `CreatePayment` operationId).

func (*Client) CreatePaymentWithBody

func (c *Client) CreatePaymentWithBody(ctx context.Context, params *CreatePaymentParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreatePaymentWithBody Start a payment for a held booking

Creates a Stripe PaymentIntent for the booking's authoritative amount and returns its client secret so the browser can complete the charge directly with Stripe.

Returns `pending`. The real outcome arrives asynchronously via the Stripe webhook, which is what emits `PaymentSucceeded`/`PaymentFailed`. Do NOT treat a 201 here as a successful payment.

The amount is read from the booking — never from the request. A client-supplied amount would let a customer set their own price.

Takes any type of body and a specified content type.

Corresponds with POST /v1/payments (the `CreatePayment` operationId).

func (*Client) GetPayment

func (c *Client) GetPayment(ctx context.Context, paymentId Uuid, params *GetPaymentParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetPayment Get a payment's status

Corresponds with GET /v1/payments/{payment_id} (the `GetPayment` operationId).

func (*Client) HandleStripeWebhook

func (c *Client) HandleStripeWebhook(ctx context.Context, params *HandleStripeWebhookParams, body HandleStripeWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

HandleStripeWebhook Stripe payment outcome callback

Called by Stripe, not by our clients. This is the authoritative source of payment outcomes and the only path that emits `PaymentSucceeded`/`PaymentFailed`.

**Authentication is by Stripe signature, not by our JWT** — hence `security: []`. The `Stripe-Signature` header MUST be verified against STRIPE_WEBHOOK_SECRET before the body is parsed or trusted. An unverified body is attacker-controlled input: it would let anyone mark any booking paid.

Stripe retries on non-2xx and may deliver duplicates, so handling is idempotent on the Stripe event id. Unknown event types are acknowledged with 200 and ignored.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/webhooks/stripe (the `HandleStripeWebhook` operationId).

func (*Client) HandleStripeWebhookWithBody

func (c *Client) HandleStripeWebhookWithBody(ctx context.Context, params *HandleStripeWebhookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

HandleStripeWebhookWithBody Stripe payment outcome callback

Called by Stripe, not by our clients. This is the authoritative source of payment outcomes and the only path that emits `PaymentSucceeded`/`PaymentFailed`.

**Authentication is by Stripe signature, not by our JWT** — hence `security: []`. The `Stripe-Signature` header MUST be verified against STRIPE_WEBHOOK_SECRET before the body is parsed or trusted. An unverified body is attacker-controlled input: it would let anyone mark any booking paid.

Stripe retries on non-2xx and may deliver duplicates, so handling is idempotent on the Stripe event id. Unknown event types are acknowledged with 200 and ignored.

Takes any type of body and a specified content type.

Corresponds with POST /v1/webhooks/stripe (the `HandleStripeWebhook` operationId).

func (*Client) PaymentHealthz

func (c *Client) PaymentHealthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

PaymentHealthz Liveness probe

Corresponds with GET /healthz (the `PaymentHealthz` operationId).

func (*Client) PaymentReadyz

func (c *Client) PaymentReadyz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

PaymentReadyz Readiness probe — checks database and broker connectivity

Corresponds with GET /readyz (the `PaymentReadyz` operationId).

type ClientInterface

type ClientInterface interface {

	// PaymentHealthz Liveness probe
	//
	// Corresponds with GET /healthz (the `PaymentHealthz` operationId).
	PaymentHealthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PaymentReadyz Readiness probe — checks database and broker connectivity
	//
	// Corresponds with GET /readyz (the `PaymentReadyz` operationId).
	PaymentReadyz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreatePaymentWithBody Start a payment for a held booking
	//
	// Creates a Stripe PaymentIntent for the booking's authoritative amount and returns its
	// client secret so the browser can complete the charge directly with Stripe.
	//
	// Returns `pending`. The real outcome arrives asynchronously via the Stripe webhook,
	// which is what emits `PaymentSucceeded`/`PaymentFailed`. Do NOT treat a 201 here as a
	// successful payment.
	//
	// The amount is read from the booking — never from the request. A client-supplied
	// amount would let a customer set their own price.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/payments (the `CreatePayment` operationId).
	CreatePaymentWithBody(ctx context.Context, params *CreatePaymentParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreatePayment Start a payment for a held booking
	//
	// Creates a Stripe PaymentIntent for the booking's authoritative amount and returns its
	// client secret so the browser can complete the charge directly with Stripe.
	//
	// Returns `pending`. The real outcome arrives asynchronously via the Stripe webhook,
	// which is what emits `PaymentSucceeded`/`PaymentFailed`. Do NOT treat a 201 here as a
	// successful payment.
	//
	// The amount is read from the booking — never from the request. A client-supplied
	// amount would let a customer set their own price.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/payments (the `CreatePayment` operationId).
	CreatePayment(ctx context.Context, params *CreatePaymentParams, body CreatePaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPayment Get a payment's status
	//
	// Corresponds with GET /v1/payments/{payment_id} (the `GetPayment` operationId).
	GetPayment(ctx context.Context, paymentId Uuid, params *GetPaymentParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// HandleStripeWebhookWithBody Stripe payment outcome callback
	//
	// Called by Stripe, not by our clients. This is the authoritative source of payment
	// outcomes and the only path that emits `PaymentSucceeded`/`PaymentFailed`.
	//
	// **Authentication is by Stripe signature, not by our JWT** — hence `security: []`.
	// The `Stripe-Signature` header MUST be verified against STRIPE_WEBHOOK_SECRET before
	// the body is parsed or trusted. An unverified body is attacker-controlled input: it
	// would let anyone mark any booking paid.
	//
	// Stripe retries on non-2xx and may deliver duplicates, so handling is idempotent on
	// the Stripe event id. Unknown event types are acknowledged with 200 and ignored.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/webhooks/stripe (the `HandleStripeWebhook` operationId).
	HandleStripeWebhookWithBody(ctx context.Context, params *HandleStripeWebhookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// HandleStripeWebhook Stripe payment outcome callback
	//
	// Called by Stripe, not by our clients. This is the authoritative source of payment
	// outcomes and the only path that emits `PaymentSucceeded`/`PaymentFailed`.
	//
	// **Authentication is by Stripe signature, not by our JWT** — hence `security: []`.
	// The `Stripe-Signature` header MUST be verified against STRIPE_WEBHOOK_SECRET before
	// the body is parsed or trusted. An unverified body is attacker-controlled input: it
	// would let anyone mark any booking paid.
	//
	// Stripe retries on non-2xx and may deliver duplicates, so handling is idempotent on
	// the Stripe event id. Unknown event types are acknowledged with 200 and ignored.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/webhooks/stripe (the `HandleStripeWebhook` operationId).
	HandleStripeWebhook(ctx context.Context, params *HandleStripeWebhookParams, body HandleStripeWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreatePaymentWithBodyWithResponse

func (c *ClientWithResponses) CreatePaymentWithBodyWithResponse(ctx context.Context, params *CreatePaymentParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePaymentResponse, error)

CreatePaymentWithBodyWithResponse Start a payment for a held booking

Creates a Stripe PaymentIntent for the booking's authoritative amount and returns its client secret so the browser can complete the charge directly with Stripe.

Returns `pending`. The real outcome arrives asynchronously via the Stripe webhook, which is what emits `PaymentSucceeded`/`PaymentFailed`. Do NOT treat a 201 here as a successful payment.

The amount is read from the booking — never from the request. A client-supplied amount would let a customer set their own price.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/payments (the `CreatePayment` operationId).

func (*ClientWithResponses) CreatePaymentWithResponse

func (c *ClientWithResponses) CreatePaymentWithResponse(ctx context.Context, params *CreatePaymentParams, body CreatePaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePaymentResponse, error)

CreatePaymentWithResponse Start a payment for a held booking

Creates a Stripe PaymentIntent for the booking's authoritative amount and returns its client secret so the browser can complete the charge directly with Stripe.

Returns `pending`. The real outcome arrives asynchronously via the Stripe webhook, which is what emits `PaymentSucceeded`/`PaymentFailed`. Do NOT treat a 201 here as a successful payment.

The amount is read from the booking — never from the request. A client-supplied amount would let a customer set their own price.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/payments (the `CreatePayment` operationId).

func (*ClientWithResponses) GetPaymentWithResponse

func (c *ClientWithResponses) GetPaymentWithResponse(ctx context.Context, paymentId Uuid, params *GetPaymentParams, reqEditors ...RequestEditorFn) (*GetPaymentResponse, error)

GetPaymentWithResponse Get a payment's status

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/payments/{payment_id} (the `GetPayment` operationId).

func (*ClientWithResponses) HandleStripeWebhookWithBodyWithResponse

func (c *ClientWithResponses) HandleStripeWebhookWithBodyWithResponse(ctx context.Context, params *HandleStripeWebhookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleStripeWebhookResponse, error)

HandleStripeWebhookWithBodyWithResponse Stripe payment outcome callback

Called by Stripe, not by our clients. This is the authoritative source of payment outcomes and the only path that emits `PaymentSucceeded`/`PaymentFailed`.

**Authentication is by Stripe signature, not by our JWT** — hence `security: []`. The `Stripe-Signature` header MUST be verified against STRIPE_WEBHOOK_SECRET before the body is parsed or trusted. An unverified body is attacker-controlled input: it would let anyone mark any booking paid.

Stripe retries on non-2xx and may deliver duplicates, so handling is idempotent on the Stripe event id. Unknown event types are acknowledged with 200 and ignored.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/webhooks/stripe (the `HandleStripeWebhook` operationId).

func (*ClientWithResponses) HandleStripeWebhookWithResponse

HandleStripeWebhookWithResponse Stripe payment outcome callback

Called by Stripe, not by our clients. This is the authoritative source of payment outcomes and the only path that emits `PaymentSucceeded`/`PaymentFailed`.

**Authentication is by Stripe signature, not by our JWT** — hence `security: []`. The `Stripe-Signature` header MUST be verified against STRIPE_WEBHOOK_SECRET before the body is parsed or trusted. An unverified body is attacker-controlled input: it would let anyone mark any booking paid.

Stripe retries on non-2xx and may deliver duplicates, so handling is idempotent on the Stripe event id. Unknown event types are acknowledged with 200 and ignored.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/webhooks/stripe (the `HandleStripeWebhook` operationId).

func (*ClientWithResponses) PaymentHealthzWithResponse

func (c *ClientWithResponses) PaymentHealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PaymentHealthzResponse, error)

PaymentHealthzWithResponse Liveness probe

Returns a wrapper object for the known response body format(s).

Corresponds with GET /healthz (the `PaymentHealthz` operationId).

func (*ClientWithResponses) PaymentReadyzWithResponse

func (c *ClientWithResponses) PaymentReadyzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PaymentReadyzResponse, error)

PaymentReadyzWithResponse Readiness probe — checks database and broker connectivity

Returns a wrapper object for the known response body format(s).

Corresponds with GET /readyz (the `PaymentReadyz` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// PaymentHealthzWithResponse Liveness probe
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /healthz (the `PaymentHealthz` operationId).
	PaymentHealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PaymentHealthzResponse, error)

	// PaymentReadyzWithResponse Readiness probe — checks database and broker connectivity
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /readyz (the `PaymentReadyz` operationId).
	PaymentReadyzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PaymentReadyzResponse, error)

	// CreatePaymentWithBodyWithResponse Start a payment for a held booking
	//
	// Creates a Stripe PaymentIntent for the booking's authoritative amount and returns its
	// client secret so the browser can complete the charge directly with Stripe.
	//
	// Returns `pending`. The real outcome arrives asynchronously via the Stripe webhook,
	// which is what emits `PaymentSucceeded`/`PaymentFailed`. Do NOT treat a 201 here as a
	// successful payment.
	//
	// The amount is read from the booking — never from the request. A client-supplied
	// amount would let a customer set their own price.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/payments (the `CreatePayment` operationId).
	CreatePaymentWithBodyWithResponse(ctx context.Context, params *CreatePaymentParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePaymentResponse, error)

	// CreatePaymentWithResponse Start a payment for a held booking
	//
	// Creates a Stripe PaymentIntent for the booking's authoritative amount and returns its
	// client secret so the browser can complete the charge directly with Stripe.
	//
	// Returns `pending`. The real outcome arrives asynchronously via the Stripe webhook,
	// which is what emits `PaymentSucceeded`/`PaymentFailed`. Do NOT treat a 201 here as a
	// successful payment.
	//
	// The amount is read from the booking — never from the request. A client-supplied
	// amount would let a customer set their own price.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/payments (the `CreatePayment` operationId).
	CreatePaymentWithResponse(ctx context.Context, params *CreatePaymentParams, body CreatePaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePaymentResponse, error)

	// GetPaymentWithResponse Get a payment's status
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/payments/{payment_id} (the `GetPayment` operationId).
	GetPaymentWithResponse(ctx context.Context, paymentId Uuid, params *GetPaymentParams, reqEditors ...RequestEditorFn) (*GetPaymentResponse, error)

	// HandleStripeWebhookWithBodyWithResponse Stripe payment outcome callback
	//
	// Called by Stripe, not by our clients. This is the authoritative source of payment
	// outcomes and the only path that emits `PaymentSucceeded`/`PaymentFailed`.
	//
	// **Authentication is by Stripe signature, not by our JWT** — hence `security: []`.
	// The `Stripe-Signature` header MUST be verified against STRIPE_WEBHOOK_SECRET before
	// the body is parsed or trusted. An unverified body is attacker-controlled input: it
	// would let anyone mark any booking paid.
	//
	// Stripe retries on non-2xx and may deliver duplicates, so handling is idempotent on
	// the Stripe event id. Unknown event types are acknowledged with 200 and ignored.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/webhooks/stripe (the `HandleStripeWebhook` operationId).
	HandleStripeWebhookWithBodyWithResponse(ctx context.Context, params *HandleStripeWebhookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HandleStripeWebhookResponse, error)

	// HandleStripeWebhookWithResponse Stripe payment outcome callback
	//
	// Called by Stripe, not by our clients. This is the authoritative source of payment
	// outcomes and the only path that emits `PaymentSucceeded`/`PaymentFailed`.
	//
	// **Authentication is by Stripe signature, not by our JWT** — hence `security: []`.
	// The `Stripe-Signature` header MUST be verified against STRIPE_WEBHOOK_SECRET before
	// the body is parsed or trusted. An unverified body is attacker-controlled input: it
	// would let anyone mark any booking paid.
	//
	// Stripe retries on non-2xx and may deliver duplicates, so handling is idempotent on
	// the Stripe event id. Unknown event types are acknowledged with 200 and ignored.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/webhooks/stripe (the `HandleStripeWebhook` operationId).
	HandleStripeWebhookWithResponse(ctx context.Context, params *HandleStripeWebhookParams, body HandleStripeWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*HandleStripeWebhookResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CorrelationId

type CorrelationId = string

CorrelationId defines model for CorrelationId.

type CreatePayment201JSONResponse

type CreatePayment201JSONResponse struct {
	// AmountMinor Read from the booking, in the currency's minor unit. Never client-supplied.
	AmountMinor int `json:"amount_minor"`

	// BookingId UUIDv7, string-typed everywhere
	//
	// Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e
	BookingId Uuid `json:"booking_id"`

	// ClientSecret Stripe PaymentIntent client secret. Returned once, on creation only;
	// never persisted by us and never present on GET responses.
	ClientSecret string    `json:"client_secret"`
	CreatedAt    time.Time `json:"created_at"`
	Currency     string    `json:"currency"`

	// FailureCode Stripe's decline code when status is failed, e.g. card_declined
	FailureCode *string `json:"failure_code,omitempty"`

	// Id UUIDv7, string-typed everywhere
	//
	// Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e
	Id       Uuid                                     `json:"id"`
	Provider CreatePayment201JSONResponseBodyProvider `json:"provider"`

	// ProviderPaymentId Stripe PaymentIntent id, e.g. pi_3Abc...
	ProviderPaymentId string `json:"provider_payment_id"`

	// Status pending   — PaymentIntent created, outcome unknown
	// succeeded — Stripe confirmed the charge (via webhook); terminal
	// failed    — Stripe declined or the intent was cancelled; terminal
	Status    PaymentStatus `json:"status"`
	UpdatedAt time.Time     `json:"updated_at"`
}

func (CreatePayment201JSONResponse) VisitCreatePaymentResponse

func (response CreatePayment201JSONResponse) VisitCreatePaymentResponse(w http.ResponseWriter) error

type CreatePayment201JSONResponseBodyProvider

type CreatePayment201JSONResponseBodyProvider string

CreatePayment201JSONResponseBodyProvider defines parameters for CreatePayment.

const (
	CreatePayment201JSONResponseBodyProviderStripe CreatePayment201JSONResponseBodyProvider = "stripe"
)

Defines values for CreatePayment201JSONResponseBodyProvider.

func (CreatePayment201JSONResponseBodyProvider) Valid

Valid indicates whether the value is a known member of the CreatePayment201JSONResponseBodyProvider enum.

type CreatePayment400JSONResponse

type CreatePayment400JSONResponse struct{ BadRequestJSONResponse }

func (CreatePayment400JSONResponse) VisitCreatePaymentResponse

func (response CreatePayment400JSONResponse) VisitCreatePaymentResponse(w http.ResponseWriter) error

type CreatePayment401JSONResponse

type CreatePayment401JSONResponse struct{ UnauthorizedJSONResponse }

func (CreatePayment401JSONResponse) VisitCreatePaymentResponse

func (response CreatePayment401JSONResponse) VisitCreatePaymentResponse(w http.ResponseWriter) error

type CreatePayment404JSONResponse

type CreatePayment404JSONResponse Error

func (CreatePayment404JSONResponse) VisitCreatePaymentResponse

func (response CreatePayment404JSONResponse) VisitCreatePaymentResponse(w http.ResponseWriter) error

type CreatePayment409JSONResponse

type CreatePayment409JSONResponse Error

func (CreatePayment409JSONResponse) VisitCreatePaymentResponse

func (response CreatePayment409JSONResponse) VisitCreatePaymentResponse(w http.ResponseWriter) error

type CreatePayment422JSONResponse

type CreatePayment422JSONResponse Error

func (CreatePayment422JSONResponse) VisitCreatePaymentResponse

func (response CreatePayment422JSONResponse) VisitCreatePaymentResponse(w http.ResponseWriter) error

type CreatePayment500JSONResponse

type CreatePayment500JSONResponse struct{ ServerErrorJSONResponse }

func (CreatePayment500JSONResponse) VisitCreatePaymentResponse

func (response CreatePayment500JSONResponse) VisitCreatePaymentResponse(w http.ResponseWriter) error

type CreatePayment502JSONResponse

type CreatePayment502JSONResponse Error

func (CreatePayment502JSONResponse) VisitCreatePaymentResponse

func (response CreatePayment502JSONResponse) VisitCreatePaymentResponse(w http.ResponseWriter) error

type CreatePaymentJSONBody

type CreatePaymentJSONBody struct {
	// BookingId UUIDv7, string-typed everywhere
	//
	// Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e
	BookingId Uuid `json:"booking_id"`
}

CreatePaymentJSONBody defines parameters for CreatePayment.

type CreatePaymentJSONRequestBody

type CreatePaymentJSONRequestBody CreatePaymentJSONBody

CreatePaymentJSONRequestBody defines body for CreatePayment for application/json ContentType.

type CreatePaymentParams

type CreatePaymentParams struct {
	// XCorrelationId Propagated unchanged through every downstream call, event, log line, and span.
	XCorrelationId *CorrelationId `json:"X-Correlation-Id,omitempty"`

	// IdempotencyKey Client-generated unique key, passed through to Stripe's own idempotency. Mandatory:
	// a retried charge without one is a double-charge.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`
}

CreatePaymentParams defines parameters for CreatePayment.

type CreatePaymentRequestObject

type CreatePaymentRequestObject struct {
	Params CreatePaymentParams
	Body   *CreatePaymentJSONRequestBody
}

type CreatePaymentResponse

type CreatePaymentResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *struct {
		// AmountMinor Read from the booking, in the currency's minor unit. Never client-supplied.
		AmountMinor int `json:"amount_minor"`

		// BookingId UUIDv7, string-typed everywhere
		//
		// Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e
		BookingId Uuid `json:"booking_id"`

		// ClientSecret Stripe PaymentIntent client secret. Returned once, on creation only;
		// never persisted by us and never present on GET responses.
		ClientSecret string    `json:"client_secret"`
		CreatedAt    time.Time `json:"created_at"`
		Currency     string    `json:"currency"`

		// FailureCode Stripe's decline code when status is failed, e.g. card_declined
		FailureCode *string `json:"failure_code,omitempty"`

		// Id UUIDv7, string-typed everywhere
		//
		// Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e
		Id       Uuid                                     `json:"id"`
		Provider CreatePayment201JSONResponseBodyProvider `json:"provider"`

		// ProviderPaymentId Stripe PaymentIntent id, e.g. pi_3Abc...
		ProviderPaymentId string `json:"provider_payment_id"`

		// Status pending   — PaymentIntent created, outcome unknown
		// succeeded — Stripe confirmed the charge (via webhook); terminal
		// failed    — Stripe declined or the intent was cancelled; terminal
		Status    PaymentStatus `json:"status"`
		UpdatedAt time.Time     `json:"updated_at"`
	}
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *BadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *Unauthorized
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *Error
	// JSON409 the response for an HTTP 409 `application/json` response
	JSON409 *Error
	// JSON422 the response for an HTTP 422 `application/json` response
	JSON422 *Error
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ServerError
	// JSON502 the response for an HTTP 502 `application/json` response
	JSON502 *Error
}

func ParseCreatePaymentResponse

func ParseCreatePaymentResponse(rsp *http.Response) (*CreatePaymentResponse, error)

ParseCreatePaymentResponse parses an HTTP response from a CreatePaymentWithResponse call

func (CreatePaymentResponse) ContentType

func (r CreatePaymentResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreatePaymentResponse) GetBody

func (r CreatePaymentResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreatePaymentResponse) GetJSON201

func (r CreatePaymentResponse) GetJSON201() *struct {
	// AmountMinor Read from the booking, in the currency's minor unit. Never client-supplied.
	AmountMinor int `json:"amount_minor"`

	// BookingId UUIDv7, string-typed everywhere
	//
	// Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e
	BookingId Uuid `json:"booking_id"`

	// ClientSecret Stripe PaymentIntent client secret. Returned once, on creation only;
	// never persisted by us and never present on GET responses.
	ClientSecret string    `json:"client_secret"`
	CreatedAt    time.Time `json:"created_at"`
	Currency     string    `json:"currency"`

	// FailureCode Stripe's decline code when status is failed, e.g. card_declined
	FailureCode *string `json:"failure_code,omitempty"`

	// Id UUIDv7, string-typed everywhere
	//
	// Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e
	Id       Uuid                                     `json:"id"`
	Provider CreatePayment201JSONResponseBodyProvider `json:"provider"`

	// ProviderPaymentId Stripe PaymentIntent id, e.g. pi_3Abc...
	ProviderPaymentId string `json:"provider_payment_id"`

	// Status pending   — PaymentIntent created, outcome unknown
	// succeeded — Stripe confirmed the charge (via webhook); terminal
	// failed    — Stripe declined or the intent was cancelled; terminal
	Status    PaymentStatus `json:"status"`
	UpdatedAt time.Time     `json:"updated_at"`
}

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreatePaymentResponse) GetJSON400

func (r CreatePaymentResponse) GetJSON400() *BadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (CreatePaymentResponse) GetJSON401

func (r CreatePaymentResponse) GetJSON401() *Unauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (CreatePaymentResponse) GetJSON404

func (r CreatePaymentResponse) GetJSON404() *Error

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (CreatePaymentResponse) GetJSON409

func (r CreatePaymentResponse) GetJSON409() *Error

GetJSON409 returns the response for an HTTP 409 `application/json` response

func (CreatePaymentResponse) GetJSON422

func (r CreatePaymentResponse) GetJSON422() *Error

GetJSON422 returns the response for an HTTP 422 `application/json` response

func (CreatePaymentResponse) GetJSON500

func (r CreatePaymentResponse) GetJSON500() *ServerError

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (CreatePaymentResponse) GetJSON502

func (r CreatePaymentResponse) GetJSON502() *Error

GetJSON502 returns the response for an HTTP 502 `application/json` response

func (CreatePaymentResponse) Status

func (r CreatePaymentResponse) Status() string

Status returns HTTPResponse.Status

func (CreatePaymentResponse) StatusCode

func (r CreatePaymentResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreatePaymentResponseObject

type CreatePaymentResponseObject interface {
	VisitCreatePaymentResponse(w http.ResponseWriter) error
}

type Error

type Error struct {
	Error struct {
		Code          ErrorErrorCode `json:"code"`
		CorrelationId string         `json:"correlation_id"`
		Details       *[]struct {
			Field string `json:"field"`
			Issue string `json:"issue"`
		} `json:"details,omitempty"`
		Message string `json:"message"`
	} `json:"error"`
}

Error defines model for Error.

type ErrorErrorCode

type ErrorErrorCode string

ErrorErrorCode defines model for Error.Error.Code.

const (
	ErrorErrorCodeBookingNotFound             ErrorErrorCode = "booking_not_found"
	ErrorErrorCodeBookingNotPayable           ErrorErrorCode = "booking_not_payable"
	ErrorErrorCodeIdempotencyKeyReuse         ErrorErrorCode = "idempotency_key_reuse"
	ErrorErrorCodeInternalError               ErrorErrorCode = "internal_error"
	ErrorErrorCodePaymentAlreadyExists        ErrorErrorCode = "payment_already_exists"
	ErrorErrorCodePaymentNotFound             ErrorErrorCode = "payment_not_found"
	ErrorErrorCodeProviderError               ErrorErrorCode = "provider_error"
	ErrorErrorCodeSignatureVerificationFailed ErrorErrorCode = "signature_verification_failed"
	ErrorErrorCodeUnauthenticated             ErrorErrorCode = "unauthenticated"
	ErrorErrorCodeUnauthorized                ErrorErrorCode = "unauthorized"
	ErrorErrorCodeValidationFailed            ErrorErrorCode = "validation_failed"
)

Defines values for ErrorErrorCode.

func (ErrorErrorCode) Valid

func (e ErrorErrorCode) Valid() bool

Valid indicates whether the value is a known member of the ErrorErrorCode enum.

type GetPayment200JSONResponse

type GetPayment200JSONResponse Payment

func (GetPayment200JSONResponse) VisitGetPaymentResponse

func (response GetPayment200JSONResponse) VisitGetPaymentResponse(w http.ResponseWriter) error

type GetPayment401JSONResponse

type GetPayment401JSONResponse struct{ UnauthorizedJSONResponse }

func (GetPayment401JSONResponse) VisitGetPaymentResponse

func (response GetPayment401JSONResponse) VisitGetPaymentResponse(w http.ResponseWriter) error

type GetPayment403JSONResponse

type GetPayment403JSONResponse Error

func (GetPayment403JSONResponse) VisitGetPaymentResponse

func (response GetPayment403JSONResponse) VisitGetPaymentResponse(w http.ResponseWriter) error

type GetPayment404JSONResponse

type GetPayment404JSONResponse struct{ NotFoundJSONResponse }

func (GetPayment404JSONResponse) VisitGetPaymentResponse

func (response GetPayment404JSONResponse) VisitGetPaymentResponse(w http.ResponseWriter) error

type GetPayment500JSONResponse

type GetPayment500JSONResponse struct{ ServerErrorJSONResponse }

func (GetPayment500JSONResponse) VisitGetPaymentResponse

func (response GetPayment500JSONResponse) VisitGetPaymentResponse(w http.ResponseWriter) error

type GetPaymentParams

type GetPaymentParams struct {
	// XCorrelationId Propagated unchanged through every downstream call, event, log line, and span.
	XCorrelationId *CorrelationId `json:"X-Correlation-Id,omitempty"`
}

GetPaymentParams defines parameters for GetPayment.

type GetPaymentRequestObject

type GetPaymentRequestObject struct {
	PaymentId Uuid `json:"payment_id"`
	Params    GetPaymentParams
}

type GetPaymentResponse

type GetPaymentResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Payment
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *Unauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *Error
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *NotFound
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ServerError
}

func ParseGetPaymentResponse

func ParseGetPaymentResponse(rsp *http.Response) (*GetPaymentResponse, error)

ParseGetPaymentResponse parses an HTTP response from a GetPaymentWithResponse call

func (GetPaymentResponse) ContentType

func (r GetPaymentResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetPaymentResponse) GetBody

func (r GetPaymentResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetPaymentResponse) GetJSON200

func (r GetPaymentResponse) GetJSON200() *Payment

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetPaymentResponse) GetJSON401

func (r GetPaymentResponse) GetJSON401() *Unauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetPaymentResponse) GetJSON403

func (r GetPaymentResponse) GetJSON403() *Error

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (GetPaymentResponse) GetJSON404

func (r GetPaymentResponse) GetJSON404() *NotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetPaymentResponse) GetJSON500

func (r GetPaymentResponse) GetJSON500() *ServerError

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetPaymentResponse) Status

func (r GetPaymentResponse) Status() string

Status returns HTTPResponse.Status

func (GetPaymentResponse) StatusCode

func (r GetPaymentResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPaymentResponseObject

type GetPaymentResponseObject interface {
	VisitGetPaymentResponse(w http.ResponseWriter) error
}

type HandleStripeWebhook200JSONResponse

type HandleStripeWebhook200JSONResponse struct {
	Received HandleStripeWebhook200JSONResponseBodyReceived `json:"received"`
}

func (HandleStripeWebhook200JSONResponse) VisitHandleStripeWebhookResponse

func (response HandleStripeWebhook200JSONResponse) VisitHandleStripeWebhookResponse(w http.ResponseWriter) error

type HandleStripeWebhook200JSONResponseBodyReceived

type HandleStripeWebhook200JSONResponseBodyReceived bool

HandleStripeWebhook200JSONResponseBodyReceived defines parameters for HandleStripeWebhook.

Defines values for HandleStripeWebhook200JSONResponseBodyReceived.

func (HandleStripeWebhook200JSONResponseBodyReceived) Valid

Valid indicates whether the value is a known member of the HandleStripeWebhook200JSONResponseBodyReceived enum.

type HandleStripeWebhook400JSONResponse

type HandleStripeWebhook400JSONResponse Error

func (HandleStripeWebhook400JSONResponse) VisitHandleStripeWebhookResponse

func (response HandleStripeWebhook400JSONResponse) VisitHandleStripeWebhookResponse(w http.ResponseWriter) error

type HandleStripeWebhook500JSONResponse

type HandleStripeWebhook500JSONResponse struct{ ServerErrorJSONResponse }

func (HandleStripeWebhook500JSONResponse) VisitHandleStripeWebhookResponse

func (response HandleStripeWebhook500JSONResponse) VisitHandleStripeWebhookResponse(w http.ResponseWriter) error

type HandleStripeWebhookJSONBody

type HandleStripeWebhookJSONBody struct {
	Data map[string]interface{} `json:"data"`

	// Id Stripe event id — the idempotency key for this handler
	Id string `json:"id"`

	// Type e.g. payment_intent.succeeded, payment_intent.payment_failed
	Type string `json:"type"`
}

HandleStripeWebhookJSONBody defines parameters for HandleStripeWebhook.

type HandleStripeWebhookJSONRequestBody

type HandleStripeWebhookJSONRequestBody HandleStripeWebhookJSONBody

HandleStripeWebhookJSONRequestBody defines body for HandleStripeWebhook for application/json ContentType.

type HandleStripeWebhookParams

type HandleStripeWebhookParams struct {
	// StripeSignature HMAC signature. Verified before the body is trusted.
	StripeSignature string `json:"Stripe-Signature"`
}

HandleStripeWebhookParams defines parameters for HandleStripeWebhook.

type HandleStripeWebhookRequestObject

type HandleStripeWebhookRequestObject struct {
	Params HandleStripeWebhookParams
	Body   *HandleStripeWebhookJSONRequestBody
}

type HandleStripeWebhookResponse

type HandleStripeWebhookResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Received HandleStripeWebhook200JSONResponseBodyReceived `json:"received"`
	}
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *Error
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *ServerError
}

func ParseHandleStripeWebhookResponse

func ParseHandleStripeWebhookResponse(rsp *http.Response) (*HandleStripeWebhookResponse, error)

ParseHandleStripeWebhookResponse parses an HTTP response from a HandleStripeWebhookWithResponse call

func (HandleStripeWebhookResponse) ContentType

func (r HandleStripeWebhookResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (HandleStripeWebhookResponse) GetBody

func (r HandleStripeWebhookResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (HandleStripeWebhookResponse) GetJSON200

func (r HandleStripeWebhookResponse) GetJSON200() *struct {
	Received HandleStripeWebhook200JSONResponseBodyReceived `json:"received"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (HandleStripeWebhookResponse) GetJSON400

func (r HandleStripeWebhookResponse) GetJSON400() *Error

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (HandleStripeWebhookResponse) GetJSON500

func (r HandleStripeWebhookResponse) GetJSON500() *ServerError

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (HandleStripeWebhookResponse) Status

Status returns HTTPResponse.Status

func (HandleStripeWebhookResponse) StatusCode

func (r HandleStripeWebhookResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HandleStripeWebhookResponseObject

type HandleStripeWebhookResponseObject interface {
	VisitHandleStripeWebhookResponse(w http.ResponseWriter) error
}

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type IdempotencyKey

type IdempotencyKey = string

IdempotencyKey defines model for IdempotencyKey.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type NotFound

type NotFound = Error

NotFound defines model for NotFound.

type NotFoundJSONResponse

type NotFoundJSONResponse Error

type Payment

type Payment struct {
	// AmountMinor Read from the booking, in the currency's minor unit. Never client-supplied.
	AmountMinor int `json:"amount_minor"`

	// BookingId UUIDv7, string-typed everywhere
	//
	// Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e
	BookingId Uuid      `json:"booking_id"`
	CreatedAt time.Time `json:"created_at"`
	Currency  string    `json:"currency"`

	// FailureCode Stripe's decline code when status is failed, e.g. card_declined
	FailureCode *string `json:"failure_code,omitempty"`

	// Id UUIDv7, string-typed everywhere
	//
	// Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e
	Id       Uuid            `json:"id"`
	Provider PaymentProvider `json:"provider"`

	// ProviderPaymentId Stripe PaymentIntent id, e.g. pi_3Abc...
	ProviderPaymentId string `json:"provider_payment_id"`

	// Status pending   — PaymentIntent created, outcome unknown
	// succeeded — Stripe confirmed the charge (via webhook); terminal
	// failed    — Stripe declined or the intent was cancelled; terminal
	Status    PaymentStatus `json:"status"`
	UpdatedAt time.Time     `json:"updated_at"`
}

Payment Contains no card data by construction. `provider_payment_id` is a Stripe reference, not an instrument.

type PaymentHealthz200JSONResponse

type PaymentHealthz200JSONResponse struct {
	Status PaymentHealthz200JSONResponseBodyStatus `json:"status"`
}

func (PaymentHealthz200JSONResponse) VisitPaymentHealthzResponse

func (response PaymentHealthz200JSONResponse) VisitPaymentHealthzResponse(w http.ResponseWriter) error

type PaymentHealthz200JSONResponseBodyStatus

type PaymentHealthz200JSONResponseBodyStatus string

PaymentHealthz200JSONResponseBodyStatus defines parameters for PaymentHealthz.

const (
	PaymentHealthz200JSONResponseBodyStatusOk PaymentHealthz200JSONResponseBodyStatus = "ok"
)

Defines values for PaymentHealthz200JSONResponseBodyStatus.

func (PaymentHealthz200JSONResponseBodyStatus) Valid

Valid indicates whether the value is a known member of the PaymentHealthz200JSONResponseBodyStatus enum.

type PaymentHealthzRequestObject

type PaymentHealthzRequestObject struct {
}

type PaymentHealthzResponse

type PaymentHealthzResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Status PaymentHealthz200JSONResponseBodyStatus `json:"status"`
	}
}

func ParsePaymentHealthzResponse

func ParsePaymentHealthzResponse(rsp *http.Response) (*PaymentHealthzResponse, error)

ParsePaymentHealthzResponse parses an HTTP response from a PaymentHealthzWithResponse call

func (PaymentHealthzResponse) ContentType

func (r PaymentHealthzResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PaymentHealthzResponse) GetBody

func (r PaymentHealthzResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PaymentHealthzResponse) GetJSON200

func (r PaymentHealthzResponse) GetJSON200() *struct {
	Status PaymentHealthz200JSONResponseBodyStatus `json:"status"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PaymentHealthzResponse) Status

func (r PaymentHealthzResponse) Status() string

Status returns HTTPResponse.Status

func (PaymentHealthzResponse) StatusCode

func (r PaymentHealthzResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PaymentHealthzResponseObject

type PaymentHealthzResponseObject interface {
	VisitPaymentHealthzResponse(w http.ResponseWriter) error
}

type PaymentProvider

type PaymentProvider string

PaymentProvider defines model for Payment.Provider.

const (
	PaymentProviderStripe PaymentProvider = "stripe"
)

Defines values for PaymentProvider.

func (PaymentProvider) Valid

func (e PaymentProvider) Valid() bool

Valid indicates whether the value is a known member of the PaymentProvider enum.

type PaymentReadyz200JSONResponse

type PaymentReadyz200JSONResponse struct {
	Status PaymentReadyz200JSONResponseBodyStatus `json:"status"`
}

func (PaymentReadyz200JSONResponse) VisitPaymentReadyzResponse

func (response PaymentReadyz200JSONResponse) VisitPaymentReadyzResponse(w http.ResponseWriter) error

type PaymentReadyz200JSONResponseBodyStatus

type PaymentReadyz200JSONResponseBodyStatus string

PaymentReadyz200JSONResponseBodyStatus defines parameters for PaymentReadyz.

const (
	PaymentReadyz200JSONResponseBodyStatusOk PaymentReadyz200JSONResponseBodyStatus = "ok"
)

Defines values for PaymentReadyz200JSONResponseBodyStatus.

func (PaymentReadyz200JSONResponseBodyStatus) Valid

Valid indicates whether the value is a known member of the PaymentReadyz200JSONResponseBodyStatus enum.

type PaymentReadyz503JSONResponse

type PaymentReadyz503JSONResponse Error

func (PaymentReadyz503JSONResponse) VisitPaymentReadyzResponse

func (response PaymentReadyz503JSONResponse) VisitPaymentReadyzResponse(w http.ResponseWriter) error

type PaymentReadyzRequestObject

type PaymentReadyzRequestObject struct {
}

type PaymentReadyzResponse

type PaymentReadyzResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Status PaymentReadyz200JSONResponseBodyStatus `json:"status"`
	}
	// JSON503 the response for an HTTP 503 `application/json` response
	JSON503 *Error
}

func ParsePaymentReadyzResponse

func ParsePaymentReadyzResponse(rsp *http.Response) (*PaymentReadyzResponse, error)

ParsePaymentReadyzResponse parses an HTTP response from a PaymentReadyzWithResponse call

func (PaymentReadyzResponse) ContentType

func (r PaymentReadyzResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PaymentReadyzResponse) GetBody

func (r PaymentReadyzResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PaymentReadyzResponse) GetJSON200

func (r PaymentReadyzResponse) GetJSON200() *struct {
	Status PaymentReadyz200JSONResponseBodyStatus `json:"status"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PaymentReadyzResponse) GetJSON503

func (r PaymentReadyzResponse) GetJSON503() *Error

GetJSON503 returns the response for an HTTP 503 `application/json` response

func (PaymentReadyzResponse) Status

func (r PaymentReadyzResponse) Status() string

Status returns HTTPResponse.Status

func (PaymentReadyzResponse) StatusCode

func (r PaymentReadyzResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PaymentReadyzResponseObject

type PaymentReadyzResponseObject interface {
	VisitPaymentReadyzResponse(w http.ResponseWriter) error
}

type PaymentStatus

type PaymentStatus string

PaymentStatus pending — PaymentIntent created, outcome unknown succeeded — Stripe confirmed the charge (via webhook); terminal failed — Stripe declined or the intent was cancelled; terminal

const (
	Failed    PaymentStatus = "failed"
	Pending   PaymentStatus = "pending"
	Succeeded PaymentStatus = "succeeded"
)

Defines values for PaymentStatus.

func (PaymentStatus) Valid

func (e PaymentStatus) Valid() bool

Valid indicates whether the value is a known member of the PaymentStatus enum.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServeMux

type ServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	http.Handler
}

ServeMux is an abstraction of http.ServeMux.

type ServerError

type ServerError = Error

ServerError defines model for ServerError.

type ServerErrorJSONResponse

type ServerErrorJSONResponse Error

type ServerInterface

type ServerInterface interface {
	// PaymentHealthz Liveness probe
	// (GET /healthz)
	PaymentHealthz(w http.ResponseWriter, r *http.Request)
	// PaymentReadyz Readiness probe — checks database and broker connectivity
	// (GET /readyz)
	PaymentReadyz(w http.ResponseWriter, r *http.Request)
	// CreatePayment Start a payment for a held booking
	// (POST /v1/payments)
	CreatePayment(w http.ResponseWriter, r *http.Request, params CreatePaymentParams)
	// GetPayment Get a payment's status
	// (GET /v1/payments/{payment_id})
	GetPayment(w http.ResponseWriter, r *http.Request, paymentId Uuid, params GetPaymentParams)
	// HandleStripeWebhook Stripe payment outcome callback
	// (POST /v1/webhooks/stripe)
	HandleStripeWebhook(w http.ResponseWriter, r *http.Request, params HandleStripeWebhookParams)
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) CreatePayment

func (siw *ServerInterfaceWrapper) CreatePayment(w http.ResponseWriter, r *http.Request)

CreatePayment operation middleware

func (*ServerInterfaceWrapper) GetPayment

func (siw *ServerInterfaceWrapper) GetPayment(w http.ResponseWriter, r *http.Request)

GetPayment operation middleware

func (*ServerInterfaceWrapper) HandleStripeWebhook

func (siw *ServerInterfaceWrapper) HandleStripeWebhook(w http.ResponseWriter, r *http.Request)

HandleStripeWebhook operation middleware

func (*ServerInterfaceWrapper) PaymentHealthz

func (siw *ServerInterfaceWrapper) PaymentHealthz(w http.ResponseWriter, r *http.Request)

PaymentHealthz operation middleware

func (*ServerInterfaceWrapper) PaymentReadyz

func (siw *ServerInterfaceWrapper) PaymentReadyz(w http.ResponseWriter, r *http.Request)

PaymentReadyz operation middleware

type StdHTTPServerOptions

type StdHTTPServerOptions struct {
	BaseURL          string
	BaseRouter       ServeMux
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHTTPServerOptions

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHandlerFunc

type StrictHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, request any) (any, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// PaymentHealthz Liveness probe
	// (GET /healthz)
	PaymentHealthz(ctx context.Context, request PaymentHealthzRequestObject) (PaymentHealthzResponseObject, error)
	// PaymentReadyz Readiness probe — checks database and broker connectivity
	// (GET /readyz)
	PaymentReadyz(ctx context.Context, request PaymentReadyzRequestObject) (PaymentReadyzResponseObject, error)
	// CreatePayment Start a payment for a held booking
	// (POST /v1/payments)
	CreatePayment(ctx context.Context, request CreatePaymentRequestObject) (CreatePaymentResponseObject, error)
	// GetPayment Get a payment's status
	// (GET /v1/payments/{payment_id})
	GetPayment(ctx context.Context, request GetPaymentRequestObject) (GetPaymentResponseObject, error)
	// HandleStripeWebhook Stripe payment outcome callback
	// (POST /v1/webhooks/stripe)
	HandleStripeWebhook(ctx context.Context, request HandleStripeWebhookRequestObject) (HandleStripeWebhookResponseObject, error)
}

StrictServerInterface represents all server handlers.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type Unauthorized

type Unauthorized = Error

Unauthorized defines model for Unauthorized.

type UnauthorizedJSONResponse

type UnauthorizedJSONResponse Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type Uuid

type Uuid = openapi_types.UUID

Uuid UUIDv7, string-typed everywhere

Examples: 01912d5a-7f3e-7c1a-9b2e-3f4a5b6c7d8e

Jump to

Keyboard shortcuts

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