api

package module
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 8 Imported by: 0

README

Suward Go Library

fern shield

The Suward Go library provides convenient access to the Suward APIs from Go.

Table of Contents

Reference

A full reference for this library is available here.

Usage

Instantiate and use the client with the following:

package example

import (
    context "context"

    suwardsdkgo "github.com/crylabsorg/suward-sdk-go"
    client "github.com/crylabsorg/suward-sdk-go/client"
    option "github.com/crylabsorg/suward-sdk-go/option"
)

func do() {
    client := client.NewClient(
        option.WithAPIKey(
            "<value>",
        ),
    )
    request := &suwardsdkgo.CryptopayCreatePaymentRequest{
        Amount: "amount",
    }
    client.Payments.CreatePayment(
        context.TODO(),
        request,
    )
}

Environments

You can choose between different environments by using the option.WithBaseURL option. You can configure any arbitrary base URL, which is particularly useful in test environments.

client := client.NewClient(
    option.WithBaseURL(api.Environments.Default),
)

Errors

Structured error types are returned from API calls that return non-success status codes. These errors are compatible with the errors.Is and errors.As APIs, so you can access the error like so:

response, err := client.Payments.CreatePayment(...)
if err != nil {
    var apiError *core.APIError
    if errors.As(err, apiError) {
        // Do something with the API error ...
    }
    return err
}

Request Options

A variety of request options are included to adapt the behavior of the library, which includes configuring authorization tokens, or providing your own instrumented *http.Client.

These request options can either be specified on the client so that they're applied on every request, or for an individual request, like so:

Providing your own *http.Client is recommended. Otherwise, the http.DefaultClient will be used, and your client will wait indefinitely for a response (unless the per-request, context-based timeout is used).

// Specify default options applied on every request.
client := client.NewClient(
    option.WithToken("<YOUR_API_KEY>"),
    option.WithHTTPClient(
        &http.Client{
            Timeout: 5 * time.Second,
        },
    ),
)

// Specify options for an individual request.
response, err := client.Payments.CreatePayment(
    ...,
    option.WithToken("<YOUR_API_KEY>"),
)

Advanced

Response Headers

You can access the raw HTTP response data by using the WithRawResponse field on the client. This is useful when you need to examine the response headers received from the API call. (When the endpoint is paginated, the raw HTTP response data will be included automatically in the Page response object.)

response, err := client.Payments.WithRawResponse.CreatePayment(...)
if err != nil {
    return err
}
fmt.Printf("Got response headers: %v", response.Header)
fmt.Printf("Got status code: %d", response.StatusCode)
Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).

Which status codes are retried depends on the retryStatusCodes generator configuration:

legacy (current default): retries on

  • 408 (Timeout)
  • 429 (Too Many Requests)
  • 5XX (All server errors, including 500)

recommended: retries on

  • 408 (Timeout)
  • 429 (Too Many Requests)
  • 502 (Bad Gateway)
  • 503 (Service Unavailable)
  • 504 (Gateway Timeout)

If the Retry-After header is present in the response, the SDK will prioritize respecting its value exactly over the default exponential backoff.

Use the option.WithMaxAttempts option to configure this behavior for the entire client or an individual request:

client := client.NewClient(
    option.WithMaxAttempts(1),
)

response, err := client.Payments.CreatePayment(
    ...,
    option.WithMaxAttempts(1),
)
Timeouts

Setting a timeout for each individual request is as simple as using the standard context library. Setting a one second timeout for an individual API call looks like the following:

ctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()

response, err := client.Payments.CreatePayment(ctx, ...)
Explicit Null

If you want to send the explicit null JSON value through an optional parameter, you can use the setters
that come with every object. Calling a setter method for a property will flip a bit in the explicitFields bitfield for that setter's object; during serialization, any property with a flipped bit will have its omittable status stripped, so zero or nil values will be sent explicitly rather than omitted altogether:

type ExampleRequest struct {
    // An optional string parameter.
    Name *string `json:"name,omitempty" url:"-"`

    // Private bitmask of fields set to an explicit value and therefore not to be omitted
    explicitFields *big.Int `json:"-" url:"-"`
}

request := &ExampleRequest{}
request.SetName(nil)

response, err := client.Payments.CreatePayment(ctx, request, ...)

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Environments = struct {
	Default string
}{
	Default: "https://api.suward.com",
}

Environments defines all of the API environments. These values can be used with the WithBaseURL RequestOption to override the client's default environment, if any.

View Source
var ErrorCodes internal.ErrorCodes = internal.ErrorCodes{
	400: func(apiError *core.APIError) error {
		return &BadRequestError{
			APIError: apiError,
		}
	},
	401: func(apiError *core.APIError) error {
		return &UnauthorizedError{
			APIError: apiError,
		}
	},
	500: func(apiError *core.APIError) error {
		return &InternalServerError{
			APIError: apiError,
		}
	},
	404: func(apiError *core.APIError) error {
		return &NotFoundError{
			APIError: apiError,
		}
	},
}

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to the given bool value.

func Byte

func Byte(b byte) *byte

Byte returns a pointer to the given byte value.

func Bytes

func Bytes(b []byte) *[]byte

Bytes returns a pointer to the given []byte value.

func Complex64

func Complex64(c complex64) *complex64

Complex64 returns a pointer to the given complex64 value.

func Complex128

func Complex128(c complex128) *complex128

Complex128 returns a pointer to the given complex128 value.

func Float32

func Float32(f float32) *float32

Float32 returns a pointer to the given float32 value.

func Float64

func Float64(f float64) *float64

Float64 returns a pointer to the given float64 value.

func Int

func Int(i int) *int

Int returns a pointer to the given int value.

func Int8

func Int8(i int8) *int8

Int8 returns a pointer to the given int8 value.

func Int16

func Int16(i int16) *int16

Int16 returns a pointer to the given int16 value.

func Int32

func Int32(i int32) *int32

Int32 returns a pointer to the given int32 value.

func Int64

func Int64(i int64) *int64

Int64 returns a pointer to the given int64 value.

func MustParseDate

func MustParseDate(date string) time.Time

MustParseDate attempts to parse the given string as a date time.Time, and panics upon failure.

func MustParseDateTime

func MustParseDateTime(datetime string) time.Time

MustParseDateTime attempts to parse the given string as a datetime time.Time, and panics upon failure.

func Rune

func Rune(r rune) *rune

Rune returns a pointer to the given rune value.

func String

func String(s string) *string

String returns a pointer to the given string value.

func Time

func Time(t time.Time) *time.Time

Time returns a pointer to the given time.Time value.

func UUID

func UUID(u uuid.UUID) *uuid.UUID

UUID returns a pointer to the given uuid.UUID value.

func Uint

func Uint(u uint) *uint

Uint returns a pointer to the given uint value.

func Uint8

func Uint8(u uint8) *uint8

Uint8 returns a pointer to the given uint8 value.

func Uint16

func Uint16(u uint16) *uint16

Uint16 returns a pointer to the given uint16 value.

func Uint32

func Uint32(u uint32) *uint32

Uint32 returns a pointer to the given uint32 value.

func Uint64

func Uint64(u uint64) *uint64

Uint64 returns a pointer to the given uint64 value.

func Uintptr

func Uintptr(u uintptr) *uintptr

Uintptr returns a pointer to the given uintptr value.

Types

type BadRequestError

type BadRequestError struct {
	*core.APIError
	Body *ControllerErrorResponse
}

Bad Request

func (*BadRequestError) MarshalJSON

func (b *BadRequestError) MarshalJSON() ([]byte, error)

func (*BadRequestError) UnmarshalJSON

func (b *BadRequestError) UnmarshalJSON(data []byte) error

func (*BadRequestError) Unwrap

func (b *BadRequestError) Unwrap() error

type ControllerErrorResponse

type ControllerErrorResponse struct {
	// Optional list of values interpolated into the error message template (e.g. field names or limits). Order matches the placeholders in the message.
	Args []any `json:"args,omitempty" url:"args,omitempty"`
	// Stable numeric application error code identifying the error type. Use it for programmatic handling; it does not change across locales or message wording.
	ErrorCode int `json:"errorCode" url:"errorCode"`
	// Human-readable description of what went wrong. Intended for logging and debugging, not for programmatic branching (use errorCode for that).
	Message string `json:"message" url:"message"`
	// contains filtered or unexported fields
}

func (*ControllerErrorResponse) GetArgs

func (c *ControllerErrorResponse) GetArgs() []any

func (*ControllerErrorResponse) GetErrorCode

func (c *ControllerErrorResponse) GetErrorCode() int

func (*ControllerErrorResponse) GetExtraProperties

func (c *ControllerErrorResponse) GetExtraProperties() map[string]interface{}

func (*ControllerErrorResponse) GetMessage

func (c *ControllerErrorResponse) GetMessage() string

func (*ControllerErrorResponse) MarshalJSON

func (c *ControllerErrorResponse) MarshalJSON() ([]byte, error)

func (*ControllerErrorResponse) SetArgs

func (c *ControllerErrorResponse) SetArgs(args []any)

SetArgs sets the Args field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*ControllerErrorResponse) SetErrorCode

func (c *ControllerErrorResponse) SetErrorCode(errorCode int)

SetErrorCode sets the ErrorCode field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*ControllerErrorResponse) SetMessage

func (c *ControllerErrorResponse) SetMessage(message string)

SetMessage sets the Message field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*ControllerErrorResponse) String

func (c *ControllerErrorResponse) String() string

func (*ControllerErrorResponse) UnmarshalJSON

func (c *ControllerErrorResponse) UnmarshalJSON(data []byte) error

type CryptopayAssetGroupResponse added in v0.0.23

type CryptopayAssetGroupResponse struct {
	// Numeric asset-group id.
	ID int `json:"id" url:"id"`
	// Group symbol, e.g. USDT, USDC, ETH.
	Name string `json:"name" url:"name"`
	// contains filtered or unexported fields
}

func (*CryptopayAssetGroupResponse) GetExtraProperties added in v0.0.23

func (c *CryptopayAssetGroupResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayAssetGroupResponse) GetID added in v0.0.23

func (c *CryptopayAssetGroupResponse) GetID() int

func (*CryptopayAssetGroupResponse) GetName added in v0.0.23

func (c *CryptopayAssetGroupResponse) GetName() string

func (*CryptopayAssetGroupResponse) MarshalJSON added in v0.0.23

func (c *CryptopayAssetGroupResponse) MarshalJSON() ([]byte, error)

func (*CryptopayAssetGroupResponse) SetID added in v0.0.23

func (c *CryptopayAssetGroupResponse) SetID(id int)

SetID sets the ID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayAssetGroupResponse) SetName added in v0.0.23

func (c *CryptopayAssetGroupResponse) SetName(name string)

SetName sets the Name field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayAssetGroupResponse) String added in v0.0.23

func (c *CryptopayAssetGroupResponse) String() string

func (*CryptopayAssetGroupResponse) UnmarshalJSON added in v0.0.23

func (c *CryptopayAssetGroupResponse) UnmarshalJSON(data []byte) error

type CryptopayAssetID

type CryptopayAssetID string

Asset id-string (see GET /v1/assets), e.g. USDT_ETHEREUM.

const (
	CryptopayAssetIDUsdtEthereum           CryptopayAssetID = "USDT_ETHEREUM"
	CryptopayAssetIDUsdtArbitrum           CryptopayAssetID = "USDT_ARBITRUM"
	CryptopayAssetIDUsdtOptimism           CryptopayAssetID = "USDT_OPTIMISM"
	CryptopayAssetIDUsdtBase               CryptopayAssetID = "USDT_BASE"
	CryptopayAssetIDUsdtBsc                CryptopayAssetID = "USDT_BSC"
	CryptopayAssetIDUsdtPlasma             CryptopayAssetID = "USDT_PLASMA"
	CryptopayAssetIDUsdtPolygon            CryptopayAssetID = "USDT_POLYGON"
	CryptopayAssetIDUsdcEthereum           CryptopayAssetID = "USDC_ETHEREUM"
	CryptopayAssetIDUsdcArbitrum           CryptopayAssetID = "USDC_ARBITRUM"
	CryptopayAssetIDUsdCeArbitrum          CryptopayAssetID = "USDCE_ARBITRUM"
	CryptopayAssetIDUsdcOptimism           CryptopayAssetID = "USDC_OPTIMISM"
	CryptopayAssetIDUsdcBase               CryptopayAssetID = "USDC_BASE"
	CryptopayAssetIDUsdcBsc                CryptopayAssetID = "USDC_BSC"
	CryptopayAssetIDUsdcPlasma             CryptopayAssetID = "USDC_PLASMA"
	CryptopayAssetIDUsdcPolygon            CryptopayAssetID = "USDC_POLYGON"
	CryptopayAssetIDEthEthereum            CryptopayAssetID = "ETH_ETHEREUM"
	CryptopayAssetIDEthArbitrum            CryptopayAssetID = "ETH_ARBITRUM"
	CryptopayAssetIDEthOptimism            CryptopayAssetID = "ETH_OPTIMISM"
	CryptopayAssetIDEthBase                CryptopayAssetID = "ETH_BASE"
	CryptopayAssetIDXplPlasma              CryptopayAssetID = "XPL_PLASMA"
	CryptopayAssetIDBnbBsc                 CryptopayAssetID = "BNB_BSC"
	CryptopayAssetIDPolPolygon             CryptopayAssetID = "POL_POLYGON"
	CryptopayAssetIDTestcoinEthereum       CryptopayAssetID = "TESTCOIN_ETHEREUM"
	CryptopayAssetIDTestcoinOptimism       CryptopayAssetID = "TESTCOIN_OPTIMISM"
	CryptopayAssetIDTestcoinPlasma         CryptopayAssetID = "TESTCOIN_PLASMA"
	CryptopayAssetIDTeststablecoinEthereum CryptopayAssetID = "TESTSTABLECOIN_ETHEREUM"
	CryptopayAssetIDTeststablecoinOptimism CryptopayAssetID = "TESTSTABLECOIN_OPTIMISM"
	CryptopayAssetIDTeststablecoinPlasma   CryptopayAssetID = "TESTSTABLECOIN_PLASMA"
)

func NewCryptopayAssetIDFromString

func NewCryptopayAssetIDFromString(s string) (CryptopayAssetID, error)

func (CryptopayAssetID) Ptr

type CryptopayAssetResponse added in v0.0.23

type CryptopayAssetResponse struct {
	// Asset id-string used everywhere else in the API, e.g. USDT_ARBITRUM.
	ID CryptopayAssetID `json:"id" url:"id"`
	// Internal blockchain ID (corresponds to GET /v1/blockchains[].id).
	BlockchainID int `json:"blockchainId" url:"blockchainId"`
	// ERC20 contract address; null for native coins (ETH, BNB, POL, XPL).
	ContractAddress *string `json:"contractAddress,omitempty" url:"contractAddress,omitempty"`
	// Number of decimal places: smallest-unit amounts are whole tokens * 10^decimals.
	Decimals int `json:"decimals" url:"decimals"`
	// Asset group, e.g. USDT, USDC, ETH.
	Group string `json:"group" url:"group"`
	// Human-readable asset name.
	Name string `json:"name" url:"name"`
	// contains filtered or unexported fields
}

func (*CryptopayAssetResponse) GetBlockchainID added in v0.0.23

func (c *CryptopayAssetResponse) GetBlockchainID() int

func (*CryptopayAssetResponse) GetContractAddress added in v0.0.23

func (c *CryptopayAssetResponse) GetContractAddress() *string

func (*CryptopayAssetResponse) GetDecimals added in v0.0.23

func (c *CryptopayAssetResponse) GetDecimals() int

func (*CryptopayAssetResponse) GetExtraProperties added in v0.0.23

func (c *CryptopayAssetResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayAssetResponse) GetGroup added in v0.0.23

func (c *CryptopayAssetResponse) GetGroup() string

func (*CryptopayAssetResponse) GetID added in v0.0.23

func (*CryptopayAssetResponse) GetName added in v0.0.23

func (c *CryptopayAssetResponse) GetName() string

func (*CryptopayAssetResponse) MarshalJSON added in v0.0.23

func (c *CryptopayAssetResponse) MarshalJSON() ([]byte, error)

func (*CryptopayAssetResponse) SetBlockchainID added in v0.0.23

func (c *CryptopayAssetResponse) SetBlockchainID(blockchainID int)

SetBlockchainID sets the BlockchainID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayAssetResponse) SetContractAddress added in v0.0.23

func (c *CryptopayAssetResponse) SetContractAddress(contractAddress *string)

SetContractAddress sets the ContractAddress field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayAssetResponse) SetDecimals added in v0.0.23

func (c *CryptopayAssetResponse) SetDecimals(decimals int)

SetDecimals sets the Decimals field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayAssetResponse) SetGroup added in v0.0.23

func (c *CryptopayAssetResponse) SetGroup(group string)

SetGroup sets the Group field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayAssetResponse) SetID added in v0.0.23

SetID sets the ID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayAssetResponse) SetName added in v0.0.23

func (c *CryptopayAssetResponse) SetName(name string)

SetName sets the Name field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayAssetResponse) String added in v0.0.23

func (c *CryptopayAssetResponse) String() string

func (*CryptopayAssetResponse) UnmarshalJSON added in v0.0.23

func (c *CryptopayAssetResponse) UnmarshalJSON(data []byte) error

type CryptopayBlockchainResponse added in v0.0.23

type CryptopayBlockchainResponse struct {
	// Internal blockchain ID.
	ID int `json:"id" url:"id"`
	// Network id-string, e.g. ETHEREUM, ARBITRUM (the suffix of an asset id-string).
	IDString string `json:"idString" url:"idString"`
	// EIP-155 chain ID; null for non-EVM chains.
	EvmChainID *int `json:"evmChainId,omitempty" url:"evmChainId,omitempty"`
	// Human-readable chain name.
	ChainName string `json:"chainName" url:"chainName"`
	// Block confirmations required for a payment to reach finality.
	RequiredConfirmations int `json:"requiredConfirmations" url:"requiredConfirmations"`
	// Flat network-fee estimate in USD (decimal string).
	NetworkFeeUsd string `json:"networkFeeUsd" url:"networkFeeUsd"`
	// contains filtered or unexported fields
}

func (*CryptopayBlockchainResponse) GetChainName added in v0.0.23

func (c *CryptopayBlockchainResponse) GetChainName() string

func (*CryptopayBlockchainResponse) GetEvmChainID added in v0.0.23

func (c *CryptopayBlockchainResponse) GetEvmChainID() *int

func (*CryptopayBlockchainResponse) GetExtraProperties added in v0.0.23

func (c *CryptopayBlockchainResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayBlockchainResponse) GetID added in v0.0.23

func (c *CryptopayBlockchainResponse) GetID() int

func (*CryptopayBlockchainResponse) GetIDString added in v0.0.23

func (c *CryptopayBlockchainResponse) GetIDString() string

func (*CryptopayBlockchainResponse) GetNetworkFeeUsd added in v0.0.23

func (c *CryptopayBlockchainResponse) GetNetworkFeeUsd() string

func (*CryptopayBlockchainResponse) GetRequiredConfirmations added in v0.0.23

func (c *CryptopayBlockchainResponse) GetRequiredConfirmations() int

func (*CryptopayBlockchainResponse) MarshalJSON added in v0.0.23

func (c *CryptopayBlockchainResponse) MarshalJSON() ([]byte, error)

func (*CryptopayBlockchainResponse) SetChainName added in v0.0.23

func (c *CryptopayBlockchainResponse) SetChainName(chainName string)

SetChainName sets the ChainName field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayBlockchainResponse) SetEvmChainID added in v0.0.23

func (c *CryptopayBlockchainResponse) SetEvmChainID(evmChainID *int)

SetEvmChainID sets the EvmChainID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayBlockchainResponse) SetID added in v0.0.23

func (c *CryptopayBlockchainResponse) SetID(id int)

SetID sets the ID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayBlockchainResponse) SetIDString added in v0.0.23

func (c *CryptopayBlockchainResponse) SetIDString(idString string)

SetIDString sets the IDString field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayBlockchainResponse) SetNetworkFeeUsd added in v0.0.23

func (c *CryptopayBlockchainResponse) SetNetworkFeeUsd(networkFeeUsd string)

SetNetworkFeeUsd sets the NetworkFeeUsd field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayBlockchainResponse) SetRequiredConfirmations added in v0.0.23

func (c *CryptopayBlockchainResponse) SetRequiredConfirmations(requiredConfirmations int)

SetRequiredConfirmations sets the RequiredConfirmations field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayBlockchainResponse) String added in v0.0.23

func (c *CryptopayBlockchainResponse) String() string

func (*CryptopayBlockchainResponse) UnmarshalJSON added in v0.0.23

func (c *CryptopayBlockchainResponse) UnmarshalJSON(data []byte) error

type CryptopayComplianceLevel added in v0.0.23

type CryptopayComplianceLevel string

AML screening depth for a payment. extended (default) runs paid providers and carries the $0.45 minimum service fee; basic runs only free checks and waives the minimum fee (0.4% only).

const (
	CryptopayComplianceLevelBasic    CryptopayComplianceLevel = "basic"
	CryptopayComplianceLevelExtended CryptopayComplianceLevel = "extended"
)

func NewCryptopayComplianceLevelFromString added in v0.0.23

func NewCryptopayComplianceLevelFromString(s string) (CryptopayComplianceLevel, error)

func (CryptopayComplianceLevel) Ptr added in v0.0.23

type CryptopayCreatePaymentRequest

type CryptopayCreatePaymentRequest struct {
	// Grace period in seconds before the payment window starts counting, giving the customer time to open the checkout before the timer runs. Optional; range 1 to 3600 (1 hour).
	ActivationFlowSeconds *int `json:"activationFlowSeconds,omitempty" url:"-"`
	// Merchant base amount, integer string in the asset's smallest unit. When a fee payer is customer the customer is charged more than this (gross); when merchant (default) the fee is deducted from the merchant's proceeds.
	Amount string `json:"amount" url:"-"`
	// Asset the customer will pay in, as an asset id-string (e.g. USDT_ARBITRUM). Required only when the project allows more than one asset; when the project has a single asset it may be omitted. The full set of accepted values is served live at GET /v1/assets.
	Asset *CryptopayAssetID `json:"asset,omitempty" url:"-"`
	// Who bears the network (gas) fee. Default merchant.
	NetworkFeePayer *CryptopayFeePayer `json:"networkFeePayer,omitempty" url:"-"`
	// Who bears the platform (service) fee. Default merchant.
	ServiceFeePayer *CryptopayFeePayer `json:"serviceFeePayer,omitempty" url:"-"`
	// AML screening depth: basic (free, no minimum fee) or extended ($0.45 minimum fee). Omit to inherit the project/org default (extended).
	ComplianceLevel *CryptopayComplianceLevel `json:"complianceLevel,omitempty" url:"-"`
	// Your own identifier for this payment. Echoed back on the payment and its webhooks, and can be appended to the return URL as a redirect parameter. Optional.
	ExternalID *string `json:"externalId,omitempty" url:"-"`
	// Arbitrary JSON key/value data to attach to the payment. Stored and echoed back unchanged on the payment and its webhooks; never sent on-chain. Use it to correlate the payment with your own records.
	Metadata map[string]any `json:"metadata,omitempty" url:"-"`
	// How long the payment stays open for funding, in seconds. Optional; when omitted the project default applies. Range 300 (5 minutes) to 86400 (24 hours).
	PaymentWindowSeconds *int `json:"paymentWindowSeconds,omitempty" url:"-"`
	// Optional "return to store" redirect configuration: the base URL the customer is sent back to after paying, plus which payment identifiers to append as query parameters.
	RedirectConfig *CryptopayRedirectConfigDto `json:"redirectConfig,omitempty" url:"-"`
	// Amount the customer may underpay and still have the payment accepted, as an integer string in the asset's smallest unit (same scale as amount). Optional; if set it must be >= 0 and strictly less than amount. Default 0 (exact amount required). Example: for amount "10000000" (10 USDT) a value of "500000" allows a 0.50 USDT shortfall.
	UnderpaymentTolerance *string `json:"underpaymentTolerance,omitempty" url:"-"`
	// Webhook URL to receive this payment's events. Optional; overrides the project's default webhook URL for this payment only.
	WebhookURL *string `json:"webhookUrl,omitempty" url:"-"`
	// contains filtered or unexported fields
}

func (*CryptopayCreatePaymentRequest) MarshalJSON

func (c *CryptopayCreatePaymentRequest) MarshalJSON() ([]byte, error)

func (*CryptopayCreatePaymentRequest) SetActivationFlowSeconds

func (c *CryptopayCreatePaymentRequest) SetActivationFlowSeconds(activationFlowSeconds *int)

SetActivationFlowSeconds sets the ActivationFlowSeconds field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetAmount

func (c *CryptopayCreatePaymentRequest) SetAmount(amount string)

SetAmount sets the Amount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetAsset

func (c *CryptopayCreatePaymentRequest) SetAsset(asset *CryptopayAssetID)

SetAsset sets the Asset field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetComplianceLevel added in v0.0.23

func (c *CryptopayCreatePaymentRequest) SetComplianceLevel(complianceLevel *CryptopayComplianceLevel)

SetComplianceLevel sets the ComplianceLevel field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetExternalID

func (c *CryptopayCreatePaymentRequest) SetExternalID(externalID *string)

SetExternalID sets the ExternalID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetMetadata

func (c *CryptopayCreatePaymentRequest) SetMetadata(metadata map[string]any)

SetMetadata sets the Metadata field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetNetworkFeePayer added in v0.0.23

func (c *CryptopayCreatePaymentRequest) SetNetworkFeePayer(networkFeePayer *CryptopayFeePayer)

SetNetworkFeePayer sets the NetworkFeePayer field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetPaymentWindowSeconds

func (c *CryptopayCreatePaymentRequest) SetPaymentWindowSeconds(paymentWindowSeconds *int)

SetPaymentWindowSeconds sets the PaymentWindowSeconds field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetRedirectConfig

func (c *CryptopayCreatePaymentRequest) SetRedirectConfig(redirectConfig *CryptopayRedirectConfigDto)

SetRedirectConfig sets the RedirectConfig field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetServiceFeePayer added in v0.0.23

func (c *CryptopayCreatePaymentRequest) SetServiceFeePayer(serviceFeePayer *CryptopayFeePayer)

SetServiceFeePayer sets the ServiceFeePayer field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetUnderpaymentTolerance

func (c *CryptopayCreatePaymentRequest) SetUnderpaymentTolerance(underpaymentTolerance *string)

SetUnderpaymentTolerance sets the UnderpaymentTolerance field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) SetWebhookURL

func (c *CryptopayCreatePaymentRequest) SetWebhookURL(webhookURL *string)

SetWebhookURL sets the WebhookURL field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreatePaymentRequest) UnmarshalJSON

func (c *CryptopayCreatePaymentRequest) UnmarshalJSON(data []byte) error

type CryptopayCreateStaticWalletRequest

type CryptopayCreateStaticWalletRequest struct {
	// Accepted-asset allow-list, as asset id-strings (see GET /v1/assets), e.g. ["USDT_ARBITRUM"]. Deposits of assets not on this list are ignored (status "ignored") and not credited.
	AllowedAssets []CryptopayAssetID `json:"allowedAssets,omitempty" url:"-"`
	// Your own identifier for this static wallet. Echoed back on the wallet and denormalized onto each of its deposits. Optional.
	ExternalID *string `json:"externalId,omitempty" url:"-"`
	// Arbitrary JSON key/value data to attach to the static wallet. Stored and echoed back unchanged.
	Metadata map[string]any `json:"metadata,omitempty" url:"-"`
	// Webhook URL to receive this wallet's deposit events. Optional; falls back to the project default webhook when omitted.
	WebhookURL *string `json:"webhookUrl,omitempty" url:"-"`
	// contains filtered or unexported fields
}

func (*CryptopayCreateStaticWalletRequest) MarshalJSON

func (c *CryptopayCreateStaticWalletRequest) MarshalJSON() ([]byte, error)

func (*CryptopayCreateStaticWalletRequest) SetAllowedAssets

func (c *CryptopayCreateStaticWalletRequest) SetAllowedAssets(allowedAssets []CryptopayAssetID)

SetAllowedAssets sets the AllowedAssets field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreateStaticWalletRequest) SetExternalID

func (c *CryptopayCreateStaticWalletRequest) SetExternalID(externalID *string)

SetExternalID sets the ExternalID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreateStaticWalletRequest) SetMetadata

func (c *CryptopayCreateStaticWalletRequest) SetMetadata(metadata map[string]any)

SetMetadata sets the Metadata field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreateStaticWalletRequest) SetWebhookURL

func (c *CryptopayCreateStaticWalletRequest) SetWebhookURL(webhookURL *string)

SetWebhookURL sets the WebhookURL field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayCreateStaticWalletRequest) UnmarshalJSON

func (c *CryptopayCreateStaticWalletRequest) UnmarshalJSON(data []byte) error

type CryptopayFeePayer added in v0.0.23

type CryptopayFeePayer string

Who bears a fee: merchant = deducted from the merchant's proceeds (default); customer = added on top of the customer charge.

const (
	CryptopayFeePayerMerchant CryptopayFeePayer = "merchant"
	CryptopayFeePayerCustomer CryptopayFeePayer = "customer"
)

func NewCryptopayFeePayerFromString added in v0.0.23

func NewCryptopayFeePayerFromString(s string) (CryptopayFeePayer, error)

func (CryptopayFeePayer) Ptr added in v0.0.23

type CryptopayListPaymentsResponse

type CryptopayListPaymentsResponse struct {
	// True when more payments exist beyond this page. To fetch the next page, pass the last item's id as the lastId query parameter.
	HasMore bool `json:"hasMore" url:"hasMore"`
	// Page of payments, ordered per the request's order parameter.
	Items []*CryptopayPaymentResponse `json:"items" url:"items"`
	// contains filtered or unexported fields
}

func (*CryptopayListPaymentsResponse) GetExtraProperties

func (c *CryptopayListPaymentsResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayListPaymentsResponse) GetHasMore

func (c *CryptopayListPaymentsResponse) GetHasMore() bool

func (*CryptopayListPaymentsResponse) GetItems

func (*CryptopayListPaymentsResponse) MarshalJSON

func (c *CryptopayListPaymentsResponse) MarshalJSON() ([]byte, error)

func (*CryptopayListPaymentsResponse) SetHasMore

func (c *CryptopayListPaymentsResponse) SetHasMore(hasMore bool)

SetHasMore sets the HasMore field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayListPaymentsResponse) SetItems

SetItems sets the Items field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayListPaymentsResponse) String

func (*CryptopayListPaymentsResponse) UnmarshalJSON

func (c *CryptopayListPaymentsResponse) UnmarshalJSON(data []byte) error

type CryptopayListStaticDepositsResponse

type CryptopayListStaticDepositsResponse struct {
	// True when more deposits exist beyond this page. To fetch the next page, pass the last item's id as the lastId query parameter.
	HasMore bool `json:"hasMore" url:"hasMore"`
	// Page of static-wallet deposits, ordered per the request's order parameter.
	Items []*CryptopayStaticDepositResponse `json:"items" url:"items"`
	// contains filtered or unexported fields
}

func (*CryptopayListStaticDepositsResponse) GetExtraProperties

func (c *CryptopayListStaticDepositsResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayListStaticDepositsResponse) GetHasMore

func (c *CryptopayListStaticDepositsResponse) GetHasMore() bool

func (*CryptopayListStaticDepositsResponse) GetItems

func (*CryptopayListStaticDepositsResponse) MarshalJSON

func (c *CryptopayListStaticDepositsResponse) MarshalJSON() ([]byte, error)

func (*CryptopayListStaticDepositsResponse) SetHasMore

func (c *CryptopayListStaticDepositsResponse) SetHasMore(hasMore bool)

SetHasMore sets the HasMore field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayListStaticDepositsResponse) SetItems

SetItems sets the Items field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayListStaticDepositsResponse) String

func (*CryptopayListStaticDepositsResponse) UnmarshalJSON

func (c *CryptopayListStaticDepositsResponse) UnmarshalJSON(data []byte) error

type CryptopayListStaticWalletsResponse

type CryptopayListStaticWalletsResponse struct {
	// True when more static wallets exist beyond this page. To fetch the next page, pass the last item's id as the lastId query parameter.
	HasMore bool `json:"hasMore" url:"hasMore"`
	// Page of static wallets, ordered per the request's order parameter.
	Items []*CryptopayStaticWalletResponse `json:"items" url:"items"`
	// contains filtered or unexported fields
}

func (*CryptopayListStaticWalletsResponse) GetExtraProperties

func (c *CryptopayListStaticWalletsResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayListStaticWalletsResponse) GetHasMore

func (c *CryptopayListStaticWalletsResponse) GetHasMore() bool

func (*CryptopayListStaticWalletsResponse) GetItems

func (*CryptopayListStaticWalletsResponse) MarshalJSON

func (c *CryptopayListStaticWalletsResponse) MarshalJSON() ([]byte, error)

func (*CryptopayListStaticWalletsResponse) SetHasMore

func (c *CryptopayListStaticWalletsResponse) SetHasMore(hasMore bool)

SetHasMore sets the HasMore field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayListStaticWalletsResponse) SetItems

SetItems sets the Items field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayListStaticWalletsResponse) String

func (*CryptopayListStaticWalletsResponse) UnmarshalJSON

func (c *CryptopayListStaticWalletsResponse) UnmarshalJSON(data []byte) error

type CryptopayPaymentResponse

type CryptopayPaymentResponse struct {
	// Unix-milliseconds timestamp when the payment reached the accepted state (safe confirmations, balance credited). Null before acceptance.
	AcceptedAt *int `json:"acceptedAt,omitempty" url:"acceptedAt,omitempty"`
	// Unix-milliseconds timestamp when the payment was activated and its payment window began counting. Null before activation.
	ActivatedAt *int `json:"activatedAt,omitempty" url:"activatedAt,omitempty"`
	// Resolved activation grace period, in seconds. Null when not configured.
	ActivationFlowSeconds *int `json:"activationFlowSeconds,omitempty" url:"activationFlowSeconds,omitempty"`
	// On-chain deposit address the customer must send funds to. Null until the payment is activated and an address is assigned.
	Address *string `json:"address,omitempty" url:"address,omitempty"`
	// Integer string in the asset's smallest unit.
	Amount string `json:"amount" url:"amount"`
	// Integer string in the asset's smallest unit.
	AmountConfirmed string `json:"amountConfirmed" url:"amountConfirmed"`
	// Integer string in the asset's smallest unit.
	AmountReceived string `json:"amountReceived" url:"amountReceived"`
	// Asset the payment is denominated in, as an asset id-string (see GET /v1/assets). Null until an asset is selected for the payment.
	Asset *CryptopayAssetID `json:"asset,omitempty" url:"asset,omitempty"`
	// Unix-milliseconds timestamp when the payment reached finalization (confirmed). Null until confirmed; may revert if a chain reorg undoes the confirmation.
	ConfirmedAt *int `json:"confirmedAt,omitempty" url:"confirmedAt,omitempty"`
	// Unix-milliseconds timestamp when the payment was created.
	CreatedAt int `json:"createdAt" url:"createdAt"`
	// Unix-milliseconds timestamp when the payment window closes; the payment expires (fails) if it has not been paid by then.
	ExpiresAt int `json:"expiresAt" url:"expiresAt"`
	// Merchant's own identifier for this payment, echoed from creation. Null when none was provided.
	ExternalID *string `json:"externalId,omitempty" url:"externalId,omitempty"`
	// AML screening depth applied to this payment: basic (free, no fee floor) or extended ($0.45 floor).
	ComplianceLevel *CryptopayComplianceLevel `json:"complianceLevel,omitempty" url:"complianceLevel,omitempty"`
	// Platform fee, integer string in the asset's smallest unit. For extended compliance: max(0.4% of the amount, $0.45 equivalent); for basic: 0.4% with no floor.
	Fee string `json:"fee" url:"fee"`
	// Unique Suward identifier of the payment. Use it in the payment endpoints (get, cancel, transactions) and as the checkout page path.
	ID string `json:"id" url:"id"`
	// Arbitrary key/value data attached by the merchant at creation, echoed back unchanged.
	Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"`
	// Estimated on-chain (gas) cost, deducted from the received amount. Integer string in the asset's smallest unit.
	NetworkFee string `json:"networkFee" url:"networkFee"`
	// The service-fee rate applied to this payment, in basis points (e.g. 40 = 0.4%).
	ServiceFeeBps int `json:"serviceFeeBps" url:"serviceFeeBps"`
	// The minimum service-fee floor applied to this payment, as a USD decimal string (e.g. "0.45" for extended, "0" for basic).
	ServiceFeeMinUsd string `json:"serviceFeeMinUsd" url:"serviceFeeMinUsd"`
	// USD price of the asset locked at creation, decimal string. Fees are computed from this price at settlement, so the merchant's net is deterministic.
	QuotedPrice string `json:"quotedPrice" url:"quotedPrice"`
	// Who bears the network (gas) fee, echoed from creation.
	NetworkFeePayer CryptopayFeePayer `json:"networkFeePayer" url:"networkFeePayer"`
	// Who bears the platform (service) fee, echoed from creation.
	ServiceFeePayer CryptopayFeePayer `json:"serviceFeePayer" url:"serviceFeePayer"`
	// Resolved length of the payment window, in seconds.
	PaymentWindowSeconds int `json:"paymentWindowSeconds" url:"paymentWindowSeconds"`
	// Identifier of the project that owns this payment.
	ProjectID string `json:"projectId" url:"projectId"`
	// Return-to-store redirect configuration echoed from creation. Null when none was configured.
	RedirectConfig *CryptopayRedirectConfigDto `json:"redirectConfig,omitempty" url:"redirectConfig,omitempty"`
	// Main payment lifecycle status. See the status enum for the full meaning of each value.
	Status CryptopayPaymentStatusEnum `json:"status" url:"status"`
	// Fine-grained payment sub-status describing the current step or amount condition. See the sub-status enum for the full meaning of each value.
	SubStatus CryptopayPaymentSubStatusEnum `json:"subStatus" url:"subStatus"`
	// Preview page of the on-chain transactions detected for this payment (newest first). Use GET /v1/payments/{paymentId}/transactions for the full paginated list.
	Transactions *CryptopaywireTransactionList `json:"transactions" url:"transactions"`
	// Integer string in the asset's smallest unit.
	UnderpaymentTolerance *string `json:"underpaymentTolerance,omitempty" url:"underpaymentTolerance,omitempty"`
	// Unix-milliseconds timestamp when the payment was last updated.
	UpdatedAt int `json:"updatedAt" url:"updatedAt"`
	// Webhook URL that receives this payment's events, echoed from creation. Null when the project default webhook is used.
	WebhookURL *string `json:"webhookUrl,omitempty" url:"webhookUrl,omitempty"`
	// Absolute URL of the Suward-hosted checkout page where the customer pays this payment.
	PaymentPageURL string `json:"paymentPageUrl" url:"paymentPageUrl"`
	// contains filtered or unexported fields
}

func (*CryptopayPaymentResponse) GetAcceptedAt

func (c *CryptopayPaymentResponse) GetAcceptedAt() *int

func (*CryptopayPaymentResponse) GetActivatedAt

func (c *CryptopayPaymentResponse) GetActivatedAt() *int

func (*CryptopayPaymentResponse) GetActivationFlowSeconds

func (c *CryptopayPaymentResponse) GetActivationFlowSeconds() *int

func (*CryptopayPaymentResponse) GetAddress

func (c *CryptopayPaymentResponse) GetAddress() *string

func (*CryptopayPaymentResponse) GetAmount

func (c *CryptopayPaymentResponse) GetAmount() string

func (*CryptopayPaymentResponse) GetAmountConfirmed

func (c *CryptopayPaymentResponse) GetAmountConfirmed() string

func (*CryptopayPaymentResponse) GetAmountReceived

func (c *CryptopayPaymentResponse) GetAmountReceived() string

func (*CryptopayPaymentResponse) GetAsset

func (*CryptopayPaymentResponse) GetComplianceLevel added in v0.0.23

func (c *CryptopayPaymentResponse) GetComplianceLevel() *CryptopayComplianceLevel

func (*CryptopayPaymentResponse) GetConfirmedAt added in v0.0.23

func (c *CryptopayPaymentResponse) GetConfirmedAt() *int

func (*CryptopayPaymentResponse) GetCreatedAt

func (c *CryptopayPaymentResponse) GetCreatedAt() int

func (*CryptopayPaymentResponse) GetExpiresAt

func (c *CryptopayPaymentResponse) GetExpiresAt() int

func (*CryptopayPaymentResponse) GetExternalID

func (c *CryptopayPaymentResponse) GetExternalID() *string

func (*CryptopayPaymentResponse) GetExtraProperties

func (c *CryptopayPaymentResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayPaymentResponse) GetFee

func (c *CryptopayPaymentResponse) GetFee() string

func (*CryptopayPaymentResponse) GetID

func (c *CryptopayPaymentResponse) GetID() string

func (*CryptopayPaymentResponse) GetMetadata

func (c *CryptopayPaymentResponse) GetMetadata() map[string]any

func (*CryptopayPaymentResponse) GetNetworkFee

func (c *CryptopayPaymentResponse) GetNetworkFee() string

func (*CryptopayPaymentResponse) GetNetworkFeePayer added in v0.0.23

func (c *CryptopayPaymentResponse) GetNetworkFeePayer() CryptopayFeePayer

func (*CryptopayPaymentResponse) GetPaymentPageURL added in v0.0.23

func (c *CryptopayPaymentResponse) GetPaymentPageURL() string

func (*CryptopayPaymentResponse) GetPaymentWindowSeconds

func (c *CryptopayPaymentResponse) GetPaymentWindowSeconds() int

func (*CryptopayPaymentResponse) GetProjectID

func (c *CryptopayPaymentResponse) GetProjectID() string

func (*CryptopayPaymentResponse) GetQuotedPrice added in v0.0.23

func (c *CryptopayPaymentResponse) GetQuotedPrice() string

func (*CryptopayPaymentResponse) GetRedirectConfig

func (c *CryptopayPaymentResponse) GetRedirectConfig() *CryptopayRedirectConfigDto

func (*CryptopayPaymentResponse) GetServiceFeeBps added in v0.0.23

func (c *CryptopayPaymentResponse) GetServiceFeeBps() int

func (*CryptopayPaymentResponse) GetServiceFeeMinUsd added in v0.0.23

func (c *CryptopayPaymentResponse) GetServiceFeeMinUsd() string

func (*CryptopayPaymentResponse) GetServiceFeePayer added in v0.0.23

func (c *CryptopayPaymentResponse) GetServiceFeePayer() CryptopayFeePayer

func (*CryptopayPaymentResponse) GetStatus

func (*CryptopayPaymentResponse) GetSubStatus

func (*CryptopayPaymentResponse) GetTransactions

func (*CryptopayPaymentResponse) GetUnderpaymentTolerance

func (c *CryptopayPaymentResponse) GetUnderpaymentTolerance() *string

func (*CryptopayPaymentResponse) GetUpdatedAt

func (c *CryptopayPaymentResponse) GetUpdatedAt() int

func (*CryptopayPaymentResponse) GetWebhookURL

func (c *CryptopayPaymentResponse) GetWebhookURL() *string

func (*CryptopayPaymentResponse) MarshalJSON

func (c *CryptopayPaymentResponse) MarshalJSON() ([]byte, error)

func (*CryptopayPaymentResponse) SetAcceptedAt

func (c *CryptopayPaymentResponse) SetAcceptedAt(acceptedAt *int)

SetAcceptedAt sets the AcceptedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetActivatedAt

func (c *CryptopayPaymentResponse) SetActivatedAt(activatedAt *int)

SetActivatedAt sets the ActivatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetActivationFlowSeconds

func (c *CryptopayPaymentResponse) SetActivationFlowSeconds(activationFlowSeconds *int)

SetActivationFlowSeconds sets the ActivationFlowSeconds field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetAddress

func (c *CryptopayPaymentResponse) SetAddress(address *string)

SetAddress sets the Address field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetAmount

func (c *CryptopayPaymentResponse) SetAmount(amount string)

SetAmount sets the Amount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetAmountConfirmed

func (c *CryptopayPaymentResponse) SetAmountConfirmed(amountConfirmed string)

SetAmountConfirmed sets the AmountConfirmed field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetAmountReceived

func (c *CryptopayPaymentResponse) SetAmountReceived(amountReceived string)

SetAmountReceived sets the AmountReceived field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetAsset

func (c *CryptopayPaymentResponse) SetAsset(asset *CryptopayAssetID)

SetAsset sets the Asset field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetComplianceLevel added in v0.0.23

func (c *CryptopayPaymentResponse) SetComplianceLevel(complianceLevel *CryptopayComplianceLevel)

SetComplianceLevel sets the ComplianceLevel field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetConfirmedAt added in v0.0.23

func (c *CryptopayPaymentResponse) SetConfirmedAt(confirmedAt *int)

SetConfirmedAt sets the ConfirmedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetCreatedAt

func (c *CryptopayPaymentResponse) SetCreatedAt(createdAt int)

SetCreatedAt sets the CreatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetExpiresAt

func (c *CryptopayPaymentResponse) SetExpiresAt(expiresAt int)

SetExpiresAt sets the ExpiresAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetExternalID

func (c *CryptopayPaymentResponse) SetExternalID(externalID *string)

SetExternalID sets the ExternalID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetFee

func (c *CryptopayPaymentResponse) SetFee(fee string)

SetFee sets the Fee field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetID

func (c *CryptopayPaymentResponse) SetID(id string)

SetID sets the ID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetMetadata

func (c *CryptopayPaymentResponse) SetMetadata(metadata map[string]any)

SetMetadata sets the Metadata field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetNetworkFee

func (c *CryptopayPaymentResponse) SetNetworkFee(networkFee string)

SetNetworkFee sets the NetworkFee field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetNetworkFeePayer added in v0.0.23

func (c *CryptopayPaymentResponse) SetNetworkFeePayer(networkFeePayer CryptopayFeePayer)

SetNetworkFeePayer sets the NetworkFeePayer field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetPaymentPageURL added in v0.0.23

func (c *CryptopayPaymentResponse) SetPaymentPageURL(paymentPageURL string)

SetPaymentPageURL sets the PaymentPageURL field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetPaymentWindowSeconds

func (c *CryptopayPaymentResponse) SetPaymentWindowSeconds(paymentWindowSeconds int)

SetPaymentWindowSeconds sets the PaymentWindowSeconds field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetProjectID

func (c *CryptopayPaymentResponse) SetProjectID(projectID string)

SetProjectID sets the ProjectID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetQuotedPrice added in v0.0.23

func (c *CryptopayPaymentResponse) SetQuotedPrice(quotedPrice string)

SetQuotedPrice sets the QuotedPrice field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetRedirectConfig

func (c *CryptopayPaymentResponse) SetRedirectConfig(redirectConfig *CryptopayRedirectConfigDto)

SetRedirectConfig sets the RedirectConfig field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetServiceFeeBps added in v0.0.23

func (c *CryptopayPaymentResponse) SetServiceFeeBps(serviceFeeBps int)

SetServiceFeeBps sets the ServiceFeeBps field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetServiceFeeMinUsd added in v0.0.23

func (c *CryptopayPaymentResponse) SetServiceFeeMinUsd(serviceFeeMinUsd string)

SetServiceFeeMinUsd sets the ServiceFeeMinUsd field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetServiceFeePayer added in v0.0.23

func (c *CryptopayPaymentResponse) SetServiceFeePayer(serviceFeePayer CryptopayFeePayer)

SetServiceFeePayer sets the ServiceFeePayer field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetStatus

SetStatus sets the Status field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetSubStatus

func (c *CryptopayPaymentResponse) SetSubStatus(subStatus CryptopayPaymentSubStatusEnum)

SetSubStatus sets the SubStatus field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetTransactions

func (c *CryptopayPaymentResponse) SetTransactions(transactions *CryptopaywireTransactionList)

SetTransactions sets the Transactions field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetUnderpaymentTolerance

func (c *CryptopayPaymentResponse) SetUnderpaymentTolerance(underpaymentTolerance *string)

SetUnderpaymentTolerance sets the UnderpaymentTolerance field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetUpdatedAt

func (c *CryptopayPaymentResponse) SetUpdatedAt(updatedAt int)

SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) SetWebhookURL

func (c *CryptopayPaymentResponse) SetWebhookURL(webhookURL *string)

SetWebhookURL sets the WebhookURL field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPaymentResponse) String

func (c *CryptopayPaymentResponse) String() string

func (*CryptopayPaymentResponse) UnmarshalJSON

func (c *CryptopayPaymentResponse) UnmarshalJSON(data []byte) error

type CryptopayPaymentStatusEnum

type CryptopayPaymentStatusEnum string

Terminal states: success (finalized), failed (terminal, no valid payment). Non-final: pending (awaiting funds), accepted (safe confirmations reached, credited — non-final until finalized).

const (
	CryptopayPaymentStatusEnumPending  CryptopayPaymentStatusEnum = "pending"
	CryptopayPaymentStatusEnumAccepted CryptopayPaymentStatusEnum = "accepted"
	CryptopayPaymentStatusEnumSuccess  CryptopayPaymentStatusEnum = "success"
	CryptopayPaymentStatusEnumFailed   CryptopayPaymentStatusEnum = "failed"
)

func NewCryptopayPaymentStatusEnumFromString

func NewCryptopayPaymentStatusEnumFromString(s string) (CryptopayPaymentStatusEnum, error)

func (CryptopayPaymentStatusEnum) Ptr

type CryptopayPaymentSubStatusEnum

type CryptopayPaymentSubStatusEnum string

overpaid / underpaid: more or less than the requested amount was received. partiallyPaid: payment expired with a partial payment that never reached acceptance. complianceHold: held (under pending) for compliance review. complianceRejected: rejected by compliance (terminal, under failed).

const (
	CryptopayPaymentSubStatusEnumCreated            CryptopayPaymentSubStatusEnum = "created"
	CryptopayPaymentSubStatusEnumActivated          CryptopayPaymentSubStatusEnum = "activated"
	CryptopayPaymentSubStatusEnumAwaitingPayment    CryptopayPaymentSubStatusEnum = "awaitingPayment"
	CryptopayPaymentSubStatusEnumConfirming         CryptopayPaymentSubStatusEnum = "confirming"
	CryptopayPaymentSubStatusEnumCompleted          CryptopayPaymentSubStatusEnum = "completed"
	CryptopayPaymentSubStatusEnumOverpaid           CryptopayPaymentSubStatusEnum = "overpaid"
	CryptopayPaymentSubStatusEnumUnderpaid          CryptopayPaymentSubStatusEnum = "underpaid"
	CryptopayPaymentSubStatusEnumExpired            CryptopayPaymentSubStatusEnum = "expired"
	CryptopayPaymentSubStatusEnumCancelled          CryptopayPaymentSubStatusEnum = "cancelled"
	CryptopayPaymentSubStatusEnumPartiallyPaid      CryptopayPaymentSubStatusEnum = "partiallyPaid"
	CryptopayPaymentSubStatusEnumComplianceHold     CryptopayPaymentSubStatusEnum = "complianceHold"
	CryptopayPaymentSubStatusEnumComplianceRejected CryptopayPaymentSubStatusEnum = "complianceRejected"
)

func NewCryptopayPaymentSubStatusEnumFromString

func NewCryptopayPaymentSubStatusEnumFromString(s string) (CryptopayPaymentSubStatusEnum, error)

func (CryptopayPaymentSubStatusEnum) Ptr

type CryptopayPublicPaymentResponse

type CryptopayPublicPaymentResponse struct {
	// Unix-milliseconds timestamp when the payment was activated. Null before activation.
	ActivatedAt *int `json:"activatedAt,omitempty" url:"activatedAt,omitempty"`
	// Activation grace period in seconds before the payment window starts counting. Null when not configured.
	ActivationFlowSeconds *int `json:"activationFlowSeconds,omitempty" url:"activationFlowSeconds,omitempty"`
	// On-chain deposit address the customer must send funds to. Null until the payment is activated and an address is assigned.
	Address *string `json:"address,omitempty" url:"address,omitempty"`
	// Integer string in the asset's smallest unit.
	Amount string `json:"amount" url:"amount"`
	// Integer string in the asset's smallest unit.
	AmountReceived string `json:"amountReceived" url:"amountReceived"`
	// Asset the payment is denominated in, as an asset id-string (see GET /v1/assets). Null until an asset is selected.
	Asset *CryptopayAssetID `json:"asset,omitempty" url:"asset,omitempty"`
	// Unix-milliseconds timestamp when the payment was created.
	CreatedAt int `json:"createdAt" url:"createdAt"`
	// Unix-milliseconds timestamp when the payment window closes; the payment expires if unpaid by then.
	ExpiresAt int `json:"expiresAt" url:"expiresAt"`
	// Unique Suward identifier of the payment.
	ID string `json:"id" url:"id"`
	// Length of the payment window in seconds — how long the payment stays open for funding once activated.
	PaymentWindowSeconds int `json:"paymentWindowSeconds" url:"paymentWindowSeconds"`
	// Resolved "return to store" redirect (base URL plus the query parameters to append) used to send the customer back after payment. Null when none was configured.
	Redirect *CryptopayPublicRedirect `json:"redirect,omitempty" url:"redirect,omitempty"`
	// Main payment lifecycle status. See the status enum for the full meaning of each value.
	Status CryptopayPaymentStatusEnum `json:"status" url:"status"`
	// Fine-grained payment sub-status. See the sub-status enum for the full meaning of each value.
	SubStatus CryptopayPaymentSubStatusEnum `json:"subStatus" url:"subStatus"`
	// Integer string in the asset's smallest unit.
	UnderpaymentTolerance *string `json:"underpaymentTolerance,omitempty" url:"underpaymentTolerance,omitempty"`
	// Unix-milliseconds timestamp when the payment was last updated.
	UpdatedAt int `json:"updatedAt" url:"updatedAt"`
	// Absolute URL of the Suward-hosted checkout page where the customer pays this payment.
	PaymentPageURL string `json:"paymentPageUrl" url:"paymentPageUrl"`
	// contains filtered or unexported fields
}

func (*CryptopayPublicPaymentResponse) GetActivatedAt

func (c *CryptopayPublicPaymentResponse) GetActivatedAt() *int

func (*CryptopayPublicPaymentResponse) GetActivationFlowSeconds

func (c *CryptopayPublicPaymentResponse) GetActivationFlowSeconds() *int

func (*CryptopayPublicPaymentResponse) GetAddress

func (c *CryptopayPublicPaymentResponse) GetAddress() *string

func (*CryptopayPublicPaymentResponse) GetAmount

func (c *CryptopayPublicPaymentResponse) GetAmount() string

func (*CryptopayPublicPaymentResponse) GetAmountReceived

func (c *CryptopayPublicPaymentResponse) GetAmountReceived() string

func (*CryptopayPublicPaymentResponse) GetAsset

func (*CryptopayPublicPaymentResponse) GetCreatedAt

func (c *CryptopayPublicPaymentResponse) GetCreatedAt() int

func (*CryptopayPublicPaymentResponse) GetExpiresAt

func (c *CryptopayPublicPaymentResponse) GetExpiresAt() int

func (*CryptopayPublicPaymentResponse) GetExtraProperties

func (c *CryptopayPublicPaymentResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayPublicPaymentResponse) GetID

func (*CryptopayPublicPaymentResponse) GetPaymentPageURL added in v0.0.23

func (c *CryptopayPublicPaymentResponse) GetPaymentPageURL() string

func (*CryptopayPublicPaymentResponse) GetPaymentWindowSeconds

func (c *CryptopayPublicPaymentResponse) GetPaymentWindowSeconds() int

func (*CryptopayPublicPaymentResponse) GetRedirect

func (*CryptopayPublicPaymentResponse) GetStatus

func (*CryptopayPublicPaymentResponse) GetSubStatus

func (*CryptopayPublicPaymentResponse) GetUnderpaymentTolerance

func (c *CryptopayPublicPaymentResponse) GetUnderpaymentTolerance() *string

func (*CryptopayPublicPaymentResponse) GetUpdatedAt

func (c *CryptopayPublicPaymentResponse) GetUpdatedAt() int

func (*CryptopayPublicPaymentResponse) MarshalJSON

func (c *CryptopayPublicPaymentResponse) MarshalJSON() ([]byte, error)

func (*CryptopayPublicPaymentResponse) SetActivatedAt

func (c *CryptopayPublicPaymentResponse) SetActivatedAt(activatedAt *int)

SetActivatedAt sets the ActivatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetActivationFlowSeconds

func (c *CryptopayPublicPaymentResponse) SetActivationFlowSeconds(activationFlowSeconds *int)

SetActivationFlowSeconds sets the ActivationFlowSeconds field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetAddress

func (c *CryptopayPublicPaymentResponse) SetAddress(address *string)

SetAddress sets the Address field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetAmount

func (c *CryptopayPublicPaymentResponse) SetAmount(amount string)

SetAmount sets the Amount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetAmountReceived

func (c *CryptopayPublicPaymentResponse) SetAmountReceived(amountReceived string)

SetAmountReceived sets the AmountReceived field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetAsset

SetAsset sets the Asset field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetCreatedAt

func (c *CryptopayPublicPaymentResponse) SetCreatedAt(createdAt int)

SetCreatedAt sets the CreatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetExpiresAt

func (c *CryptopayPublicPaymentResponse) SetExpiresAt(expiresAt int)

SetExpiresAt sets the ExpiresAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetID

SetID sets the ID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetPaymentPageURL added in v0.0.23

func (c *CryptopayPublicPaymentResponse) SetPaymentPageURL(paymentPageURL string)

SetPaymentPageURL sets the PaymentPageURL field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetPaymentWindowSeconds

func (c *CryptopayPublicPaymentResponse) SetPaymentWindowSeconds(paymentWindowSeconds int)

SetPaymentWindowSeconds sets the PaymentWindowSeconds field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetRedirect

func (c *CryptopayPublicPaymentResponse) SetRedirect(redirect *CryptopayPublicRedirect)

SetRedirect sets the Redirect field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetStatus

SetStatus sets the Status field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetSubStatus

SetSubStatus sets the SubStatus field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetUnderpaymentTolerance

func (c *CryptopayPublicPaymentResponse) SetUnderpaymentTolerance(underpaymentTolerance *string)

SetUnderpaymentTolerance sets the UnderpaymentTolerance field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) SetUpdatedAt

func (c *CryptopayPublicPaymentResponse) SetUpdatedAt(updatedAt int)

SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicPaymentResponse) String

func (*CryptopayPublicPaymentResponse) UnmarshalJSON

func (c *CryptopayPublicPaymentResponse) UnmarshalJSON(data []byte) error

type CryptopayPublicRedirect

type CryptopayPublicRedirect struct {
	// Query parameters to append to the URL when redirecting the customer back, e.g. id, externalId, data. Empty when the redirect has no parameters.
	Query map[string]string `json:"query" url:"query"`
	// Base "return to store" URL the customer is sent back to after paying.
	URL string `json:"url" url:"url"`
	// contains filtered or unexported fields
}

func (*CryptopayPublicRedirect) GetExtraProperties

func (c *CryptopayPublicRedirect) GetExtraProperties() map[string]interface{}

func (*CryptopayPublicRedirect) GetQuery

func (c *CryptopayPublicRedirect) GetQuery() map[string]string

func (*CryptopayPublicRedirect) GetURL

func (c *CryptopayPublicRedirect) GetURL() string

func (*CryptopayPublicRedirect) MarshalJSON

func (c *CryptopayPublicRedirect) MarshalJSON() ([]byte, error)

func (*CryptopayPublicRedirect) SetQuery

func (c *CryptopayPublicRedirect) SetQuery(query map[string]string)

SetQuery sets the Query field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicRedirect) SetURL

func (c *CryptopayPublicRedirect) SetURL(url string)

SetURL sets the URL field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayPublicRedirect) String

func (c *CryptopayPublicRedirect) String() string

func (*CryptopayPublicRedirect) UnmarshalJSON

func (c *CryptopayPublicRedirect) UnmarshalJSON(data []byte) error

type CryptopayQuotePaymentRequest added in v0.0.23

type CryptopayQuotePaymentRequest struct {
	// Asset identifier (see GET /v1/assets for the live list).
	Asset CryptopayAssetID `json:"asset" url:"-"`
	// Merchant base amount, integer string in the asset's smallest unit. Example: "5000000" = 5 USDT. The response returns the derived gross (what the customer pays) and netAmount (what the merchant receives).
	Amount string `json:"amount" url:"-"`
	// Who bears the network (gas) fee. Default merchant.
	NetworkFeePayer *CryptopayFeePayer `json:"networkFeePayer,omitempty" url:"-"`
	// Who bears the platform (service) fee. Default merchant.
	ServiceFeePayer *CryptopayFeePayer `json:"serviceFeePayer,omitempty" url:"-"`
	// AML screening depth to quote: basic (free, no minimum fee) or extended ($0.45 minimum fee). Omit to inherit the project/org default (extended).
	ComplianceLevel *CryptopayComplianceLevel `json:"complianceLevel,omitempty" url:"-"`
	// contains filtered or unexported fields
}

func (*CryptopayQuotePaymentRequest) MarshalJSON added in v0.0.23

func (c *CryptopayQuotePaymentRequest) MarshalJSON() ([]byte, error)

func (*CryptopayQuotePaymentRequest) SetAmount added in v0.0.23

func (c *CryptopayQuotePaymentRequest) SetAmount(amount string)

SetAmount sets the Amount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentRequest) SetAsset added in v0.0.23

SetAsset sets the Asset field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentRequest) SetComplianceLevel added in v0.0.23

func (c *CryptopayQuotePaymentRequest) SetComplianceLevel(complianceLevel *CryptopayComplianceLevel)

SetComplianceLevel sets the ComplianceLevel field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentRequest) SetNetworkFeePayer added in v0.0.23

func (c *CryptopayQuotePaymentRequest) SetNetworkFeePayer(networkFeePayer *CryptopayFeePayer)

SetNetworkFeePayer sets the NetworkFeePayer field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentRequest) SetServiceFeePayer added in v0.0.23

func (c *CryptopayQuotePaymentRequest) SetServiceFeePayer(serviceFeePayer *CryptopayFeePayer)

SetServiceFeePayer sets the ServiceFeePayer field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentRequest) UnmarshalJSON added in v0.0.23

func (c *CryptopayQuotePaymentRequest) UnmarshalJSON(data []byte) error

type CryptopayQuotePaymentResponse added in v0.0.23

type CryptopayQuotePaymentResponse struct {
	// Asset the quote is denominated in, echoed from the request.
	Asset CryptopayAssetID `json:"asset" url:"asset"`
	// Gross amount, integer string in the asset's smallest unit.
	Amount string `json:"amount" url:"amount"`
	// Platform fee, integer string in the asset's smallest unit. For extended compliance: max(0.4% of the amount, $0.45 equivalent); for basic: 0.4% with no floor.
	Fee string `json:"fee" url:"fee"`
	// AML screening depth used for this quote: basic or extended.
	ComplianceLevel *CryptopayComplianceLevel `json:"complianceLevel,omitempty" url:"complianceLevel,omitempty"`
	// Estimated on-chain (gas) cost, deducted from the received amount. Integer string in the asset's smallest unit.
	NetworkFee string `json:"networkFee" url:"networkFee"`
	// Amount the merchant receives after all fees. Integer string in the asset's smallest unit.
	NetAmount string `json:"netAmount" url:"netAmount"`
	// Amount the customer pays: base plus any customer-paid fees. Integer string in the asset's smallest unit.
	Gross string `json:"gross" url:"gross"`
	// USD price used for this quote, decimal string. Not locked — the binding price is captured when the payment is created.
	QuotedPrice string `json:"quotedPrice" url:"quotedPrice"`
	// contains filtered or unexported fields
}

func (*CryptopayQuotePaymentResponse) GetAmount added in v0.0.23

func (c *CryptopayQuotePaymentResponse) GetAmount() string

func (*CryptopayQuotePaymentResponse) GetAsset added in v0.0.23

func (*CryptopayQuotePaymentResponse) GetComplianceLevel added in v0.0.23

func (*CryptopayQuotePaymentResponse) GetExtraProperties added in v0.0.23

func (c *CryptopayQuotePaymentResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayQuotePaymentResponse) GetFee added in v0.0.23

func (*CryptopayQuotePaymentResponse) GetGross added in v0.0.23

func (c *CryptopayQuotePaymentResponse) GetGross() string

func (*CryptopayQuotePaymentResponse) GetNetAmount added in v0.0.23

func (c *CryptopayQuotePaymentResponse) GetNetAmount() string

func (*CryptopayQuotePaymentResponse) GetNetworkFee added in v0.0.23

func (c *CryptopayQuotePaymentResponse) GetNetworkFee() string

func (*CryptopayQuotePaymentResponse) GetQuotedPrice added in v0.0.23

func (c *CryptopayQuotePaymentResponse) GetQuotedPrice() string

func (*CryptopayQuotePaymentResponse) MarshalJSON added in v0.0.23

func (c *CryptopayQuotePaymentResponse) MarshalJSON() ([]byte, error)

func (*CryptopayQuotePaymentResponse) SetAmount added in v0.0.23

func (c *CryptopayQuotePaymentResponse) SetAmount(amount string)

SetAmount sets the Amount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentResponse) SetAsset added in v0.0.23

SetAsset sets the Asset field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentResponse) SetComplianceLevel added in v0.0.23

func (c *CryptopayQuotePaymentResponse) SetComplianceLevel(complianceLevel *CryptopayComplianceLevel)

SetComplianceLevel sets the ComplianceLevel field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentResponse) SetFee added in v0.0.23

func (c *CryptopayQuotePaymentResponse) SetFee(fee string)

SetFee sets the Fee field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentResponse) SetGross added in v0.0.23

func (c *CryptopayQuotePaymentResponse) SetGross(gross string)

SetGross sets the Gross field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentResponse) SetNetAmount added in v0.0.23

func (c *CryptopayQuotePaymentResponse) SetNetAmount(netAmount string)

SetNetAmount sets the NetAmount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentResponse) SetNetworkFee added in v0.0.23

func (c *CryptopayQuotePaymentResponse) SetNetworkFee(networkFee string)

SetNetworkFee sets the NetworkFee field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentResponse) SetQuotedPrice added in v0.0.23

func (c *CryptopayQuotePaymentResponse) SetQuotedPrice(quotedPrice string)

SetQuotedPrice sets the QuotedPrice field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayQuotePaymentResponse) String added in v0.0.23

func (*CryptopayQuotePaymentResponse) UnmarshalJSON added in v0.0.23

func (c *CryptopayQuotePaymentResponse) UnmarshalJSON(data []byte) error

type CryptopayRedirectConfigDto

type CryptopayRedirectConfigDto struct {
	// Opaque string passed through unchanged as the "data" query parameter on the return URL. Use it to carry your own session/order token.
	Data *string `json:"data,omitempty" url:"data,omitempty"`
	// Which payment identifiers to append to the return URL as query parameters. Allowed values: "id" (the Suward payment id) and "externalId" (your identifier).
	Params []CryptopayRedirectConfigDtoParamsItem `json:"params,omitempty" url:"params,omitempty"`
	// Base "return to store" URL the customer is sent back to after paying.
	URL string `json:"url" url:"url"`
	// contains filtered or unexported fields
}

func (*CryptopayRedirectConfigDto) GetData

func (c *CryptopayRedirectConfigDto) GetData() *string

func (*CryptopayRedirectConfigDto) GetExtraProperties

func (c *CryptopayRedirectConfigDto) GetExtraProperties() map[string]interface{}

func (*CryptopayRedirectConfigDto) GetParams

func (*CryptopayRedirectConfigDto) GetURL

func (c *CryptopayRedirectConfigDto) GetURL() string

func (*CryptopayRedirectConfigDto) MarshalJSON

func (c *CryptopayRedirectConfigDto) MarshalJSON() ([]byte, error)

func (*CryptopayRedirectConfigDto) SetData

func (c *CryptopayRedirectConfigDto) SetData(data *string)

SetData sets the Data field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayRedirectConfigDto) SetParams

SetParams sets the Params field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayRedirectConfigDto) SetURL

func (c *CryptopayRedirectConfigDto) SetURL(url string)

SetURL sets the URL field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayRedirectConfigDto) String

func (c *CryptopayRedirectConfigDto) String() string

func (*CryptopayRedirectConfigDto) UnmarshalJSON

func (c *CryptopayRedirectConfigDto) UnmarshalJSON(data []byte) error

type CryptopayRedirectConfigDtoParamsItem

type CryptopayRedirectConfigDtoParamsItem string
const (
	CryptopayRedirectConfigDtoParamsItemID         CryptopayRedirectConfigDtoParamsItem = "id"
	CryptopayRedirectConfigDtoParamsItemExternalID CryptopayRedirectConfigDtoParamsItem = "externalId"
)

func NewCryptopayRedirectConfigDtoParamsItemFromString

func NewCryptopayRedirectConfigDtoParamsItemFromString(s string) (CryptopayRedirectConfigDtoParamsItem, error)

func (CryptopayRedirectConfigDtoParamsItem) Ptr

type CryptopaySimulatePaymentRequest

type CryptopaySimulatePaymentRequest struct {
	// Payment ID
	PaymentID string `json:"-" url:"-"`
	// Optional simulated received amount, integer string in the asset's smallest unit (see CreatePaymentRequest.amount).
	Amount *string `json:"amount,omitempty" url:"-"`
	// Target main status. Required — status and subStatus are independent axes, both must be supplied.
	Status CryptopayPaymentStatusEnum `json:"status" url:"-"`
	// Target sub-status (amount/detail axis). Required — status and subStatus are independent axes, both must be supplied.
	SubStatus CryptopayPaymentSubStatusEnum `json:"subStatus" url:"-"`
	// contains filtered or unexported fields
}

func (*CryptopaySimulatePaymentRequest) MarshalJSON

func (c *CryptopaySimulatePaymentRequest) MarshalJSON() ([]byte, error)

func (*CryptopaySimulatePaymentRequest) SetAmount

func (c *CryptopaySimulatePaymentRequest) SetAmount(amount *string)

SetAmount sets the Amount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulatePaymentRequest) SetPaymentID

func (c *CryptopaySimulatePaymentRequest) SetPaymentID(paymentID string)

SetPaymentID sets the PaymentID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulatePaymentRequest) SetStatus added in v0.0.23

SetStatus sets the Status field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulatePaymentRequest) SetSubStatus

SetSubStatus sets the SubStatus field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulatePaymentRequest) UnmarshalJSON

func (c *CryptopaySimulatePaymentRequest) UnmarshalJSON(data []byte) error

type CryptopaySimulateStaticDepositRequest

type CryptopaySimulateStaticDepositRequest struct {
	// Static wallet ID
	StaticWalletID string `json:"-" url:"-"`
	// Deposited amount to simulate, an integer string in the asset's smallest unit (see CreatePaymentRequest.amount).
	Amount string `json:"amount" url:"-"`
	// Asset id-string of the simulated deposit (see GET /v1/assets), e.g. USDT_ARBITRUM.
	Asset CryptopayAssetID `json:"asset" url:"-"`
	// Target lifecycle stage to drive the simulated deposit to.
	Status CryptopaySimulateStaticDepositRequestStatus `json:"status" url:"-"`
	// Optional index of the transfer within the transaction, as a string-encoded integer.
	TransferIndex *string `json:"transferIndex,omitempty" url:"-"`
	// Optional synthetic transaction hash; a random one is generated when omitted.
	TxHash *string `json:"txHash,omitempty" url:"-"`
	// contains filtered or unexported fields
}

func (*CryptopaySimulateStaticDepositRequest) MarshalJSON

func (c *CryptopaySimulateStaticDepositRequest) MarshalJSON() ([]byte, error)

func (*CryptopaySimulateStaticDepositRequest) SetAmount

func (c *CryptopaySimulateStaticDepositRequest) SetAmount(amount string)

SetAmount sets the Amount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulateStaticDepositRequest) SetAsset

SetAsset sets the Asset field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulateStaticDepositRequest) SetStaticWalletID

func (c *CryptopaySimulateStaticDepositRequest) SetStaticWalletID(staticWalletID string)

SetStaticWalletID sets the StaticWalletID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulateStaticDepositRequest) SetStatus

SetStatus sets the Status field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulateStaticDepositRequest) SetTransferIndex

func (c *CryptopaySimulateStaticDepositRequest) SetTransferIndex(transferIndex *string)

SetTransferIndex sets the TransferIndex field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulateStaticDepositRequest) SetTxHash

func (c *CryptopaySimulateStaticDepositRequest) SetTxHash(txHash *string)

SetTxHash sets the TxHash field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaySimulateStaticDepositRequest) UnmarshalJSON

func (c *CryptopaySimulateStaticDepositRequest) UnmarshalJSON(data []byte) error

type CryptopaySimulateStaticDepositRequestStatus

type CryptopaySimulateStaticDepositRequestStatus string

Target lifecycle stage to drive the simulated deposit to.

const (
	CryptopaySimulateStaticDepositRequestStatusDetected    CryptopaySimulateStaticDepositRequestStatus = "detected"
	CryptopaySimulateStaticDepositRequestStatusAccepted    CryptopaySimulateStaticDepositRequestStatus = "accepted"
	CryptopaySimulateStaticDepositRequestStatusConfirmed   CryptopaySimulateStaticDepositRequestStatus = "confirmed"
	CryptopaySimulateStaticDepositRequestStatusInvalidated CryptopaySimulateStaticDepositRequestStatus = "invalidated"
)

func NewCryptopaySimulateStaticDepositRequestStatusFromString

func NewCryptopaySimulateStaticDepositRequestStatusFromString(s string) (CryptopaySimulateStaticDepositRequestStatus, error)

func (CryptopaySimulateStaticDepositRequestStatus) Ptr

type CryptopayStaticDepositResponse

type CryptopayStaticDepositResponse struct {
	// Unix-milliseconds timestamp when the deposit reached the accepted (safe confirmations) tier. Null before acceptance.
	AcceptedAt *int `json:"acceptedAt,omitempty" url:"acceptedAt,omitempty"`
	// On-chain address that received the deposit (the static wallet's address).
	Address string `json:"address" url:"address"`
	// Gross deposited amount, an integer string in the asset's smallest unit (see CreatePaymentRequest.amount).
	Amount string `json:"amount" url:"amount"`
	// Asset of the deposit, as an asset id-string (see GET /v1/assets).
	Asset *CryptopayAssetID `json:"asset,omitempty" url:"asset,omitempty"`
	// Unix-milliseconds timestamp when the deposit reached finality (confirmed). Null before confirmation.
	ConfirmedAt *int `json:"confirmedAt,omitempty" url:"confirmedAt,omitempty"`
	// Unix-milliseconds timestamp when the deposit record was created.
	CreatedAt int `json:"createdAt" url:"createdAt"`
	// Unix-milliseconds timestamp when the deposit was first detected on-chain.
	DetectedAt int `json:"detectedAt" url:"detectedAt"`
	// ExternalID is the static wallet's externalId, denormalized onto the deposit.
	ExternalID *string `json:"externalId,omitempty" url:"externalId,omitempty"`
	// Platform fee on this deposit, integer string in the asset's smallest unit: max(0.4% of the amount, $0.45 equivalent). The floor is 0 for assets without a published USD price.
	Fee string `json:"fee" url:"fee"`
	// Unique Suward identifier of the deposit.
	ID string `json:"id" url:"id"`
	// Unix-milliseconds timestamp when the deposit was invalidated (e.g. dropped by a chain reorg). Null unless invalidated.
	InvalidatedAt *int `json:"invalidatedAt,omitempty" url:"invalidatedAt,omitempty"`
	// Amount credited to the merchant after fees (amount - fee - networkFee), integer string in the asset's smallest unit.
	NetAmount string `json:"netAmount" url:"netAmount"`
	// Estimated on-chain (gas) cost deducted from the deposit, integer string in the asset's smallest unit.
	NetworkFee string `json:"networkFee" url:"networkFee"`
	// Identifier of the project that owns this deposit.
	ProjectID string `json:"projectId" url:"projectId"`
	// The service-fee rate applied to this deposit, in basis points (e.g. 40 = 0.4%).
	ServiceFeeBps int `json:"serviceFeeBps" url:"serviceFeeBps"`
	// The minimum service-fee floor applied to this deposit, as a USD decimal string (e.g. "1").
	ServiceFeeMinUsd string `json:"serviceFeeMinUsd" url:"serviceFeeMinUsd"`
	// Identifier of the static wallet that received this deposit.
	StaticWalletID string `json:"staticWalletId" url:"staticWalletId"`
	// Deposit lifecycle status. detected: seen on-chain, awaiting confirmations. accepted: safe confirmations reached, credited (non-final). confirmed: finalized (terminal). ignored: the asset is not on the wallet's allow-list, so the deposit is not credited. invalidated: dropped after detection, e.g. by a chain reorg. complianceHold: held pending compliance review. complianceRejected: rejected by compliance, credit reversed (terminal).
	Status CryptopayStaticDepositResponseStatus `json:"status" url:"status"`
	// Index of this transfer within its transaction, as a string-encoded integer. Distinguishes multiple transfers to the same address in one transaction.
	TransferIndex string `json:"transferIndex" url:"transferIndex"`
	// On-chain transaction hash of the deposit.
	TxHash string `json:"txHash" url:"txHash"`
	// Unix-milliseconds timestamp when the deposit was last updated.
	UpdatedAt int `json:"updatedAt" url:"updatedAt"`
	// contains filtered or unexported fields
}

func (*CryptopayStaticDepositResponse) GetAcceptedAt

func (c *CryptopayStaticDepositResponse) GetAcceptedAt() *int

func (*CryptopayStaticDepositResponse) GetAddress

func (c *CryptopayStaticDepositResponse) GetAddress() string

func (*CryptopayStaticDepositResponse) GetAmount

func (c *CryptopayStaticDepositResponse) GetAmount() string

func (*CryptopayStaticDepositResponse) GetAsset

func (*CryptopayStaticDepositResponse) GetConfirmedAt

func (c *CryptopayStaticDepositResponse) GetConfirmedAt() *int

func (*CryptopayStaticDepositResponse) GetCreatedAt

func (c *CryptopayStaticDepositResponse) GetCreatedAt() int

func (*CryptopayStaticDepositResponse) GetDetectedAt

func (c *CryptopayStaticDepositResponse) GetDetectedAt() int

func (*CryptopayStaticDepositResponse) GetExternalID

func (c *CryptopayStaticDepositResponse) GetExternalID() *string

func (*CryptopayStaticDepositResponse) GetExtraProperties

func (c *CryptopayStaticDepositResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayStaticDepositResponse) GetFee

func (*CryptopayStaticDepositResponse) GetID

func (*CryptopayStaticDepositResponse) GetInvalidatedAt

func (c *CryptopayStaticDepositResponse) GetInvalidatedAt() *int

func (*CryptopayStaticDepositResponse) GetNetAmount

func (c *CryptopayStaticDepositResponse) GetNetAmount() string

func (*CryptopayStaticDepositResponse) GetNetworkFee

func (c *CryptopayStaticDepositResponse) GetNetworkFee() string

func (*CryptopayStaticDepositResponse) GetProjectID

func (c *CryptopayStaticDepositResponse) GetProjectID() string

func (*CryptopayStaticDepositResponse) GetServiceFeeBps added in v0.0.23

func (c *CryptopayStaticDepositResponse) GetServiceFeeBps() int

func (*CryptopayStaticDepositResponse) GetServiceFeeMinUsd added in v0.0.23

func (c *CryptopayStaticDepositResponse) GetServiceFeeMinUsd() string

func (*CryptopayStaticDepositResponse) GetStaticWalletID

func (c *CryptopayStaticDepositResponse) GetStaticWalletID() string

func (*CryptopayStaticDepositResponse) GetStatus

func (*CryptopayStaticDepositResponse) GetTransferIndex

func (c *CryptopayStaticDepositResponse) GetTransferIndex() string

func (*CryptopayStaticDepositResponse) GetTxHash

func (c *CryptopayStaticDepositResponse) GetTxHash() string

func (*CryptopayStaticDepositResponse) GetUpdatedAt

func (c *CryptopayStaticDepositResponse) GetUpdatedAt() int

func (*CryptopayStaticDepositResponse) MarshalJSON

func (c *CryptopayStaticDepositResponse) MarshalJSON() ([]byte, error)

func (*CryptopayStaticDepositResponse) SetAcceptedAt

func (c *CryptopayStaticDepositResponse) SetAcceptedAt(acceptedAt *int)

SetAcceptedAt sets the AcceptedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetAddress

func (c *CryptopayStaticDepositResponse) SetAddress(address string)

SetAddress sets the Address field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetAmount

func (c *CryptopayStaticDepositResponse) SetAmount(amount string)

SetAmount sets the Amount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetAsset

SetAsset sets the Asset field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetConfirmedAt

func (c *CryptopayStaticDepositResponse) SetConfirmedAt(confirmedAt *int)

SetConfirmedAt sets the ConfirmedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetCreatedAt

func (c *CryptopayStaticDepositResponse) SetCreatedAt(createdAt int)

SetCreatedAt sets the CreatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetDetectedAt

func (c *CryptopayStaticDepositResponse) SetDetectedAt(detectedAt int)

SetDetectedAt sets the DetectedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetExternalID

func (c *CryptopayStaticDepositResponse) SetExternalID(externalID *string)

SetExternalID sets the ExternalID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetFee

func (c *CryptopayStaticDepositResponse) SetFee(fee string)

SetFee sets the Fee field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetID

SetID sets the ID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetInvalidatedAt

func (c *CryptopayStaticDepositResponse) SetInvalidatedAt(invalidatedAt *int)

SetInvalidatedAt sets the InvalidatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetNetAmount

func (c *CryptopayStaticDepositResponse) SetNetAmount(netAmount string)

SetNetAmount sets the NetAmount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetNetworkFee

func (c *CryptopayStaticDepositResponse) SetNetworkFee(networkFee string)

SetNetworkFee sets the NetworkFee field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetProjectID

func (c *CryptopayStaticDepositResponse) SetProjectID(projectID string)

SetProjectID sets the ProjectID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetServiceFeeBps added in v0.0.23

func (c *CryptopayStaticDepositResponse) SetServiceFeeBps(serviceFeeBps int)

SetServiceFeeBps sets the ServiceFeeBps field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetServiceFeeMinUsd added in v0.0.23

func (c *CryptopayStaticDepositResponse) SetServiceFeeMinUsd(serviceFeeMinUsd string)

SetServiceFeeMinUsd sets the ServiceFeeMinUsd field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetStaticWalletID

func (c *CryptopayStaticDepositResponse) SetStaticWalletID(staticWalletID string)

SetStaticWalletID sets the StaticWalletID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetStatus

SetStatus sets the Status field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetTransferIndex

func (c *CryptopayStaticDepositResponse) SetTransferIndex(transferIndex string)

SetTransferIndex sets the TransferIndex field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetTxHash

func (c *CryptopayStaticDepositResponse) SetTxHash(txHash string)

SetTxHash sets the TxHash field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) SetUpdatedAt

func (c *CryptopayStaticDepositResponse) SetUpdatedAt(updatedAt int)

SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticDepositResponse) String

func (*CryptopayStaticDepositResponse) UnmarshalJSON

func (c *CryptopayStaticDepositResponse) UnmarshalJSON(data []byte) error

type CryptopayStaticDepositResponseStatus

type CryptopayStaticDepositResponseStatus string

Deposit lifecycle status. detected: seen on-chain, awaiting confirmations. accepted: safe confirmations reached, credited (non-final). confirmed: finalized (terminal). ignored: the asset is not on the wallet's allow-list, so the deposit is not credited. invalidated: dropped after detection, e.g. by a chain reorg. complianceHold: held pending compliance review. complianceRejected: rejected by compliance, credit reversed (terminal).

const (
	CryptopayStaticDepositResponseStatusDetected           CryptopayStaticDepositResponseStatus = "detected"
	CryptopayStaticDepositResponseStatusAccepted           CryptopayStaticDepositResponseStatus = "accepted"
	CryptopayStaticDepositResponseStatusConfirmed          CryptopayStaticDepositResponseStatus = "confirmed"
	CryptopayStaticDepositResponseStatusIgnored            CryptopayStaticDepositResponseStatus = "ignored"
	CryptopayStaticDepositResponseStatusInvalidated        CryptopayStaticDepositResponseStatus = "invalidated"
	CryptopayStaticDepositResponseStatusComplianceHold     CryptopayStaticDepositResponseStatus = "complianceHold"
	CryptopayStaticDepositResponseStatusComplianceRejected CryptopayStaticDepositResponseStatus = "complianceRejected"
)

func NewCryptopayStaticDepositResponseStatusFromString

func NewCryptopayStaticDepositResponseStatusFromString(s string) (CryptopayStaticDepositResponseStatus, error)

func (CryptopayStaticDepositResponseStatus) Ptr

type CryptopayStaticWalletResponse

type CryptopayStaticWalletResponse struct {
	// Reusable on-chain deposit address of this static wallet. Customers may send accepted assets to it repeatedly; each incoming transfer becomes a deposit.
	Address string `json:"address" url:"address"`
	// Accepted-asset allow-list, as asset id-strings (see GET /v1/assets). Deposits of assets outside this list are ignored and not credited.
	AllowedAssets []CryptopayAssetID `json:"allowedAssets" url:"allowedAssets"`
	// Unix-milliseconds timestamp when the static wallet was created.
	CreatedAt int `json:"createdAt" url:"createdAt"`
	// Your own identifier for this static wallet, echoed from creation. Null when none was provided.
	ExternalID *string `json:"externalId,omitempty" url:"externalId,omitempty"`
	// Unique Suward identifier of the static wallet.
	ID string `json:"id" url:"id"`
	// Arbitrary key/value data attached by the merchant, echoed back unchanged.
	Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"`
	// Identifier of the project that owns this static wallet.
	ProjectID string `json:"projectId" url:"projectId"`
	// Unix-milliseconds timestamp when the static wallet was last updated.
	UpdatedAt int `json:"updatedAt" url:"updatedAt"`
	// Webhook URL that receives this wallet's deposit events. Null when the project default webhook is used.
	WebhookURL *string `json:"webhookUrl,omitempty" url:"webhookUrl,omitempty"`
	// contains filtered or unexported fields
}

func (*CryptopayStaticWalletResponse) GetAddress

func (c *CryptopayStaticWalletResponse) GetAddress() string

func (*CryptopayStaticWalletResponse) GetAllowedAssets

func (c *CryptopayStaticWalletResponse) GetAllowedAssets() []CryptopayAssetID

func (*CryptopayStaticWalletResponse) GetCreatedAt

func (c *CryptopayStaticWalletResponse) GetCreatedAt() int

func (*CryptopayStaticWalletResponse) GetExternalID

func (c *CryptopayStaticWalletResponse) GetExternalID() *string

func (*CryptopayStaticWalletResponse) GetExtraProperties

func (c *CryptopayStaticWalletResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayStaticWalletResponse) GetID

func (*CryptopayStaticWalletResponse) GetMetadata

func (c *CryptopayStaticWalletResponse) GetMetadata() map[string]any

func (*CryptopayStaticWalletResponse) GetProjectID

func (c *CryptopayStaticWalletResponse) GetProjectID() string

func (*CryptopayStaticWalletResponse) GetUpdatedAt

func (c *CryptopayStaticWalletResponse) GetUpdatedAt() int

func (*CryptopayStaticWalletResponse) GetWebhookURL

func (c *CryptopayStaticWalletResponse) GetWebhookURL() *string

func (*CryptopayStaticWalletResponse) MarshalJSON

func (c *CryptopayStaticWalletResponse) MarshalJSON() ([]byte, error)

func (*CryptopayStaticWalletResponse) SetAddress

func (c *CryptopayStaticWalletResponse) SetAddress(address string)

SetAddress sets the Address field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticWalletResponse) SetAllowedAssets

func (c *CryptopayStaticWalletResponse) SetAllowedAssets(allowedAssets []CryptopayAssetID)

SetAllowedAssets sets the AllowedAssets field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticWalletResponse) SetCreatedAt

func (c *CryptopayStaticWalletResponse) SetCreatedAt(createdAt int)

SetCreatedAt sets the CreatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticWalletResponse) SetExternalID

func (c *CryptopayStaticWalletResponse) SetExternalID(externalID *string)

SetExternalID sets the ExternalID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticWalletResponse) SetID

SetID sets the ID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticWalletResponse) SetMetadata

func (c *CryptopayStaticWalletResponse) SetMetadata(metadata map[string]any)

SetMetadata sets the Metadata field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticWalletResponse) SetProjectID

func (c *CryptopayStaticWalletResponse) SetProjectID(projectID string)

SetProjectID sets the ProjectID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticWalletResponse) SetUpdatedAt

func (c *CryptopayStaticWalletResponse) SetUpdatedAt(updatedAt int)

SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticWalletResponse) SetWebhookURL

func (c *CryptopayStaticWalletResponse) SetWebhookURL(webhookURL *string)

SetWebhookURL sets the WebhookURL field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayStaticWalletResponse) String

func (*CryptopayStaticWalletResponse) UnmarshalJSON

func (c *CryptopayStaticWalletResponse) UnmarshalJSON(data []byte) error

type CryptopayTransactionResponse

type CryptopayTransactionResponse struct {
	// Unix-milliseconds timestamp when the transfer reached the accepted (safe) confirmation tier. Null before acceptance.
	AcceptedAt *int `json:"acceptedAt,omitempty" url:"acceptedAt,omitempty"`
	// On-chain transfer amount, an integer string in the asset's smallest unit (see CreatePaymentRequest.amount).
	Amount string `json:"amount" url:"amount"`
	// Unix-milliseconds timestamp when the transfer was first seen on-chain.
	DetectedAt int `json:"detectedAt" url:"detectedAt"`
	// On-chain transaction hash of the transfer.
	TxHash string `json:"txHash" url:"txHash"`
	// contains filtered or unexported fields
}

func (*CryptopayTransactionResponse) GetAcceptedAt

func (c *CryptopayTransactionResponse) GetAcceptedAt() *int

func (*CryptopayTransactionResponse) GetAmount

func (c *CryptopayTransactionResponse) GetAmount() string

func (*CryptopayTransactionResponse) GetDetectedAt

func (c *CryptopayTransactionResponse) GetDetectedAt() int

func (*CryptopayTransactionResponse) GetExtraProperties

func (c *CryptopayTransactionResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayTransactionResponse) GetTxHash

func (c *CryptopayTransactionResponse) GetTxHash() string

func (*CryptopayTransactionResponse) MarshalJSON

func (c *CryptopayTransactionResponse) MarshalJSON() ([]byte, error)

func (*CryptopayTransactionResponse) SetAcceptedAt

func (c *CryptopayTransactionResponse) SetAcceptedAt(acceptedAt *int)

SetAcceptedAt sets the AcceptedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayTransactionResponse) SetAmount

func (c *CryptopayTransactionResponse) SetAmount(amount string)

SetAmount sets the Amount field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayTransactionResponse) SetDetectedAt

func (c *CryptopayTransactionResponse) SetDetectedAt(detectedAt int)

SetDetectedAt sets the DetectedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayTransactionResponse) SetTxHash

func (c *CryptopayTransactionResponse) SetTxHash(txHash string)

SetTxHash sets the TxHash field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayTransactionResponse) String

func (*CryptopayTransactionResponse) UnmarshalJSON

func (c *CryptopayTransactionResponse) UnmarshalJSON(data []byte) error

type CryptopayUpdateStaticWalletRequest

type CryptopayUpdateStaticWalletRequest struct {
	// Static wallet ID
	StaticWalletID string `json:"-" url:"-"`
	// New accepted-asset allow-list, as asset id-strings (see GET /v1/assets). When empty or omitted the current list is left unchanged.
	AllowedAssets []CryptopayAssetID `json:"allowedAssets,omitempty" url:"-"`
	// Replacement key/value metadata for the static wallet.
	Metadata map[string]any `json:"metadata,omitempty" url:"-"`
	// Replacement webhook URL for this wallet's deposit events.
	WebhookURL *string `json:"webhookUrl,omitempty" url:"-"`
	// contains filtered or unexported fields
}

func (*CryptopayUpdateStaticWalletRequest) MarshalJSON

func (c *CryptopayUpdateStaticWalletRequest) MarshalJSON() ([]byte, error)

func (*CryptopayUpdateStaticWalletRequest) SetAllowedAssets

func (c *CryptopayUpdateStaticWalletRequest) SetAllowedAssets(allowedAssets []CryptopayAssetID)

SetAllowedAssets sets the AllowedAssets field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayUpdateStaticWalletRequest) SetMetadata

func (c *CryptopayUpdateStaticWalletRequest) SetMetadata(metadata map[string]any)

SetMetadata sets the Metadata field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayUpdateStaticWalletRequest) SetStaticWalletID

func (c *CryptopayUpdateStaticWalletRequest) SetStaticWalletID(staticWalletID string)

SetStaticWalletID sets the StaticWalletID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayUpdateStaticWalletRequest) SetWebhookURL

func (c *CryptopayUpdateStaticWalletRequest) SetWebhookURL(webhookURL *string)

SetWebhookURL sets the WebhookURL field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayUpdateStaticWalletRequest) UnmarshalJSON

func (c *CryptopayUpdateStaticWalletRequest) UnmarshalJSON(data []byte) error

type CryptopayWithdrawalConfigResponse added in v0.0.23

type CryptopayWithdrawalConfigResponse struct {
	// Flat per-withdrawal fee in USD (decimal string).
	WithdrawalFeeUsd string `json:"withdrawalFeeUsd" url:"withdrawalFeeUsd"`
	// Asset/network pairs available for withdrawal.
	Assets []*CryptopayAssetResponse `json:"assets" url:"assets"`
	// contains filtered or unexported fields
}

func (*CryptopayWithdrawalConfigResponse) GetAssets added in v0.0.23

func (*CryptopayWithdrawalConfigResponse) GetExtraProperties added in v0.0.23

func (c *CryptopayWithdrawalConfigResponse) GetExtraProperties() map[string]interface{}

func (*CryptopayWithdrawalConfigResponse) GetWithdrawalFeeUsd added in v0.0.23

func (c *CryptopayWithdrawalConfigResponse) GetWithdrawalFeeUsd() string

func (*CryptopayWithdrawalConfigResponse) MarshalJSON added in v0.0.23

func (c *CryptopayWithdrawalConfigResponse) MarshalJSON() ([]byte, error)

func (*CryptopayWithdrawalConfigResponse) SetAssets added in v0.0.23

SetAssets sets the Assets field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayWithdrawalConfigResponse) SetWithdrawalFeeUsd added in v0.0.23

func (c *CryptopayWithdrawalConfigResponse) SetWithdrawalFeeUsd(withdrawalFeeUsd string)

SetWithdrawalFeeUsd sets the WithdrawalFeeUsd field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopayWithdrawalConfigResponse) String added in v0.0.23

func (*CryptopayWithdrawalConfigResponse) UnmarshalJSON added in v0.0.23

func (c *CryptopayWithdrawalConfigResponse) UnmarshalJSON(data []byte) error

type CryptopaywireTransactionList added in v0.0.23

type CryptopaywireTransactionList struct {
	// True when more transactions exist beyond this page. To fetch the next page, pass the last item's id as the lastId query parameter.
	HasMore bool `json:"hasMore" url:"hasMore"`
	// Page of transactions, ordered per the request's order parameter.
	Items []*CryptopayTransactionResponse `json:"items" url:"items"`
	// contains filtered or unexported fields
}

func (*CryptopaywireTransactionList) GetExtraProperties added in v0.0.23

func (c *CryptopaywireTransactionList) GetExtraProperties() map[string]interface{}

func (*CryptopaywireTransactionList) GetHasMore added in v0.0.23

func (c *CryptopaywireTransactionList) GetHasMore() bool

func (*CryptopaywireTransactionList) GetItems added in v0.0.23

func (*CryptopaywireTransactionList) MarshalJSON added in v0.0.23

func (c *CryptopaywireTransactionList) MarshalJSON() ([]byte, error)

func (*CryptopaywireTransactionList) SetHasMore added in v0.0.23

func (c *CryptopaywireTransactionList) SetHasMore(hasMore bool)

SetHasMore sets the HasMore field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaywireTransactionList) SetItems added in v0.0.23

SetItems sets the Items field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptopaywireTransactionList) String added in v0.0.23

func (*CryptopaywireTransactionList) UnmarshalJSON added in v0.0.23

func (c *CryptopaywireTransactionList) UnmarshalJSON(data []byte) error

type DeleteV1StaticWalletsStaticWalletIDRequest

type DeleteV1StaticWalletsStaticWalletIDRequest struct {
	// Static wallet ID
	StaticWalletID string `json:"-" url:"-"`
	// contains filtered or unexported fields
}

func (*DeleteV1StaticWalletsStaticWalletIDRequest) SetStaticWalletID

func (d *DeleteV1StaticWalletsStaticWalletIDRequest) SetStaticWalletID(staticWalletID string)

SetStaticWalletID sets the StaticWalletID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type FileParam

type FileParam struct {
	io.Reader
	// contains filtered or unexported fields
}

FileParam is a file type suitable for multipart/form-data uploads.

func NewFileParam

func NewFileParam(
	reader io.Reader,
	filename string,
	contentType string,
	opts ...FileParamOption,
) *FileParam

NewFileParam returns a *FileParam type suitable for multipart/form-data uploads. All file upload endpoints accept a simple io.Reader, which is usually created by opening a file via os.Open.

However, some endpoints require additional metadata about the file such as a specific Content-Type or custom filename. FileParam makes it easier to create the correct type signature for these endpoints.

func (*FileParam) ContentType

func (f *FileParam) ContentType() string

func (*FileParam) Name

func (f *FileParam) Name() string

type FileParamOption

type FileParamOption interface {
	// contains filtered or unexported methods
}

FileParamOption adapts the behavior of the FileParam. No options are implemented yet, but this interface allows for future extensibility.

type GetV1AssetGroupsResponse added in v0.0.23

type GetV1AssetGroupsResponse struct {
	Items []*CryptopayAssetGroupResponse `json:"items,omitempty" url:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*GetV1AssetGroupsResponse) GetExtraProperties added in v0.0.23

func (g *GetV1AssetGroupsResponse) GetExtraProperties() map[string]interface{}

func (*GetV1AssetGroupsResponse) GetItems added in v0.0.23

func (*GetV1AssetGroupsResponse) MarshalJSON added in v0.0.23

func (g *GetV1AssetGroupsResponse) MarshalJSON() ([]byte, error)

func (*GetV1AssetGroupsResponse) SetItems added in v0.0.23

SetItems sets the Items field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1AssetGroupsResponse) String added in v0.0.23

func (g *GetV1AssetGroupsResponse) String() string

func (*GetV1AssetGroupsResponse) UnmarshalJSON added in v0.0.23

func (g *GetV1AssetGroupsResponse) UnmarshalJSON(data []byte) error

type GetV1AssetsResponse added in v0.0.23

type GetV1AssetsResponse struct {
	Items []*CryptopayAssetResponse `json:"items,omitempty" url:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*GetV1AssetsResponse) GetExtraProperties added in v0.0.23

func (g *GetV1AssetsResponse) GetExtraProperties() map[string]interface{}

func (*GetV1AssetsResponse) GetItems added in v0.0.23

func (*GetV1AssetsResponse) MarshalJSON added in v0.0.23

func (g *GetV1AssetsResponse) MarshalJSON() ([]byte, error)

func (*GetV1AssetsResponse) SetItems added in v0.0.23

func (g *GetV1AssetsResponse) SetItems(items []*CryptopayAssetResponse)

SetItems sets the Items field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1AssetsResponse) String added in v0.0.23

func (g *GetV1AssetsResponse) String() string

func (*GetV1AssetsResponse) UnmarshalJSON added in v0.0.23

func (g *GetV1AssetsResponse) UnmarshalJSON(data []byte) error

type GetV1PaymentsPaymentIDRequest

type GetV1PaymentsPaymentIDRequest struct {
	// Payment ID
	PaymentID string `json:"-" url:"-"`
	// contains filtered or unexported fields
}

func (*GetV1PaymentsPaymentIDRequest) SetPaymentID

func (g *GetV1PaymentsPaymentIDRequest) SetPaymentID(paymentID string)

SetPaymentID sets the PaymentID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetV1PaymentsPaymentIDResponse

type GetV1PaymentsPaymentIDResponse struct {
	CryptopayPaymentResponse       *CryptopayPaymentResponse
	CryptopayPublicPaymentResponse *CryptopayPublicPaymentResponse
	// contains filtered or unexported fields
}

func (*GetV1PaymentsPaymentIDResponse) Accept

func (*GetV1PaymentsPaymentIDResponse) GetCryptopayPaymentResponse

func (g *GetV1PaymentsPaymentIDResponse) GetCryptopayPaymentResponse() *CryptopayPaymentResponse

func (*GetV1PaymentsPaymentIDResponse) GetCryptopayPublicPaymentResponse

func (g *GetV1PaymentsPaymentIDResponse) GetCryptopayPublicPaymentResponse() *CryptopayPublicPaymentResponse

func (GetV1PaymentsPaymentIDResponse) MarshalJSON

func (g GetV1PaymentsPaymentIDResponse) MarshalJSON() ([]byte, error)

func (*GetV1PaymentsPaymentIDResponse) UnmarshalJSON

func (g *GetV1PaymentsPaymentIDResponse) UnmarshalJSON(data []byte) error

type GetV1PaymentsPaymentIDResponseVisitor

type GetV1PaymentsPaymentIDResponseVisitor interface {
	VisitCryptopayPaymentResponse(*CryptopayPaymentResponse) error
	VisitCryptopayPublicPaymentResponse(*CryptopayPublicPaymentResponse) error
}

type GetV1PaymentsPaymentIDTransactionsRequest added in v0.0.23

type GetV1PaymentsPaymentIDTransactionsRequest struct {
	// Payment ID
	PaymentID string `json:"-" url:"-"`
	// Sort order by id: asc = ascending, anything else = descending
	Order *GetV1PaymentsPaymentIDTransactionsRequestOrder `json:"-" url:"order,omitempty"`
	// Page size (default 20, max 100)
	Limit *int `json:"-" url:"limit,omitempty"`
	// Pagination cursor: last id from the previous page
	LastID *string `json:"-" url:"lastId,omitempty"`
	// contains filtered or unexported fields
}

func (*GetV1PaymentsPaymentIDTransactionsRequest) SetLastID added in v0.0.23

func (g *GetV1PaymentsPaymentIDTransactionsRequest) SetLastID(lastID *string)

SetLastID sets the LastID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1PaymentsPaymentIDTransactionsRequest) SetLimit added in v0.0.23

func (g *GetV1PaymentsPaymentIDTransactionsRequest) SetLimit(limit *int)

SetLimit sets the Limit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1PaymentsPaymentIDTransactionsRequest) SetOrder added in v0.0.23

SetOrder sets the Order field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1PaymentsPaymentIDTransactionsRequest) SetPaymentID added in v0.0.23

func (g *GetV1PaymentsPaymentIDTransactionsRequest) SetPaymentID(paymentID string)

SetPaymentID sets the PaymentID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetV1PaymentsPaymentIDTransactionsRequestOrder added in v0.0.23

type GetV1PaymentsPaymentIDTransactionsRequestOrder string
const (
	GetV1PaymentsPaymentIDTransactionsRequestOrderAsc  GetV1PaymentsPaymentIDTransactionsRequestOrder = "asc"
	GetV1PaymentsPaymentIDTransactionsRequestOrderDesc GetV1PaymentsPaymentIDTransactionsRequestOrder = "desc"
)

func NewGetV1PaymentsPaymentIDTransactionsRequestOrderFromString added in v0.0.23

func NewGetV1PaymentsPaymentIDTransactionsRequestOrderFromString(s string) (GetV1PaymentsPaymentIDTransactionsRequestOrder, error)

func (GetV1PaymentsPaymentIDTransactionsRequestOrder) Ptr added in v0.0.23

type GetV1PaymentsRequest

type GetV1PaymentsRequest struct {
	// Sort order (asc/desc)
	Order *GetV1PaymentsRequestOrder `json:"-" url:"order,omitempty"`
	// Limit (default 20, max 100)
	Limit *int `json:"-" url:"limit,omitempty"`
	// Last ID for pagination
	LastID *string `json:"-" url:"lastId,omitempty"`
	// contains filtered or unexported fields
}

func (*GetV1PaymentsRequest) SetLastID

func (g *GetV1PaymentsRequest) SetLastID(lastID *string)

SetLastID sets the LastID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1PaymentsRequest) SetLimit

func (g *GetV1PaymentsRequest) SetLimit(limit *int)

SetLimit sets the Limit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1PaymentsRequest) SetOrder

func (g *GetV1PaymentsRequest) SetOrder(order *GetV1PaymentsRequestOrder)

SetOrder sets the Order field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetV1PaymentsRequestOrder

type GetV1PaymentsRequestOrder string
const (
	GetV1PaymentsRequestOrderAsc  GetV1PaymentsRequestOrder = "asc"
	GetV1PaymentsRequestOrderDesc GetV1PaymentsRequestOrder = "desc"
)

func NewGetV1PaymentsRequestOrderFromString

func NewGetV1PaymentsRequestOrderFromString(s string) (GetV1PaymentsRequestOrder, error)

func (GetV1PaymentsRequestOrder) Ptr

type GetV1PricesResponse added in v0.0.23

type GetV1PricesResponse struct {
	Items []*GetV1PricesResponseItemsItem `json:"items,omitempty" url:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*GetV1PricesResponse) GetExtraProperties added in v0.0.23

func (g *GetV1PricesResponse) GetExtraProperties() map[string]interface{}

func (*GetV1PricesResponse) GetItems added in v0.0.23

func (*GetV1PricesResponse) MarshalJSON added in v0.0.23

func (g *GetV1PricesResponse) MarshalJSON() ([]byte, error)

func (*GetV1PricesResponse) SetItems added in v0.0.23

func (g *GetV1PricesResponse) SetItems(items []*GetV1PricesResponseItemsItem)

SetItems sets the Items field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1PricesResponse) String added in v0.0.23

func (g *GetV1PricesResponse) String() string

func (*GetV1PricesResponse) UnmarshalJSON added in v0.0.23

func (g *GetV1PricesResponse) UnmarshalJSON(data []byte) error

type GetV1PricesResponseItemsItem added in v0.0.23

type GetV1PricesResponseItemsItem struct {
	// Asset group symbol, e.g. USDT, USDC, ETH.
	Group *string `json:"group,omitempty" url:"group,omitempty"`
	// USD price of one whole unit of the asset group.
	PriceUsd *string `json:"priceUsd,omitempty" url:"priceUsd,omitempty"`
	// Unix timestamp (ms) when this price was last refreshed.
	UpdatedAtUnixMs *int64 `json:"updatedAtUnixMs,omitempty" url:"updatedAtUnixMs,omitempty"`
	// contains filtered or unexported fields
}

func (*GetV1PricesResponseItemsItem) GetExtraProperties added in v0.0.23

func (g *GetV1PricesResponseItemsItem) GetExtraProperties() map[string]interface{}

func (*GetV1PricesResponseItemsItem) GetGroup added in v0.0.23

func (g *GetV1PricesResponseItemsItem) GetGroup() *string

func (*GetV1PricesResponseItemsItem) GetPriceUsd added in v0.0.23

func (g *GetV1PricesResponseItemsItem) GetPriceUsd() *string

func (*GetV1PricesResponseItemsItem) GetUpdatedAtUnixMs added in v0.0.23

func (g *GetV1PricesResponseItemsItem) GetUpdatedAtUnixMs() *int64

func (*GetV1PricesResponseItemsItem) MarshalJSON added in v0.0.23

func (g *GetV1PricesResponseItemsItem) MarshalJSON() ([]byte, error)

func (*GetV1PricesResponseItemsItem) SetGroup added in v0.0.23

func (g *GetV1PricesResponseItemsItem) SetGroup(group *string)

SetGroup sets the Group field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1PricesResponseItemsItem) SetPriceUsd added in v0.0.23

func (g *GetV1PricesResponseItemsItem) SetPriceUsd(priceUsd *string)

SetPriceUsd sets the PriceUsd field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1PricesResponseItemsItem) SetUpdatedAtUnixMs added in v0.0.23

func (g *GetV1PricesResponseItemsItem) SetUpdatedAtUnixMs(updatedAtUnixMs *int64)

SetUpdatedAtUnixMs sets the UpdatedAtUnixMs field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1PricesResponseItemsItem) String added in v0.0.23

func (*GetV1PricesResponseItemsItem) UnmarshalJSON added in v0.0.23

func (g *GetV1PricesResponseItemsItem) UnmarshalJSON(data []byte) error

type GetV1StaticWalletsRequest

type GetV1StaticWalletsRequest struct {
	// Sort order (asc/desc)
	Order *GetV1StaticWalletsRequestOrder `json:"-" url:"order,omitempty"`
	// Limit (default 20, max 100)
	Limit *int `json:"-" url:"limit,omitempty"`
	// Last ID for pagination
	LastID *string `json:"-" url:"lastId,omitempty"`
	// contains filtered or unexported fields
}

func (*GetV1StaticWalletsRequest) SetLastID

func (g *GetV1StaticWalletsRequest) SetLastID(lastID *string)

SetLastID sets the LastID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1StaticWalletsRequest) SetLimit

func (g *GetV1StaticWalletsRequest) SetLimit(limit *int)

SetLimit sets the Limit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1StaticWalletsRequest) SetOrder

SetOrder sets the Order field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetV1StaticWalletsRequestOrder

type GetV1StaticWalletsRequestOrder string
const (
	GetV1StaticWalletsRequestOrderAsc  GetV1StaticWalletsRequestOrder = "asc"
	GetV1StaticWalletsRequestOrderDesc GetV1StaticWalletsRequestOrder = "desc"
)

func NewGetV1StaticWalletsRequestOrderFromString

func NewGetV1StaticWalletsRequestOrderFromString(s string) (GetV1StaticWalletsRequestOrder, error)

func (GetV1StaticWalletsRequestOrder) Ptr

type GetV1StaticWalletsStaticWalletIDDepositsDepositIDRequest

type GetV1StaticWalletsStaticWalletIDDepositsDepositIDRequest struct {
	// Static wallet ID
	StaticWalletID string `json:"-" url:"-"`
	// Deposit ID
	DepositID string `json:"-" url:"-"`
	// contains filtered or unexported fields
}

func (*GetV1StaticWalletsStaticWalletIDDepositsDepositIDRequest) SetDepositID

SetDepositID sets the DepositID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1StaticWalletsStaticWalletIDDepositsDepositIDRequest) SetStaticWalletID

func (g *GetV1StaticWalletsStaticWalletIDDepositsDepositIDRequest) SetStaticWalletID(staticWalletID string)

SetStaticWalletID sets the StaticWalletID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetV1StaticWalletsStaticWalletIDDepositsRequest

type GetV1StaticWalletsStaticWalletIDDepositsRequest struct {
	// Static wallet ID
	StaticWalletID string `json:"-" url:"-"`
	// Sort order (asc/desc)
	Order *GetV1StaticWalletsStaticWalletIDDepositsRequestOrder `json:"-" url:"order,omitempty"`
	// Limit (default 20, max 100)
	Limit *int `json:"-" url:"limit,omitempty"`
	// Last ID for pagination
	LastID *string `json:"-" url:"lastId,omitempty"`
	// contains filtered or unexported fields
}

func (*GetV1StaticWalletsStaticWalletIDDepositsRequest) SetLastID

SetLastID sets the LastID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1StaticWalletsStaticWalletIDDepositsRequest) SetLimit

SetLimit sets the Limit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1StaticWalletsStaticWalletIDDepositsRequest) SetOrder

SetOrder sets the Order field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetV1StaticWalletsStaticWalletIDDepositsRequest) SetStaticWalletID

func (g *GetV1StaticWalletsStaticWalletIDDepositsRequest) SetStaticWalletID(staticWalletID string)

SetStaticWalletID sets the StaticWalletID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetV1StaticWalletsStaticWalletIDDepositsRequestOrder

type GetV1StaticWalletsStaticWalletIDDepositsRequestOrder string
const (
	GetV1StaticWalletsStaticWalletIDDepositsRequestOrderAsc  GetV1StaticWalletsStaticWalletIDDepositsRequestOrder = "asc"
	GetV1StaticWalletsStaticWalletIDDepositsRequestOrderDesc GetV1StaticWalletsStaticWalletIDDepositsRequestOrder = "desc"
)

func NewGetV1StaticWalletsStaticWalletIDDepositsRequestOrderFromString

func NewGetV1StaticWalletsStaticWalletIDDepositsRequestOrderFromString(s string) (GetV1StaticWalletsStaticWalletIDDepositsRequestOrder, error)

func (GetV1StaticWalletsStaticWalletIDDepositsRequestOrder) Ptr

type GetV1StaticWalletsStaticWalletIDRequest

type GetV1StaticWalletsStaticWalletIDRequest struct {
	// Static wallet ID
	StaticWalletID string `json:"-" url:"-"`
	// contains filtered or unexported fields
}

func (*GetV1StaticWalletsStaticWalletIDRequest) SetStaticWalletID

func (g *GetV1StaticWalletsStaticWalletIDRequest) SetStaticWalletID(staticWalletID string)

SetStaticWalletID sets the StaticWalletID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type InternalServerError

type InternalServerError struct {
	*core.APIError
	Body *ControllerErrorResponse
}

Internal Server Error

func (*InternalServerError) MarshalJSON

func (i *InternalServerError) MarshalJSON() ([]byte, error)

func (*InternalServerError) UnmarshalJSON

func (i *InternalServerError) UnmarshalJSON(data []byte) error

func (*InternalServerError) Unwrap

func (i *InternalServerError) Unwrap() error

type NotFoundError

type NotFoundError struct {
	*core.APIError
	Body *ControllerErrorResponse
}

Not Found

func (*NotFoundError) MarshalJSON

func (n *NotFoundError) MarshalJSON() ([]byte, error)

func (*NotFoundError) UnmarshalJSON

func (n *NotFoundError) UnmarshalJSON(data []byte) error

func (*NotFoundError) Unwrap

func (n *NotFoundError) Unwrap() error

type PostV1PaymentsPaymentIDActivateRequest

type PostV1PaymentsPaymentIDActivateRequest struct {
	// Payment ID
	PaymentID string `json:"-" url:"-"`
	// contains filtered or unexported fields
}

func (*PostV1PaymentsPaymentIDActivateRequest) SetPaymentID

func (p *PostV1PaymentsPaymentIDActivateRequest) SetPaymentID(paymentID string)

SetPaymentID sets the PaymentID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type PostV1PaymentsPaymentIDCancelRequest

type PostV1PaymentsPaymentIDCancelRequest struct {
	// Payment ID
	PaymentID string `json:"-" url:"-"`
	// contains filtered or unexported fields
}

func (*PostV1PaymentsPaymentIDCancelRequest) SetPaymentID

func (p *PostV1PaymentsPaymentIDCancelRequest) SetPaymentID(paymentID string)

SetPaymentID sets the PaymentID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type UnauthorizedError

type UnauthorizedError struct {
	*core.APIError
	Body *ControllerErrorResponse
}

Unauthorized

func (*UnauthorizedError) MarshalJSON

func (u *UnauthorizedError) MarshalJSON() ([]byte, error)

func (*UnauthorizedError) UnmarshalJSON

func (u *UnauthorizedError) UnmarshalJSON(data []byte) error

func (*UnauthorizedError) Unwrap

func (u *UnauthorizedError) Unwrap() error

type WebhookPaymentEvent

type WebhookPaymentEvent struct {
	// Event type. payment.accepted: safe confirmations reached and the balance was credited (non-final). payment.success: the payment finalized (terminal). payment.failed: the payment failed or expired without a valid payment (terminal).
	Type WebhookPaymentEventType `json:"type" url:"type"`
	// Unique identifier of this event. The same event may be redelivered on retry; use eventId to deduplicate.
	EventID string `json:"eventId" url:"eventId"`
	// Event creation time, unix milliseconds.
	CreatedAt int64 `json:"createdAt" url:"createdAt"`
	// Full payment resource at the time of the event — the same shape as the merchant GET /v1/payments/{paymentId} view.
	Payment *CryptopayPaymentResponse `json:"payment" url:"payment"`
	// contains filtered or unexported fields
}

func (*WebhookPaymentEvent) GetCreatedAt

func (w *WebhookPaymentEvent) GetCreatedAt() int64

func (*WebhookPaymentEvent) GetEventID

func (w *WebhookPaymentEvent) GetEventID() string

func (*WebhookPaymentEvent) GetExtraProperties

func (w *WebhookPaymentEvent) GetExtraProperties() map[string]interface{}

func (*WebhookPaymentEvent) GetPayment

func (*WebhookPaymentEvent) GetType

func (*WebhookPaymentEvent) MarshalJSON

func (w *WebhookPaymentEvent) MarshalJSON() ([]byte, error)

func (*WebhookPaymentEvent) SetCreatedAt

func (w *WebhookPaymentEvent) SetCreatedAt(createdAt int64)

SetCreatedAt sets the CreatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*WebhookPaymentEvent) SetEventID

func (w *WebhookPaymentEvent) SetEventID(eventID string)

SetEventID sets the EventID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*WebhookPaymentEvent) SetPayment

func (w *WebhookPaymentEvent) SetPayment(payment *CryptopayPaymentResponse)

SetPayment sets the Payment field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*WebhookPaymentEvent) SetType

func (w *WebhookPaymentEvent) SetType(type_ WebhookPaymentEventType)

SetType sets the Type field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*WebhookPaymentEvent) String

func (w *WebhookPaymentEvent) String() string

func (*WebhookPaymentEvent) UnmarshalJSON

func (w *WebhookPaymentEvent) UnmarshalJSON(data []byte) error

type WebhookPaymentEventType

type WebhookPaymentEventType string

Event type. payment.accepted: safe confirmations reached and the balance was credited (non-final). payment.success: the payment finalized (terminal). payment.failed: the payment failed or expired without a valid payment (terminal).

const (
	WebhookPaymentEventTypePaymentAccepted WebhookPaymentEventType = "payment.accepted"
	WebhookPaymentEventTypePaymentSuccess  WebhookPaymentEventType = "payment.success"
	WebhookPaymentEventTypePaymentFailed   WebhookPaymentEventType = "payment.failed"
)

func NewWebhookPaymentEventTypeFromString

func NewWebhookPaymentEventTypeFromString(s string) (WebhookPaymentEventType, error)

func (WebhookPaymentEventType) Ptr

type WebhookStaticDepositEvent

type WebhookStaticDepositEvent struct {
	// Event type. static_deposit.accepted: the deposit reached safe confirmations and was credited (non-final). static_deposit.success: the deposit finalized (terminal).
	Type WebhookStaticDepositEventType `json:"type" url:"type"`
	// Unique identifier of this event. The same event may be redelivered on retry; use eventId to deduplicate.
	EventID string `json:"eventId" url:"eventId"`
	// Event creation time, unix milliseconds.
	CreatedAt int64 `json:"createdAt" url:"createdAt"`
	// Full static-wallet deposit resource at the time of the event.
	StaticDeposit *CryptopayStaticDepositResponse `json:"staticDeposit" url:"staticDeposit"`
	// contains filtered or unexported fields
}

func (*WebhookStaticDepositEvent) GetCreatedAt

func (w *WebhookStaticDepositEvent) GetCreatedAt() int64

func (*WebhookStaticDepositEvent) GetEventID

func (w *WebhookStaticDepositEvent) GetEventID() string

func (*WebhookStaticDepositEvent) GetExtraProperties

func (w *WebhookStaticDepositEvent) GetExtraProperties() map[string]interface{}

func (*WebhookStaticDepositEvent) GetStaticDeposit

func (*WebhookStaticDepositEvent) GetType

func (*WebhookStaticDepositEvent) MarshalJSON

func (w *WebhookStaticDepositEvent) MarshalJSON() ([]byte, error)

func (*WebhookStaticDepositEvent) SetCreatedAt

func (w *WebhookStaticDepositEvent) SetCreatedAt(createdAt int64)

SetCreatedAt sets the CreatedAt field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*WebhookStaticDepositEvent) SetEventID

func (w *WebhookStaticDepositEvent) SetEventID(eventID string)

SetEventID sets the EventID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*WebhookStaticDepositEvent) SetStaticDeposit

func (w *WebhookStaticDepositEvent) SetStaticDeposit(staticDeposit *CryptopayStaticDepositResponse)

SetStaticDeposit sets the StaticDeposit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*WebhookStaticDepositEvent) SetType

SetType sets the Type field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*WebhookStaticDepositEvent) String

func (w *WebhookStaticDepositEvent) String() string

func (*WebhookStaticDepositEvent) UnmarshalJSON

func (w *WebhookStaticDepositEvent) UnmarshalJSON(data []byte) error

type WebhookStaticDepositEventType

type WebhookStaticDepositEventType string

Event type. static_deposit.accepted: the deposit reached safe confirmations and was credited (non-final). static_deposit.success: the deposit finalized (terminal).

const (
	WebhookStaticDepositEventTypeStaticDepositAccepted WebhookStaticDepositEventType = "static_deposit.accepted"
	WebhookStaticDepositEventTypeStaticDepositSuccess  WebhookStaticDepositEventType = "static_deposit.success"
)

func NewWebhookStaticDepositEventTypeFromString

func NewWebhookStaticDepositEventTypeFromString(s string) (WebhookStaticDepositEventType, error)

func (WebhookStaticDepositEventType) Ptr

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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