splititwebapiv4

package module
v2.0.12 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 10 Imported by: 0 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.

README

Getting Started with splitit-web-api-v4

Introduction

Splitit Orchestration API for managing installment plans.

Requirements

The SDK requires Go version 1.18 or above.

Building

Install Dependencies

Resolve all the SDK dependencies, using the go get command.

Installation

The following section explains how to use the github.com/Splitit/go-sdk/v2 library in a new project.

1. Add SDK as a Dependency to the Application
  • Add the following lines to your application's go.mod file:
replace github.com/Splitit/go-sdk/v2 => ".\\splitit-web-api-v4" // local path to the SDK

require github.com/Splitit/go-sdk/v2 v0.0.0
  • Resolve the dependencies in the updated go.mod file, using the go get command.

Initialize the API Client

Note: Documentation for the client can be found here.

The following parameters are configurable for the API Client:

Parameter Type Description
environment Environment The API environment.
Default: Environment.SANDBOX
httpConfiguration HttpConfiguration Configurable http client options like timeout and retries.
oAuth2Credentials OAuth2Credentials The Credentials Setter for OAuth 2 Client Credentials Grant
apiKeyCredentials ApiKeyCredentials The Credentials Setter for Custom Header Signature

The API client can be initialized as follows:

package main

import (
    "github.com/Splitit/go-sdk/v2"
    "github.com/Splitit/go-sdk/v2/models"
)

func main() {
    client := github.com/Splitit/go-sdk/v2.NewClient(
    github.com/Splitit/go-sdk/v2.CreateConfiguration(
            github.com/Splitit/go-sdk/v2.WithHttpConfiguration(
                github.com/Splitit/go-sdk/v2.CreateHttpConfiguration(
                    github.com/Splitit/go-sdk/v2.WithTimeout(0),
                ),
            ),
            github.com/Splitit/go-sdk/v2.WithEnvironment(github.com/Splitit/go-sdk/v2.SANDBOX),
            github.com/Splitit/go-sdk/v2.WithOAuth2Credentials(
                github.com/Splitit/go-sdk/v2.NewOAuth2Credentials(
                    "OAuthClientId",
                    "OAuthClientSecret",
                ).
                WithOAuthScopes([]models.OAuthScopeOAuth2Enum{
        models.OAuthScopeOAuth2Enum_APIV4,
    }),
            ),
            github.com/Splitit/go-sdk/v2.WithApiKeyCredentials(
                github.com/Splitit/go-sdk/v2.NewApiKeyCredentials("X-Splitit-Api-Key"),
            ),
        ),
    )
}

Environments

The SDK can be configured to use a different environment for making API calls. Available environments are:

Fields
Name Description
SANDBOX Default Sandbox Environment (Transactional API)
PRODUCTION Production Environment (Transactional API)

Authorization

This API uses the following authentication schemes.

List of APIs

SDK Infrastructure

Configuration
Utilities

Documentation

Overview

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

Index

Constants

View Source
const UserAgent = "APIMATIC 3.0"

Variables

View Source
var NewAndAuth = https.NewAndAuth

NewAndAuth creates a new AndAuth.

View Source
var NewAuth = https.NewAuth

NewAuth creates a new Auth.

View Source
var NewHttpConfiguration = https.NewHttpConfiguration

NewHttpConfiguration creates a new HttpConfiguration.

View Source
var NewOrAuth = https.NewOrAuth

NewOrAuth creates a new OrAuth.

View Source
var NewRetryConfiguration = https.NewRetryConfiguration

NewRetryConfiguration creates a new RetryConfiguration.

View Source
var WithBackoffFactor = https.WithBackoffFactor

WithBackoffFactor sets the BackoffFactor.

View Source
var WithHttpMethodsToRetry = https.WithHttpMethodsToRetry

WithHttpMethodsToRetry sets the HttpMethodsToRetry.

View Source
var WithHttpStatusCodesToRetry = https.WithHttpStatusCodesToRetry

WithHttpStatusCodesToRetry sets the HttpStatusCodesToRetry.

View Source
var WithMaxRetryAttempts = https.WithMaxRetryAttempts

WithMaxRetryAttempts sets the MaxRetryAttempts.

View Source
var WithMaximumRetryWaitTime = https.WithMaximumRetryWaitTime

WithMaximumRetryWaitTime sets the MaximumRetryWaitTime.

View Source
var WithRetryConfiguration = https.WithRetryConfiguration

WithRetryConfiguration sets the RetryConfiguration.

View Source
var WithRetryInterval = https.WithRetryInterval

WithRetryInterval sets the RetryInterval.

View Source
var WithRetryOnTimeout = https.WithRetryOnTimeout

WithRetryOnTimeout sets the RetryOnTimeout.

View Source
var WithTimeout = https.WithTimeout

WithTimeout sets the Timeout.

View Source
var WithTransport = https.WithTransport

WithTransport sets the Transport.

Functions

func NewBaseController

func NewBaseController(cb callBuilderFactory) *baseController

NewBaseController creates a new instance of baseController. It takes a callBuilderFactory as a parameter and returns a pointer to the baseController.

Types

type ApiKeyCredentials

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

ApiKeyCredentials represents the credentials required for `ApiKey` authentication.

func NewApiKeyCredentials

func NewApiKeyCredentials(xSplititApiKey string) ApiKeyCredentials

NewApiKeyCredentials creates a new instance of ApiKeyCredentials with provided parameters.

func (ApiKeyCredentials) Authenticator

func (a ApiKeyCredentials) Authenticator() https.HttpInterceptor

Authenticator function returns HttpInterceptor function that provides authentication for API calls.

func (ApiKeyCredentials) Validate

func (a ApiKeyCredentials) Validate() error

Validate function returns validation error associated with the ApiKeyCredentials.

func (ApiKeyCredentials) WithXSplititApiKey

func (a ApiKeyCredentials) WithXSplititApiKey(xSplititApiKey string) ApiKeyCredentials

WithXSplititApiKey sets xSplititApiKey in ApiKeyCredentials.

func (ApiKeyCredentials) XSplititApiKey

func (a ApiKeyCredentials) XSplititApiKey() string

XSplititApiKey returns the xSplititApiKey associated with the ApiKeyCredentials.

type ClientInterface

type ClientInterface interface {
	Configuration() Configuration
	CloneWithConfiguration(options ...ConfigurationOptions) ClientInterface
	InstallmentPlanController() *InstallmentPlanController
	OAuthAuthorizationController() *OAuthAuthorizationController
	OAuth2Manager() *OAuth2Manager
}

Client is an interface representing the main client for accessing configuration and controllers.

func NewClient

func NewClient(configuration Configuration) ClientInterface

NewClient is the constructor for creating a new client instance. It takes a Configuration object as a parameter and returns the Client interface.

type Configuration

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

Configuration holds configuration settings.

func CreateConfiguration

func CreateConfiguration(options ...ConfigurationOptions) Configuration

CreateConfiguration creates a new Configuration with the provided options.

func CreateConfigurationFromEnvironment

func CreateConfigurationFromEnvironment(options ...ConfigurationOptions) Configuration

CreateConfigurationFromEnvironment creates a new Configuration with default settings. It also configures various Configuration options.

func DefaultConfiguration

func DefaultConfiguration() Configuration

DefaultConfiguration returns the default Configuration.

func (Configuration) ApiKeyCredentials

func (c Configuration) ApiKeyCredentials() ApiKeyCredentials

ApiKeyCredentials returns the apiKeyCredentials from the Configuration.

func (Configuration) Environment

func (c Configuration) Environment() Environment

Environment returns the environment from the Configuration.

func (Configuration) HttpConfiguration

func (c Configuration) HttpConfiguration() HttpConfiguration

HttpConfiguration returns the httpConfiguration from the Configuration.

func (Configuration) OAuth2Credentials

func (c Configuration) OAuth2Credentials() OAuth2Credentials

OAuth2Credentials returns the oAuth2Credentials from the Configuration.

type ConfigurationOptions

type ConfigurationOptions func(*Configuration)

ConfigurationOptions represents a function type that can be used to apply options to the Configuration struct.

func WithApiKeyCredentials

func WithApiKeyCredentials(apiKeyCredentials ApiKeyCredentials) ConfigurationOptions

WithApiKeyCredentials is an option that sets the ApiKeyCredentials in the Configuration.

func WithEnvironment

func WithEnvironment(environment Environment) ConfigurationOptions

WithEnvironment is an option that sets the Environment in the Configuration.

func WithHttpConfiguration

func WithHttpConfiguration(httpConfiguration HttpConfiguration) ConfigurationOptions

WithHttpConfiguration is an option that sets the HttpConfiguration in the Configuration.

func WithOAuth2Credentials

func WithOAuth2Credentials(oAuth2Credentials OAuth2Credentials) ConfigurationOptions

WithOAuth2Credentials is an option that sets the OAuth2Credentials in the Configuration.

type Environment

type Environment string

Environment represents available environments.

const (
	SANDBOX    Environment = "Sandbox"
	PRODUCTION Environment = "Production"
)

type HttpConfiguration

type HttpConfiguration = https.HttpConfiguration

HttpConfiguration holds the configuration options for the client.

func CreateHttpConfiguration

func CreateHttpConfiguration(options ...HttpConfigurationOptions) HttpConfiguration

CreateHttpConfiguration creates a new HttpConfiguration with the provided options.

func DefaultHttpConfiguration

func DefaultHttpConfiguration() HttpConfiguration

DefaultHttpConfiguration returns the default HttpConfiguration for HTTP requests. It also configures various HttpConfiguration options.

type HttpConfigurationOptions

type HttpConfigurationOptions = https.HttpConfigurationOptions

HttpConfigurationOptions is a function type that modifies the HttpConfiguration.

type InstallmentPlanController

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

InstallmentPlanController represents a controller struct.

func NewInstallmentPlanController

func NewInstallmentPlanController(baseController baseController) *InstallmentPlanController

NewInstallmentPlanController creates a new instance of InstallmentPlanController. It takes a baseController as a parameter and returns a pointer to the InstallmentPlanController.

func (*InstallmentPlanController) InstallmentPlanAuthorize

func (i *InstallmentPlanController) InstallmentPlanAuthorize(
	ctx context.Context,
	installmentPlanNumber string,
	body models.AuthorizeRequest,
	xSplititTouchPoint *string,
	xSplititIdempotencyKey *string,
	xSplititRequestID *string) (
	models.ApiResponse[models.AuthorizeResponse],
	error)

InstallmentPlanAuthorize takes context, installmentPlanNumber, body, xSplititTouchPoint, xSplititIdempotencyKey, xSplititRequestID as parameters and returns an models.ApiResponse with models.AuthorizeResponse data and an error if there was an issue with the request or response.

func (*InstallmentPlanController) InstallmentPlanCheckCardValidity

func (i *InstallmentPlanController) InstallmentPlanCheckCardValidity(
	ctx context.Context,
	body models.CardValidityRequest,
	xSplititTouchPoint *string,
	xSplititIdempotencyKey *string,
	xSplititTouchPointHeader *string,
	xSplititRequestID *string) (
	models.ApiResponse[models.CardValidityResponse],
	error)

InstallmentPlanCheckCardValidity takes context, body, xSplititTouchPoint, xSplititIdempotencyKey, xSplititTouchPointHeader, xSplititRequestID as parameters and returns an models.ApiResponse with models.CardValidityResponse data and an error if there was an issue with the request or response.

func (*InstallmentPlanController) InstallmentPlanCreateOffers

func (i *InstallmentPlanController) InstallmentPlanCreateOffers(
	ctx context.Context,
	body models.OffersRequest,
	xSplititTouchPoint *string,
	xSplititIdempotencyKey *string,
	xSplititRequestID *string) (
	models.ApiResponse[models.OffersResponse],
	error)

InstallmentPlanCreateOffers takes context, body, xSplititTouchPoint, xSplititIdempotencyKey, xSplititRequestID as parameters and returns an models.ApiResponse with models.OffersResponse data and an error if there was an issue with the request or response.

func (i *InstallmentPlanController) InstallmentPlanGeneratePaymentLink(
	ctx context.Context,
	body models.PaymentLinkRequest,
	xSplititTouchPoint *string,
	xSplititIdempotencyKey *string,
	xSplititRequestID *string) (
	models.ApiResponse[models.PaymentLinkResponse],
	error)

InstallmentPlanGeneratePaymentLink takes context, body, xSplititTouchPoint, xSplititIdempotencyKey, xSplititRequestID as parameters and returns an models.ApiResponse with models.PaymentLinkResponse data and an error if there was an issue with the request or response.

func (*InstallmentPlanController) InstallmentPlanGetByInstallmentPlanNumber

func (i *InstallmentPlanController) InstallmentPlanGetByInstallmentPlanNumber(
	ctx context.Context,
	installmentPlanNumber string,
	xSplititTouchPoint *string,
	xSplititIdempotencyKey *string,
	xSplititRequestID *string) (
	models.ApiResponse[models.InstallmentPlanDetailsResponse],
	error)

InstallmentPlanGetByInstallmentPlanNumber takes context, installmentPlanNumber, xSplititTouchPoint, xSplititIdempotencyKey, xSplititRequestID as parameters and returns an models.ApiResponse with models.InstallmentPlanDetailsResponse data and an error if there was an issue with the request or response.

func (*InstallmentPlanController) InstallmentPlanRefund

func (i *InstallmentPlanController) InstallmentPlanRefund(
	ctx context.Context,
	installmentPlanNumber string,
	body models.RefundRequest,
	xSplititTouchPoint *string,
	xSplititIdempotencyKey *string,
	xSplititRequestID *string) (
	models.ApiResponse[models.RefundResponse],
	error)

InstallmentPlanRefund takes context, installmentPlanNumber, body, xSplititTouchPoint, xSplititIdempotencyKey, xSplititRequestID as parameters and returns an models.ApiResponse with models.RefundResponse data and an error if there was an issue with the request or response.

func (*InstallmentPlanController) InstallmentPlanSearch

func (i *InstallmentPlanController) InstallmentPlanSearch(
	ctx context.Context,
	body models.InstallmentPlanSearchRequest,
	xSplititTouchPoint *string,
	xSplititIdempotencyKey *string,
	xSplititRequestID *string) (
	models.ApiResponse[models.InstallmentPlanSearchDetailsResponse],
	error)

InstallmentPlanSearch takes context, body, xSplititTouchPoint, xSplititIdempotencyKey, xSplititRequestID as parameters and returns an models.ApiResponse with models.InstallmentPlanSearchDetailsResponse data and an error if there was an issue with the request or response.

func (*InstallmentPlanController) InstallmentPlanUpdateOffers

func (i *InstallmentPlanController) InstallmentPlanUpdateOffers(
	ctx context.Context,
	installmentPlanNumber string,
	body models.UpdateOffersRequest,
	xSplititTouchPoint *string,
	xSplititIdempotencyKey *string,
	xSplititRequestID *string) (
	models.ApiResponse[models.OffersResponse],
	error)

InstallmentPlanUpdateOffers takes context, installmentPlanNumber, body, xSplititTouchPoint, xSplititIdempotencyKey, xSplititRequestID as parameters and returns an models.ApiResponse with models.OffersResponse data and an error if there was an issue with the request or response.

func (*InstallmentPlanController) InstallmentPlanUpdateOrder

func (i *InstallmentPlanController) InstallmentPlanUpdateOrder(
	ctx context.Context,
	installmentPlanNumber string,
	body models.UpdateOrderRequest,
	xSplititTouchPoint *string,
	xSplititIdempotencyKey *string,
	xSplititRequestID *string) (
	models.ApiResponse[models.UpdateOrderResponse],
	error)

InstallmentPlanUpdateOrder takes context, installmentPlanNumber, body, xSplititTouchPoint, xSplititIdempotencyKey, xSplititRequestID as parameters and returns an models.ApiResponse with models.UpdateOrderResponse data and an error if there was an issue with the request or response.

type OAuth2Credentials

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

OAuth2Credentials represents the credentials required for `OAuth2` authentication.

func NewOAuth2Credentials

func NewOAuth2Credentials(
	oAuthClientId string,
	oAuthClientSecret string) OAuth2Credentials

NewOAuth2Credentials creates a new instance of OAuth2Credentials with provided parameters.

func (OAuth2Credentials) OAuthClientId

func (o OAuth2Credentials) OAuthClientId() string

OAuthClientId returns the oAuthClientId associated with the OAuth2Credentials.

func (OAuth2Credentials) OAuthClientSecret

func (o OAuth2Credentials) OAuthClientSecret() string

OAuthClientSecret returns the oAuthClientSecret associated with the OAuth2Credentials.

func (OAuth2Credentials) OAuthClockSkew

func (o OAuth2Credentials) OAuthClockSkew() int64

OAuthClockSkew returns the oAuthClockSkew associated with the OAuth2Credentials.

func (OAuth2Credentials) OAuthOnTokenUpdate

func (o OAuth2Credentials) OAuthOnTokenUpdate() func(token models.OAuthToken)

OAuthOnTokenUpdate returns the oAuthOnTokenUpdate associated with the OAuth2Credentials.

func (OAuth2Credentials) OAuthScopes

func (o OAuth2Credentials) OAuthScopes() []models.OAuthScopeOAuth2Enum

OAuthScopes returns the oAuthScopes associated with the OAuth2Credentials.

func (OAuth2Credentials) OAuthToken

func (o OAuth2Credentials) OAuthToken() models.OAuthToken

OAuthToken returns the oAuthToken associated with the OAuth2Credentials.

func (OAuth2Credentials) OAuthTokenProvider

func (o OAuth2Credentials) OAuthTokenProvider() func(models.OAuthToken, OAuth2Manager) models.OAuthToken

OAuthTokenProvider returns the oAuthTokenProvider associated with the OAuth2Credentials.

func (OAuth2Credentials) WithOAuthClientId

func (o OAuth2Credentials) WithOAuthClientId(oAuthClientId string) OAuth2Credentials

WithOAuthClientId sets oAuthClientId in OAuth2Credentials.

func (OAuth2Credentials) WithOAuthClientSecret

func (o OAuth2Credentials) WithOAuthClientSecret(oAuthClientSecret string) OAuth2Credentials

WithOAuthClientSecret sets oAuthClientSecret in OAuth2Credentials.

func (OAuth2Credentials) WithOAuthClockSkew

func (o OAuth2Credentials) WithOAuthClockSkew(oAuthClockSkew int64) OAuth2Credentials

WithOAuthClockSkew sets oAuthClockSkew in OAuth2Credentials.

func (OAuth2Credentials) WithOAuthOnTokenUpdate

func (o OAuth2Credentials) WithOAuthOnTokenUpdate(oAuthOnTokenUpdate func(token models.OAuthToken)) OAuth2Credentials

WithOAuthOnTokenUpdate sets oAuthOnTokenUpdate in OAuth2Credentials.

func (OAuth2Credentials) WithOAuthScopes

func (o OAuth2Credentials) WithOAuthScopes(oAuthScopes []models.OAuthScopeOAuth2Enum) OAuth2Credentials

WithOAuthScopes sets oAuthScopes in OAuth2Credentials.

func (OAuth2Credentials) WithOAuthToken

func (o OAuth2Credentials) WithOAuthToken(oAuthToken models.OAuthToken) OAuth2Credentials

WithOAuthToken sets oAuthToken in OAuth2Credentials.

func (OAuth2Credentials) WithOAuthTokenProvider

func (o OAuth2Credentials) WithOAuthTokenProvider(oAuthTokenProvider func(models.OAuthToken, OAuth2Manager) models.OAuthToken) OAuth2Credentials

WithOAuthTokenProvider sets oAuthTokenProvider in OAuth2Credentials.

type OAuth2Manager

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

OAuth2Manager is a manager responsible for handling authorization related operations.

func (*OAuth2Manager) Authenticator

func (o *OAuth2Manager) Authenticator() https.HttpInterceptor

Authenticator function returns HttpInterceptor function that provides authentication for API calls.

func (*OAuth2Manager) FetchToken

func (o *OAuth2Manager) FetchToken(ctx context.Context) (
	models.OAuthToken,
	error)

FetchToken fetches the token. It makes a request to the OAuthAuthorizationController to obtain the token and returns the token and any error occurred during the request.

func (*OAuth2Manager) OAuthTokenIsAuthorize

func (o *OAuth2Manager) OAuthTokenIsAuthorize() bool

OAuthTokenIsAuthorize checks the expiry of OAuth Token.

func (*OAuth2Manager) OAuthTokenIsExpired

func (o *OAuth2Manager) OAuthTokenIsExpired() bool

OAuthTokenIsExpired checks the expiry of OAuth Token.

func (*OAuth2Manager) Validate

func (o *OAuth2Manager) Validate() error

Validate function returns validation error associated with the OAuth2Manager.

type OAuthAuthorizationController

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

OAuthAuthorizationController represents a controller struct.

func NewOAuthAuthorizationController

func NewOAuthAuthorizationController(baseController baseController) *OAuthAuthorizationController

NewOAuthAuthorizationController creates a new instance of OAuthAuthorizationController. It takes a baseController as a parameter and returns a pointer to the OAuthAuthorizationController.

func (*OAuthAuthorizationController) RequestTokenOAuth2

func (o *OAuthAuthorizationController) RequestTokenOAuth2(
	ctx context.Context,
	authorization string,
	scope *string,
	formParams map[string]any) (
	models.ApiResponse[models.OAuthToken],
	error)

RequestTokenOAuth2 takes context, authorization, scope as parameters and returns an models.ApiResponse with models.OAuthToken data and an error if there was an issue with the request or response. Create a new OAuth 2 token.

type RetryConfiguration

type RetryConfiguration = https.RetryConfiguration

RetryConfiguration holds the configuration options for the client.

func CreateRetryConfiguration

func CreateRetryConfiguration(options ...RetryConfigurationOptions) RetryConfiguration

CreateRetryConfiguration creates a new RetryConfiguration with the provided options.

func DefaultRetryConfiguration

func DefaultRetryConfiguration() RetryConfiguration

DefaultRetryConfiguration returns the default RetryConfiguration for HTTP requests. It also configures various retry options.

type RetryConfigurationOptions

type RetryConfigurationOptions = https.RetryConfigurationOptions

RetryConfigurationOptions is a function type that modifies the RetryConfiguration.

type Server

type Server string

Server represents available servers.

const (
	ENUMDEFAULT       Server = "default"
	ACCESSTOKENSERVER Server = "access token server"
)

Directories

Path Synopsis
package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
package splititwebapiv4 This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

Jump to

Keyboard shortcuts

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