Documentation
¶
Overview ¶
Package crosspay provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Index ¶
- func NewGetTenantEntitlementsByEnvironmentRequest(server string, environment string) (*http.Request, error)
- func NewGetTenantGocardlessProductsByEnvironmentRequest(server string, environment string) (*http.Request, error)
- func NewGetTenantProductsRequest(server string, params *GetTenantProductsParams) (*http.Request, error)
- func NewGetTenantServerCustomersRequest(server string, params *GetTenantServerCustomersParams) (*http.Request, error)
- func NewGetTenantStripeProductsByEnvironmentRequest(server string, environment string) (*http.Request, error)
- func NewPostTenantServerCustomerRequest(server string, body PostTenantServerCustomerJSONRequestBody) (*http.Request, error)
- func NewPostTenantServerCustomerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostTenantStripeCheckoutByEnvironmentRequest(server string, environment string, ...) (*http.Request, error)
- func NewPostTenantStripeCheckoutByEnvironmentRequestWithBody(server string, environment string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostTenantSubscriptionsActiveRequest(server string, body PostTenantSubscriptionsActiveJSONRequestBody) (*http.Request, error)
- func NewPostTenantSubscriptionsActiveRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- type Client
- func (c *Client) GetTenantEntitlementsByEnvironment(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetTenantGocardlessProductsByEnvironment(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetTenantProducts(ctx context.Context, params *GetTenantProductsParams, ...) (*http.Response, error)
- func (c *Client) GetTenantServerCustomers(ctx context.Context, params *GetTenantServerCustomersParams, ...) (*http.Response, error)
- func (c *Client) GetTenantStripeProductsByEnvironment(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostTenantServerCustomer(ctx context.Context, body PostTenantServerCustomerJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostTenantServerCustomerWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostTenantStripeCheckoutByEnvironment(ctx context.Context, environment string, ...) (*http.Response, error)
- func (c *Client) PostTenantStripeCheckoutByEnvironmentWithBody(ctx context.Context, environment string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostTenantSubscriptionsActive(ctx context.Context, body PostTenantSubscriptionsActiveJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostTenantSubscriptionsActiveWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetTenantEntitlementsByEnvironmentWithResponse(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*GetTenantEntitlementsByEnvironmentResponse, error)
- func (c *ClientWithResponses) GetTenantGocardlessProductsByEnvironmentWithResponse(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*GetTenantGocardlessProductsByEnvironmentResponse, error)
- func (c *ClientWithResponses) GetTenantProductsWithResponse(ctx context.Context, params *GetTenantProductsParams, ...) (*GetTenantProductsResponse, error)
- func (c *ClientWithResponses) GetTenantServerCustomersWithResponse(ctx context.Context, params *GetTenantServerCustomersParams, ...) (*GetTenantServerCustomersResponse, error)
- func (c *ClientWithResponses) GetTenantStripeProductsByEnvironmentWithResponse(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*GetTenantStripeProductsByEnvironmentResponse, error)
- func (c *ClientWithResponses) PostTenantServerCustomerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostTenantServerCustomerResponse, error)
- func (c *ClientWithResponses) PostTenantServerCustomerWithResponse(ctx context.Context, body PostTenantServerCustomerJSONRequestBody, ...) (*PostTenantServerCustomerResponse, error)
- func (c *ClientWithResponses) PostTenantStripeCheckoutByEnvironmentWithBodyWithResponse(ctx context.Context, environment string, contentType string, body io.Reader, ...) (*PostTenantStripeCheckoutByEnvironmentResponse, error)
- func (c *ClientWithResponses) PostTenantStripeCheckoutByEnvironmentWithResponse(ctx context.Context, environment string, ...) (*PostTenantStripeCheckoutByEnvironmentResponse, error)
- func (c *ClientWithResponses) PostTenantSubscriptionsActiveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostTenantSubscriptionsActiveResponse, error)
- func (c *ClientWithResponses) PostTenantSubscriptionsActiveWithResponse(ctx context.Context, body PostTenantSubscriptionsActiveJSONRequestBody, ...) (*PostTenantSubscriptionsActiveResponse, error)
- type ClientWithResponsesInterface
- type CrosspayServerClient
- func (c *CrosspayServerClient) ConstructWebhookEvent(webhookPublicKey string, rawPayload []byte, signatureHeader string, ...) (*GetCustomerExtendedInfoByEmailRow, error)
- func (c *CrosspayServerClient) GetActiveEntitlement(ctx context.Context, customerEmail, environment string) (*TenantEntitlement, error)
- func (c *CrosspayServerClient) GetActiveProduct(ctx context.Context, customerEmail string) (*TenantProduct, error)
- func (c *CrosspayServerClient) GetActiveSubscription(ctx context.Context, customerEmail string) (*StorableSubscription, error)
- func (c *CrosspayServerClient) GetCustomerInfo(ctx context.Context, customerEmail string) (*GetCustomerExtendedInfoByEmailRow, error)
- func (c *CrosspayServerClient) ListCustomers(ctx context.Context, limit *int64, cursor *string) (*ListCustomerResponseBody, error)
- func (c *CrosspayServerClient) ListEntitlements(ctx context.Context, environment string) ([]TenantEntitlement, error)
- func (c *CrosspayServerClient) ListProducts(ctx context.Context) ([]TenantProduct, error)
- type ErrorDetail
- type ErrorModel
- type GetCustomerExtendedInfoByEmailRow
- type GetTenantEntitlementsByEnvironmentResponse
- type GetTenantGocardlessProductsByEnvironmentResponse
- type GetTenantProductsParams
- type GetTenantProductsResponse
- type GetTenantServerCustomersParams
- type GetTenantServerCustomersResponse
- type GetTenantStripeProductsByEnvironmentResponse
- type HttpRequestDoer
- type ListCustomerResponseBody
- type ListCustomersByAppIDAndOrgIDPaginatedRow
- type PaginatedCustomers
- type PostTenantServerCustomerJSONRequestBody
- type PostTenantServerCustomerResponse
- type PostTenantStripeCheckoutByEnvironmentJSONRequestBody
- type PostTenantStripeCheckoutByEnvironmentResponse
- type PostTenantSubscriptionsActiveJSONRequestBody
- type PostTenantSubscriptionsActiveResponse
- type RequestEditorFn
- type StorableSubscription
- type SubscriptionGocardlessProduct
- type SubscriptionStripePrice
- type SubscriptionStripeProduct
- type TenantActiveSubscriptionInputBody
- type TenantActiveSubscriptionResponseBody
- type TenantEntitlement
- type TenantEntitlementProduct
- type TenantListEntitlementsResponseBody
- type TenantListGocardlessProductsResponseBody
- type TenantListProductsResponseBody
- type TenantListStripeProductsResponseBody
- type TenantProduct
- type TenantProducts
- type TenantServerGetCustomerInputBody
- type TenantServerGetCustomerResponseBody
- type TenantStripeCheckoutInputBody
- type TenantStripeCheckoutResponseBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGetTenantEntitlementsByEnvironmentRequest ¶
func NewGetTenantEntitlementsByEnvironmentRequest(server string, environment string) (*http.Request, error)
NewGetTenantEntitlementsByEnvironmentRequest generates requests for GetTenantEntitlementsByEnvironment
func NewGetTenantGocardlessProductsByEnvironmentRequest ¶
func NewGetTenantGocardlessProductsByEnvironmentRequest(server string, environment string) (*http.Request, error)
NewGetTenantGocardlessProductsByEnvironmentRequest generates requests for GetTenantGocardlessProductsByEnvironment
func NewGetTenantProductsRequest ¶
func NewGetTenantProductsRequest(server string, params *GetTenantProductsParams) (*http.Request, error)
NewGetTenantProductsRequest generates requests for GetTenantProducts
func NewGetTenantServerCustomersRequest ¶
func NewGetTenantServerCustomersRequest(server string, params *GetTenantServerCustomersParams) (*http.Request, error)
NewGetTenantServerCustomersRequest generates requests for GetTenantServerCustomers
func NewGetTenantStripeProductsByEnvironmentRequest ¶
func NewGetTenantStripeProductsByEnvironmentRequest(server string, environment string) (*http.Request, error)
NewGetTenantStripeProductsByEnvironmentRequest generates requests for GetTenantStripeProductsByEnvironment
func NewPostTenantServerCustomerRequest ¶
func NewPostTenantServerCustomerRequest(server string, body PostTenantServerCustomerJSONRequestBody) (*http.Request, error)
NewPostTenantServerCustomerRequest calls the generic PostTenantServerCustomer builder with application/json body
func NewPostTenantServerCustomerRequestWithBody ¶
func NewPostTenantServerCustomerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostTenantServerCustomerRequestWithBody generates requests for PostTenantServerCustomer with any type of body
func NewPostTenantStripeCheckoutByEnvironmentRequest ¶
func NewPostTenantStripeCheckoutByEnvironmentRequest(server string, environment string, body PostTenantStripeCheckoutByEnvironmentJSONRequestBody) (*http.Request, error)
NewPostTenantStripeCheckoutByEnvironmentRequest calls the generic PostTenantStripeCheckoutByEnvironment builder with application/json body
func NewPostTenantStripeCheckoutByEnvironmentRequestWithBody ¶
func NewPostTenantStripeCheckoutByEnvironmentRequestWithBody(server string, environment string, contentType string, body io.Reader) (*http.Request, error)
NewPostTenantStripeCheckoutByEnvironmentRequestWithBody generates requests for PostTenantStripeCheckoutByEnvironment with any type of body
func NewPostTenantSubscriptionsActiveRequest ¶
func NewPostTenantSubscriptionsActiveRequest(server string, body PostTenantSubscriptionsActiveJSONRequestBody) (*http.Request, error)
NewPostTenantSubscriptionsActiveRequest calls the generic PostTenantSubscriptionsActive builder with application/json body
func NewPostTenantSubscriptionsActiveRequestWithBody ¶
func NewPostTenantSubscriptionsActiveRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostTenantSubscriptionsActiveRequestWithBody generates requests for PostTenantSubscriptionsActive with any type of body
Types ¶
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) GetTenantEntitlementsByEnvironment ¶
func (*Client) GetTenantGocardlessProductsByEnvironment ¶
func (*Client) GetTenantProducts ¶
func (c *Client) GetTenantProducts(ctx context.Context, params *GetTenantProductsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetTenantServerCustomers ¶
func (c *Client) GetTenantServerCustomers(ctx context.Context, params *GetTenantServerCustomersParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetTenantStripeProductsByEnvironment ¶
func (*Client) PostTenantServerCustomer ¶
func (c *Client) PostTenantServerCustomer(ctx context.Context, body PostTenantServerCustomerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostTenantServerCustomerWithBody ¶
func (*Client) PostTenantStripeCheckoutByEnvironment ¶
func (c *Client) PostTenantStripeCheckoutByEnvironment(ctx context.Context, environment string, body PostTenantStripeCheckoutByEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostTenantStripeCheckoutByEnvironmentWithBody ¶
func (*Client) PostTenantSubscriptionsActive ¶
func (c *Client) PostTenantSubscriptionsActive(ctx context.Context, body PostTenantSubscriptionsActiveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// PostTenantServerCustomerWithBody request with any body
PostTenantServerCustomerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostTenantServerCustomer(ctx context.Context, body PostTenantServerCustomerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTenantServerCustomers request
GetTenantServerCustomers(ctx context.Context, params *GetTenantServerCustomersParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTenantEntitlementsByEnvironment request
GetTenantEntitlementsByEnvironment(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTenantGocardlessProductsByEnvironment request
GetTenantGocardlessProductsByEnvironment(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTenantProducts request
GetTenantProducts(ctx context.Context, params *GetTenantProductsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostTenantStripeCheckoutByEnvironmentWithBody request with any body
PostTenantStripeCheckoutByEnvironmentWithBody(ctx context.Context, environment string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostTenantStripeCheckoutByEnvironment(ctx context.Context, environment string, body PostTenantStripeCheckoutByEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTenantStripeProductsByEnvironment request
GetTenantStripeProductsByEnvironment(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostTenantSubscriptionsActiveWithBody request with any body
PostTenantSubscriptionsActiveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostTenantSubscriptionsActive(ctx context.Context, body PostTenantSubscriptionsActiveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
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) GetTenantEntitlementsByEnvironmentWithResponse ¶
func (c *ClientWithResponses) GetTenantEntitlementsByEnvironmentWithResponse(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*GetTenantEntitlementsByEnvironmentResponse, error)
GetTenantEntitlementsByEnvironmentWithResponse request returning *GetTenantEntitlementsByEnvironmentResponse
func (*ClientWithResponses) GetTenantGocardlessProductsByEnvironmentWithResponse ¶
func (c *ClientWithResponses) GetTenantGocardlessProductsByEnvironmentWithResponse(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*GetTenantGocardlessProductsByEnvironmentResponse, error)
GetTenantGocardlessProductsByEnvironmentWithResponse request returning *GetTenantGocardlessProductsByEnvironmentResponse
func (*ClientWithResponses) GetTenantProductsWithResponse ¶
func (c *ClientWithResponses) GetTenantProductsWithResponse(ctx context.Context, params *GetTenantProductsParams, reqEditors ...RequestEditorFn) (*GetTenantProductsResponse, error)
GetTenantProductsWithResponse request returning *GetTenantProductsResponse
func (*ClientWithResponses) GetTenantServerCustomersWithResponse ¶
func (c *ClientWithResponses) GetTenantServerCustomersWithResponse(ctx context.Context, params *GetTenantServerCustomersParams, reqEditors ...RequestEditorFn) (*GetTenantServerCustomersResponse, error)
GetTenantServerCustomersWithResponse request returning *GetTenantServerCustomersResponse
func (*ClientWithResponses) GetTenantStripeProductsByEnvironmentWithResponse ¶
func (c *ClientWithResponses) GetTenantStripeProductsByEnvironmentWithResponse(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*GetTenantStripeProductsByEnvironmentResponse, error)
GetTenantStripeProductsByEnvironmentWithResponse request returning *GetTenantStripeProductsByEnvironmentResponse
func (*ClientWithResponses) PostTenantServerCustomerWithBodyWithResponse ¶
func (c *ClientWithResponses) PostTenantServerCustomerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTenantServerCustomerResponse, error)
PostTenantServerCustomerWithBodyWithResponse request with arbitrary body returning *PostTenantServerCustomerResponse
func (*ClientWithResponses) PostTenantServerCustomerWithResponse ¶
func (c *ClientWithResponses) PostTenantServerCustomerWithResponse(ctx context.Context, body PostTenantServerCustomerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTenantServerCustomerResponse, error)
func (*ClientWithResponses) PostTenantStripeCheckoutByEnvironmentWithBodyWithResponse ¶
func (c *ClientWithResponses) PostTenantStripeCheckoutByEnvironmentWithBodyWithResponse(ctx context.Context, environment string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTenantStripeCheckoutByEnvironmentResponse, error)
PostTenantStripeCheckoutByEnvironmentWithBodyWithResponse request with arbitrary body returning *PostTenantStripeCheckoutByEnvironmentResponse
func (*ClientWithResponses) PostTenantStripeCheckoutByEnvironmentWithResponse ¶
func (c *ClientWithResponses) PostTenantStripeCheckoutByEnvironmentWithResponse(ctx context.Context, environment string, body PostTenantStripeCheckoutByEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTenantStripeCheckoutByEnvironmentResponse, error)
func (*ClientWithResponses) PostTenantSubscriptionsActiveWithBodyWithResponse ¶
func (c *ClientWithResponses) PostTenantSubscriptionsActiveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTenantSubscriptionsActiveResponse, error)
PostTenantSubscriptionsActiveWithBodyWithResponse request with arbitrary body returning *PostTenantSubscriptionsActiveResponse
func (*ClientWithResponses) PostTenantSubscriptionsActiveWithResponse ¶
func (c *ClientWithResponses) PostTenantSubscriptionsActiveWithResponse(ctx context.Context, body PostTenantSubscriptionsActiveJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTenantSubscriptionsActiveResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// PostTenantServerCustomerWithBodyWithResponse request with any body
PostTenantServerCustomerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTenantServerCustomerResponse, error)
PostTenantServerCustomerWithResponse(ctx context.Context, body PostTenantServerCustomerJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTenantServerCustomerResponse, error)
// GetTenantServerCustomersWithResponse request
GetTenantServerCustomersWithResponse(ctx context.Context, params *GetTenantServerCustomersParams, reqEditors ...RequestEditorFn) (*GetTenantServerCustomersResponse, error)
// GetTenantEntitlementsByEnvironmentWithResponse request
GetTenantEntitlementsByEnvironmentWithResponse(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*GetTenantEntitlementsByEnvironmentResponse, error)
// GetTenantGocardlessProductsByEnvironmentWithResponse request
GetTenantGocardlessProductsByEnvironmentWithResponse(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*GetTenantGocardlessProductsByEnvironmentResponse, error)
// GetTenantProductsWithResponse request
GetTenantProductsWithResponse(ctx context.Context, params *GetTenantProductsParams, reqEditors ...RequestEditorFn) (*GetTenantProductsResponse, error)
// PostTenantStripeCheckoutByEnvironmentWithBodyWithResponse request with any body
PostTenantStripeCheckoutByEnvironmentWithBodyWithResponse(ctx context.Context, environment string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTenantStripeCheckoutByEnvironmentResponse, error)
PostTenantStripeCheckoutByEnvironmentWithResponse(ctx context.Context, environment string, body PostTenantStripeCheckoutByEnvironmentJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTenantStripeCheckoutByEnvironmentResponse, error)
// GetTenantStripeProductsByEnvironmentWithResponse request
GetTenantStripeProductsByEnvironmentWithResponse(ctx context.Context, environment string, reqEditors ...RequestEditorFn) (*GetTenantStripeProductsByEnvironmentResponse, error)
// PostTenantSubscriptionsActiveWithBodyWithResponse request with any body
PostTenantSubscriptionsActiveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostTenantSubscriptionsActiveResponse, error)
PostTenantSubscriptionsActiveWithResponse(ctx context.Context, body PostTenantSubscriptionsActiveJSONRequestBody, reqEditors ...RequestEditorFn) (*PostTenantSubscriptionsActiveResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CrosspayServerClient ¶
type CrosspayServerClient struct {
// contains filtered or unexported fields
}
CrosspayServerClient is a high-level client for the Crosspay API
func NewCrosspayServerClient ¶
func NewCrosspayServerClient(apiKey string, baseURL ...string) (*CrosspayServerClient, error)
NewCrosspayServerClient creates a new Crosspay server client
func (*CrosspayServerClient) ConstructWebhookEvent ¶
func (c *CrosspayServerClient) ConstructWebhookEvent( webhookPublicKey string, rawPayload []byte, signatureHeader string, timestampHeader string, ) (*GetCustomerExtendedInfoByEmailRow, error)
ConstructWebhookEvent validates and parses a webhook event
func (*CrosspayServerClient) GetActiveEntitlement ¶
func (c *CrosspayServerClient) GetActiveEntitlement(ctx context.Context, customerEmail, environment string) (*TenantEntitlement, error)
GetActiveEntitlement retrieves the active entitlement for a customer
func (*CrosspayServerClient) GetActiveProduct ¶
func (c *CrosspayServerClient) GetActiveProduct(ctx context.Context, customerEmail string) (*TenantProduct, error)
GetActiveProduct retrieves the active product for a customer
func (*CrosspayServerClient) GetActiveSubscription ¶
func (c *CrosspayServerClient) GetActiveSubscription(ctx context.Context, customerEmail string) (*StorableSubscription, error)
GetActiveSubscription retrieves the active subscription for a customer
func (*CrosspayServerClient) GetCustomerInfo ¶
func (c *CrosspayServerClient) GetCustomerInfo(ctx context.Context, customerEmail string) (*GetCustomerExtendedInfoByEmailRow, error)
GetCustomerInfo retrieves extended customer information
func (*CrosspayServerClient) ListCustomers ¶
func (c *CrosspayServerClient) ListCustomers(ctx context.Context, limit *int64, cursor *string) (*ListCustomerResponseBody, error)
ListCustomers retrieves a paginated list of customers
func (*CrosspayServerClient) ListEntitlements ¶
func (c *CrosspayServerClient) ListEntitlements(ctx context.Context, environment string) ([]TenantEntitlement, error)
ListEntitlements retrieves all tenant entitlements for the specified environment
func (*CrosspayServerClient) ListProducts ¶
func (c *CrosspayServerClient) ListProducts(ctx context.Context) ([]TenantProduct, error)
ListProducts retrieves all tenant products
type ErrorDetail ¶
type ErrorDetail struct {
// Location Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
Location *string `json:"location,omitempty"`
// Message Error message text
Message *string `json:"message,omitempty"`
// Value The value at the given location
Value interface{} `json:"value,omitempty"`
}
ErrorDetail defines model for ErrorDetail.
type ErrorModel ¶
type ErrorModel struct {
// Detail A human-readable explanation specific to this occurrence of the problem.
Detail *string `json:"detail,omitempty"`
// Errors Optional list of individual error details
Errors *[]ErrorDetail `json:"errors"`
// Instance A URI reference that identifies the specific occurrence of the problem.
Instance *string `json:"instance,omitempty"`
// Status HTTP status code
Status *int64 `json:"status,omitempty"`
// Title A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
Title *string `json:"title,omitempty"`
// Type A URI reference to human-readable documentation for the error.
Type *string `json:"type,omitempty"`
}
ErrorModel defines model for ErrorModel.
type GetCustomerExtendedInfoByEmailRow ¶
type GetCustomerExtendedInfoByEmailRow struct {
Email string `json:"email"`
EntitlementName *string `json:"entitlement_name"`
Id string `json:"id"`
ProductId *string `json:"product_id"`
ProductName *string `json:"product_name"`
Status *string `json:"status"`
Store *string `json:"store"`
}
GetCustomerExtendedInfoByEmailRow defines model for GetCustomerExtendedInfoByEmailRow.
type GetTenantEntitlementsByEnvironmentResponse ¶
type GetTenantEntitlementsByEnvironmentResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TenantListEntitlementsResponseBody
ApplicationproblemJSONDefault *ErrorModel
}
func ParseGetTenantEntitlementsByEnvironmentResponse ¶
func ParseGetTenantEntitlementsByEnvironmentResponse(rsp *http.Response) (*GetTenantEntitlementsByEnvironmentResponse, error)
ParseGetTenantEntitlementsByEnvironmentResponse parses an HTTP response from a GetTenantEntitlementsByEnvironmentWithResponse call
func (GetTenantEntitlementsByEnvironmentResponse) Status ¶
func (r GetTenantEntitlementsByEnvironmentResponse) Status() string
Status returns HTTPResponse.Status
func (GetTenantEntitlementsByEnvironmentResponse) StatusCode ¶
func (r GetTenantEntitlementsByEnvironmentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTenantGocardlessProductsByEnvironmentResponse ¶
type GetTenantGocardlessProductsByEnvironmentResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TenantListGocardlessProductsResponseBody
ApplicationproblemJSONDefault *ErrorModel
}
func ParseGetTenantGocardlessProductsByEnvironmentResponse ¶
func ParseGetTenantGocardlessProductsByEnvironmentResponse(rsp *http.Response) (*GetTenantGocardlessProductsByEnvironmentResponse, error)
ParseGetTenantGocardlessProductsByEnvironmentResponse parses an HTTP response from a GetTenantGocardlessProductsByEnvironmentWithResponse call
func (GetTenantGocardlessProductsByEnvironmentResponse) Status ¶
func (r GetTenantGocardlessProductsByEnvironmentResponse) Status() string
Status returns HTTPResponse.Status
func (GetTenantGocardlessProductsByEnvironmentResponse) StatusCode ¶
func (r GetTenantGocardlessProductsByEnvironmentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTenantProductsParams ¶
type GetTenantProductsParams struct {
ApiKey *string `json:"api-key,omitempty"`
}
GetTenantProductsParams defines parameters for GetTenantProducts.
type GetTenantProductsResponse ¶
type GetTenantProductsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TenantListProductsResponseBody
ApplicationproblemJSONDefault *ErrorModel
}
func ParseGetTenantProductsResponse ¶
func ParseGetTenantProductsResponse(rsp *http.Response) (*GetTenantProductsResponse, error)
ParseGetTenantProductsResponse parses an HTTP response from a GetTenantProductsWithResponse call
func (GetTenantProductsResponse) Status ¶
func (r GetTenantProductsResponse) Status() string
Status returns HTTPResponse.Status
func (GetTenantProductsResponse) StatusCode ¶
func (r GetTenantProductsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTenantServerCustomersParams ¶
type GetTenantServerCustomersParams struct {
Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"`
Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"`
}
GetTenantServerCustomersParams defines parameters for GetTenantServerCustomers.
type GetTenantServerCustomersResponse ¶
type GetTenantServerCustomersResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ListCustomerResponseBody
ApplicationproblemJSONDefault *ErrorModel
}
func ParseGetTenantServerCustomersResponse ¶
func ParseGetTenantServerCustomersResponse(rsp *http.Response) (*GetTenantServerCustomersResponse, error)
ParseGetTenantServerCustomersResponse parses an HTTP response from a GetTenantServerCustomersWithResponse call
func (GetTenantServerCustomersResponse) Status ¶
func (r GetTenantServerCustomersResponse) Status() string
Status returns HTTPResponse.Status
func (GetTenantServerCustomersResponse) StatusCode ¶
func (r GetTenantServerCustomersResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTenantStripeProductsByEnvironmentResponse ¶
type GetTenantStripeProductsByEnvironmentResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TenantListStripeProductsResponseBody
ApplicationproblemJSONDefault *ErrorModel
}
func ParseGetTenantStripeProductsByEnvironmentResponse ¶
func ParseGetTenantStripeProductsByEnvironmentResponse(rsp *http.Response) (*GetTenantStripeProductsByEnvironmentResponse, error)
ParseGetTenantStripeProductsByEnvironmentResponse parses an HTTP response from a GetTenantStripeProductsByEnvironmentWithResponse call
func (GetTenantStripeProductsByEnvironmentResponse) Status ¶
func (r GetTenantStripeProductsByEnvironmentResponse) Status() string
Status returns HTTPResponse.Status
func (GetTenantStripeProductsByEnvironmentResponse) StatusCode ¶
func (r GetTenantStripeProductsByEnvironmentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ListCustomerResponseBody ¶
type ListCustomerResponseBody struct {
Data PaginatedCustomers `json:"data"`
Error *string `json:"error,omitempty"`
}
ListCustomerResponseBody defines model for ListCustomerResponseBody.
type ListCustomersByAppIDAndOrgIDPaginatedRow ¶
type ListCustomersByAppIDAndOrgIDPaginatedRow struct {
Email string `json:"email"`
EntitlementName *string `json:"entitlement_name"`
Id string `json:"id"`
ProductId *string `json:"product_id"`
ProductName *string `json:"product_name"`
Status *string `json:"status"`
Store *string `json:"store"`
}
ListCustomersByAppIDAndOrgIDPaginatedRow defines model for ListCustomersByAppIDAndOrgIDPaginatedRow.
type PaginatedCustomers ¶
type PaginatedCustomers struct {
Customers *[]ListCustomersByAppIDAndOrgIDPaginatedRow `json:"customers"`
Limit int64 `json:"limit"`
NextCursor *string `json:"next_cursor,omitempty"`
Total *int64 `json:"total,omitempty"`
}
PaginatedCustomers defines model for PaginatedCustomers.
type PostTenantServerCustomerJSONRequestBody ¶
type PostTenantServerCustomerJSONRequestBody = TenantServerGetCustomerInputBody
PostTenantServerCustomerJSONRequestBody defines body for PostTenantServerCustomer for application/json ContentType.
type PostTenantServerCustomerResponse ¶
type PostTenantServerCustomerResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TenantServerGetCustomerResponseBody
ApplicationproblemJSONDefault *ErrorModel
}
func ParsePostTenantServerCustomerResponse ¶
func ParsePostTenantServerCustomerResponse(rsp *http.Response) (*PostTenantServerCustomerResponse, error)
ParsePostTenantServerCustomerResponse parses an HTTP response from a PostTenantServerCustomerWithResponse call
func (PostTenantServerCustomerResponse) Status ¶
func (r PostTenantServerCustomerResponse) Status() string
Status returns HTTPResponse.Status
func (PostTenantServerCustomerResponse) StatusCode ¶
func (r PostTenantServerCustomerResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostTenantStripeCheckoutByEnvironmentJSONRequestBody ¶
type PostTenantStripeCheckoutByEnvironmentJSONRequestBody = TenantStripeCheckoutInputBody
PostTenantStripeCheckoutByEnvironmentJSONRequestBody defines body for PostTenantStripeCheckoutByEnvironment for application/json ContentType.
type PostTenantStripeCheckoutByEnvironmentResponse ¶
type PostTenantStripeCheckoutByEnvironmentResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TenantStripeCheckoutResponseBody
ApplicationproblemJSONDefault *ErrorModel
}
func ParsePostTenantStripeCheckoutByEnvironmentResponse ¶
func ParsePostTenantStripeCheckoutByEnvironmentResponse(rsp *http.Response) (*PostTenantStripeCheckoutByEnvironmentResponse, error)
ParsePostTenantStripeCheckoutByEnvironmentResponse parses an HTTP response from a PostTenantStripeCheckoutByEnvironmentWithResponse call
func (PostTenantStripeCheckoutByEnvironmentResponse) Status ¶
func (r PostTenantStripeCheckoutByEnvironmentResponse) Status() string
Status returns HTTPResponse.Status
func (PostTenantStripeCheckoutByEnvironmentResponse) StatusCode ¶
func (r PostTenantStripeCheckoutByEnvironmentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostTenantSubscriptionsActiveJSONRequestBody ¶
type PostTenantSubscriptionsActiveJSONRequestBody = TenantActiveSubscriptionInputBody
PostTenantSubscriptionsActiveJSONRequestBody defines body for PostTenantSubscriptionsActive for application/json ContentType.
type PostTenantSubscriptionsActiveResponse ¶
type PostTenantSubscriptionsActiveResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TenantActiveSubscriptionResponseBody
ApplicationproblemJSONDefault *ErrorModel
}
func ParsePostTenantSubscriptionsActiveResponse ¶
func ParsePostTenantSubscriptionsActiveResponse(rsp *http.Response) (*PostTenantSubscriptionsActiveResponse, error)
ParsePostTenantSubscriptionsActiveResponse parses an HTTP response from a PostTenantSubscriptionsActiveWithResponse call
func (PostTenantSubscriptionsActiveResponse) Status ¶
func (r PostTenantSubscriptionsActiveResponse) Status() string
Status returns HTTPResponse.Status
func (PostTenantSubscriptionsActiveResponse) StatusCode ¶
func (r PostTenantSubscriptionsActiveResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type StorableSubscription ¶
type StorableSubscription struct {
ExpiresAt int64 `json:"expires_at"`
Id string `json:"id"`
ProductId string `json:"product_id"`
RenewalStatus string `json:"renewal_status"`
Status string `json:"status"`
Store string `json:"store"`
}
StorableSubscription defines model for StorableSubscription.
type SubscriptionGocardlessProduct ¶
type SubscriptionGocardlessProduct struct {
CheckoutUrl string `json:"checkout_url"`
Currency string `json:"currency"`
Description *string `json:"description,omitempty"`
FormattedPrice string `json:"formatted_price"`
Id string `json:"id"`
Name string `json:"name"`
Price int32 `json:"price"`
}
SubscriptionGocardlessProduct defines model for SubscriptionGocardlessProduct.
type SubscriptionStripePrice ¶
type SubscriptionStripePrice struct {
Currency string `json:"currency"`
FormattedPrice string `json:"formattedPrice"`
Id string `json:"id"`
Price int32 `json:"price"`
UnitLabel string `json:"unitLabel"`
}
SubscriptionStripePrice defines model for SubscriptionStripePrice.
type SubscriptionStripeProduct ¶
type SubscriptionStripeProduct struct {
Active bool `json:"active"`
Created int64 `json:"created"`
Deleted *bool `json:"deleted,omitempty"`
Description *string `json:"description,omitempty"`
Id string `json:"id"`
Images *[]string `json:"images"`
Livemode bool `json:"livemode"`
Metadata map[string]string `json:"metadata"`
Name string `json:"name"`
Object string `json:"object"`
Price SubscriptionStripePrice `json:"price"`
Shippable *bool `json:"shippable,omitempty"`
StatementDescriptor *string `json:"statement_descriptor,omitempty"`
Type string `json:"type"`
UnitLabel *string `json:"unit_label,omitempty"`
Updated int64 `json:"updated"`
Url *string `json:"url,omitempty"`
}
SubscriptionStripeProduct defines model for SubscriptionStripeProduct.
type TenantActiveSubscriptionInputBody ¶
type TenantActiveSubscriptionInputBody struct {
CustomerEmail string `json:"customer_email"`
}
TenantActiveSubscriptionInputBody defines model for TenantActiveSubscriptionInputBody.
type TenantActiveSubscriptionResponseBody ¶
type TenantActiveSubscriptionResponseBody struct {
Data *StorableSubscription `json:"data,omitempty"`
Error *string `json:"error,omitempty"`
}
TenantActiveSubscriptionResponseBody defines model for TenantActiveSubscriptionResponseBody.
type TenantEntitlement ¶
type TenantEntitlement struct {
Description *string `json:"description"`
Id string `json:"id"`
Metadata []byte `json:"metadata"`
Name string `json:"name"`
PeriodMs int64 `json:"period_ms"`
Products TenantProducts `json:"products"`
}
TenantEntitlement defines model for TenantEntitlement.
type TenantEntitlementProduct ¶
type TenantEntitlementProduct struct {
Description *string `json:"description"`
Id string `json:"id"`
Metadata []byte `json:"metadata"`
Name string `json:"name"`
ProductId string `json:"product_id"`
}
TenantEntitlementProduct defines model for TenantEntitlementProduct.
type TenantListEntitlementsResponseBody ¶
type TenantListEntitlementsResponseBody struct {
Data *[]TenantEntitlement `json:"data"`
Error *string `json:"error,omitempty"`
}
TenantListEntitlementsResponseBody defines model for TenantListEntitlementsResponseBody.
type TenantListGocardlessProductsResponseBody ¶
type TenantListGocardlessProductsResponseBody struct {
Data *[]SubscriptionGocardlessProduct `json:"data"`
Error *string `json:"error,omitempty"`
}
TenantListGocardlessProductsResponseBody defines model for TenantListGocardlessProductsResponseBody.
type TenantListProductsResponseBody ¶
type TenantListProductsResponseBody struct {
Data *[]TenantProduct `json:"data"`
Error *string `json:"error,omitempty"`
}
TenantListProductsResponseBody defines model for TenantListProductsResponseBody.
type TenantListStripeProductsResponseBody ¶
type TenantListStripeProductsResponseBody struct {
Data *[]SubscriptionStripeProduct `json:"data"`
Error *string `json:"error,omitempty"`
}
TenantListStripeProductsResponseBody defines model for TenantListStripeProductsResponseBody.
type TenantProduct ¶
type TenantProduct struct {
Description *string `json:"description"`
EntitlementId string `json:"entitlement_id"`
Id string `json:"id"`
Metadata []byte `json:"metadata"`
Name string `json:"name"`
ProductId string `json:"product_id"`
Store string `json:"store"`
}
TenantProduct defines model for TenantProduct.
type TenantProducts ¶
type TenantProducts struct {
Appstore TenantEntitlementProduct `json:"appstore"`
Gocardless TenantEntitlementProduct `json:"gocardless"`
Playstore TenantEntitlementProduct `json:"playstore"`
Stripe TenantEntitlementProduct `json:"stripe"`
}
TenantProducts defines model for TenantProducts.
type TenantServerGetCustomerInputBody ¶
type TenantServerGetCustomerInputBody struct {
CustomerEmail string `json:"customer_email"`
}
TenantServerGetCustomerInputBody defines model for TenantServerGetCustomerInputBody.
type TenantServerGetCustomerResponseBody ¶
type TenantServerGetCustomerResponseBody struct {
Data *GetCustomerExtendedInfoByEmailRow `json:"data,omitempty"`
Error *string `json:"error,omitempty"`
}
TenantServerGetCustomerResponseBody defines model for TenantServerGetCustomerResponseBody.
type TenantStripeCheckoutInputBody ¶
type TenantStripeCheckoutInputBody struct {
CustomerEmail string `json:"customer_email"`
FailureRedirectUrl string `json:"failure_redirect_url"`
ProductId string `json:"product_id"`
RedirectUrl string `json:"redirect_url"`
}
TenantStripeCheckoutInputBody defines model for TenantStripeCheckoutInputBody.
type TenantStripeCheckoutResponseBody ¶
type TenantStripeCheckoutResponseBody struct {
Error *string `json:"error,omitempty"`
Url string `json:"url"`
}
TenantStripeCheckoutResponseBody defines model for TenantStripeCheckoutResponseBody.