Documentation
¶
Index ¶
- type AuthenticatedClient
- type AuthenticatedClientOption
- type Client
- type ClientOption
- type Grant
- type GrantCancelParams
- type GrantContinueParams
- type GrantRequestParams
- type GrantService
- type IncomingPaymentCompleteParams
- type IncomingPaymentCreateParams
- type IncomingPaymentGetParams
- type IncomingPaymentGetPublicParams
- type IncomingPaymentListParams
- type IncomingPaymentListResponse
- type IncomingPaymentService
- func (ip *IncomingPaymentService) Complete(ctx context.Context, params IncomingPaymentCompleteParams) (rs.IncomingPaymentWithMethods, error)
- func (ip *IncomingPaymentService) Create(ctx context.Context, params IncomingPaymentCreateParams) (rs.IncomingPaymentWithMethods, error)
- func (ip *IncomingPaymentService) Get(ctx context.Context, params IncomingPaymentGetParams) (rs.IncomingPaymentWithMethods, error)
- func (ip *IncomingPaymentService) GetPublic(ctx context.Context, params IncomingPaymentGetPublicParams) (rs.PublicIncomingPayment, error)
- func (ip *IncomingPaymentService) List(ctx context.Context, params IncomingPaymentListParams) (*IncomingPaymentListResponse, error)
- type OpenPaymentsClientError
- type OutgoingPaymentCreateParams
- type OutgoingPaymentGetParams
- type OutgoingPaymentGrantGetParams
- type OutgoingPaymentGrantSpentAmounts
- type OutgoingPaymentListParams
- type OutgoingPaymentListResponse
- type OutgoingPaymentService
- func (op *OutgoingPaymentService) Create(ctx context.Context, params OutgoingPaymentCreateParams) (rs.OutgoingPaymentWithSpentAmounts, error)
- func (op *OutgoingPaymentService) Get(ctx context.Context, params OutgoingPaymentGetParams) (rs.OutgoingPayment, error)
- func (op *OutgoingPaymentService) GetGrantSpentAmounts(ctx context.Context, params OutgoingPaymentGrantGetParams) (OutgoingPaymentGrantSpentAmounts, error)
- func (op *OutgoingPaymentService) List(ctx context.Context, params OutgoingPaymentListParams) (*OutgoingPaymentListResponse, error)
- type Pagination
- type PublicIncomingPaymentService
- type QuoteCreateParams
- type QuoteGetParams
- type QuoteService
- type RequestDoer
- type TokenRevokeParams
- type TokenRotateParams
- type TokenService
- type WalletAddressGetKeysParams
- type WalletAddressGetParams
- type WalletAddressService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticatedClient ¶
type AuthenticatedClient struct {
WalletAddress *WalletAddressService
Grant *GrantService
IncomingPayment *IncomingPaymentService
Quote *QuoteService
Token *TokenService
OutgoingPayment *OutgoingPaymentService
// contains filtered or unexported fields
}
func NewAuthenticatedClient ¶
func NewAuthenticatedClient(walletAddressUrl string, privateKey string, keyId string, opts ...AuthenticatedClientOption) (*AuthenticatedClient, error)
type AuthenticatedClientOption ¶
type AuthenticatedClientOption func(*AuthenticatedClient)
AuthenticatedClientOption is used to configure optional behavior for the authenticated client.
func WithHTTPClientAuthed ¶
func WithHTTPClientAuthed(c *http.Client) AuthenticatedClientOption
WithHTTPClientAuthed allows setting a custom HTTP client.
WARNING: Use with care. Replacing the internal http.Client could break built-in behavior.
func WithPostSignHook ¶
func WithPostSignHook(hook func(req *http.Request)) AuthenticatedClientOption
func WithPreSignHook ¶
func WithPreSignHook(hook func(req *http.Request)) AuthenticatedClientOption
type Client ¶
type Client struct {
WalletAddress *WalletAddressService
IncomingPayment *PublicIncomingPaymentService
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is used to configure optional behavior for the Open Payments client.
func WithHTTPClientUnauthed ¶
func WithHTTPClientUnauthed(c *http.Client) ClientOption
WithHTTPClientUnauthed allows setting a custom HTTP client.
WARNING: Use with care. Replacing the internal http.Client could break built-in behavior.
type Grant ¶
type Grant struct {
Interact *as.InteractResponse `json:"interact,omitempty"`
AccessToken *as.AccessToken `json:"access_token,omitempty"`
Subject *as.Subject `json:"subject,omitempty"`
Continue as.Continue `json:"continue"`
}
TODO: Address missing grant request type in generated types. This re-constructs from the generated types therefore is prone to drift from OpenAPI spec.
func (*Grant) IsGrantedWithAccessToken ¶
IsGrantedWithAccessToken reports whether the grant contains an access token.
func (*Grant) IsGrantedWithSubject ¶
IsGrantedWithSubject reports whether the grant contains subject information.
func (*Grant) IsInteractive ¶
type GrantCancelParams ¶
type GrantContinueParams ¶
type GrantRequestParams ¶
type GrantRequestParams struct {
URL string // Auth server URL
RequestBody as.GrantRequest
// ClientOverride, when set, replaces the default wallet-address client
// identification with a JWK (directed identity). Per spec, only valid for
// non-interactive grants (e.g. incoming payments).
ClientOverride *as.ClientDirectedIdentity
}
type GrantService ¶
type GrantService struct {
DoSigned RequestDoer
// contains filtered or unexported fields
}
func (*GrantService) Cancel ¶
func (gs *GrantService) Cancel(ctx context.Context, params GrantCancelParams) error
func (*GrantService) Continue ¶
func (gs *GrantService) Continue(ctx context.Context, params GrantContinueParams) (Grant, error)
func (*GrantService) Request ¶
func (gs *GrantService) Request(ctx context.Context, params GrantRequestParams) (Grant, error)
type IncomingPaymentCreateParams ¶
type IncomingPaymentCreateParams struct {
BaseURL string // The base URL for creating an incoming payment
AccessToken string
Payload rs.CreateIncomingPaymentRequest
}
type IncomingPaymentGetPublicParams ¶
type IncomingPaymentGetPublicParams struct {
URL string // The full URL of the public incoming payment resource.
}
type IncomingPaymentListParams ¶
type IncomingPaymentListParams struct {
BaseURL string // The base URL for the incoming payments collection.
AccessToken string
WalletAddress string
Pagination Pagination
}
type IncomingPaymentListResponse ¶
type IncomingPaymentListResponse struct {
Pagination rs.PageInfo `json:"pagination"`
Result []rs.IncomingPaymentWithMethods `json:"result"`
}
type IncomingPaymentService ¶
type IncomingPaymentService struct {
DoUnsigned RequestDoer
DoSigned RequestDoer
}
func (*IncomingPaymentService) Complete ¶
func (ip *IncomingPaymentService) Complete(ctx context.Context, params IncomingPaymentCompleteParams) (rs.IncomingPaymentWithMethods, error)
func (*IncomingPaymentService) Create ¶
func (ip *IncomingPaymentService) Create(ctx context.Context, params IncomingPaymentCreateParams) (rs.IncomingPaymentWithMethods, error)
TODO: should Create handle adding /incoming-paymnets or nah? php and rust do, ts doesnt
func (*IncomingPaymentService) Get ¶
func (ip *IncomingPaymentService) Get(ctx context.Context, params IncomingPaymentGetParams) (rs.IncomingPaymentWithMethods, error)
func (*IncomingPaymentService) GetPublic ¶
func (ip *IncomingPaymentService) GetPublic(ctx context.Context, params IncomingPaymentGetPublicParams) (rs.PublicIncomingPayment, error)
func (*IncomingPaymentService) List ¶
func (ip *IncomingPaymentService) List(ctx context.Context, params IncomingPaymentListParams) (*IncomingPaymentListResponse, error)
type OpenPaymentsClientError ¶
type OpenPaymentsClientError struct {
Description string
Status int
Code string
ValidationErrors []string
Details map[string]any
Method string
URL string
}
func (*OpenPaymentsClientError) Error ¶
func (e *OpenPaymentsClientError) Error() string
type OutgoingPaymentCreateParams ¶
type OutgoingPaymentCreateParams struct {
BaseURL string // The base URL for creating an outgoing payment
AccessToken string
Payload rs.CreateOutgoingPaymentRequest
}
type OutgoingPaymentListParams ¶
type OutgoingPaymentListParams struct {
BaseURL string // The base URL for the outgoing payments collection.
AccessToken string
WalletAddress string
Pagination Pagination
}
type OutgoingPaymentListResponse ¶
type OutgoingPaymentListResponse struct {
Pagination rs.PageInfo `json:"pagination"`
Result []rs.OutgoingPayment `json:"result"`
}
type OutgoingPaymentService ¶
type OutgoingPaymentService struct {
DoSigned RequestDoer
}
func (*OutgoingPaymentService) Create ¶
func (op *OutgoingPaymentService) Create(ctx context.Context, params OutgoingPaymentCreateParams) (rs.OutgoingPaymentWithSpentAmounts, error)
TODO: ensure this works with/without quoteId in the params.payload
func (*OutgoingPaymentService) Get ¶
func (op *OutgoingPaymentService) Get(ctx context.Context, params OutgoingPaymentGetParams) (rs.OutgoingPayment, error)
func (*OutgoingPaymentService) GetGrantSpentAmounts ¶
func (op *OutgoingPaymentService) GetGrantSpentAmounts(ctx context.Context, params OutgoingPaymentGrantGetParams) (OutgoingPaymentGrantSpentAmounts, error)
func (*OutgoingPaymentService) List ¶
func (op *OutgoingPaymentService) List(ctx context.Context, params OutgoingPaymentListParams) (*OutgoingPaymentListResponse, error)
type Pagination ¶
type PublicIncomingPaymentService ¶
type PublicIncomingPaymentService struct {
DoUnsigned RequestDoer
}
func (*PublicIncomingPaymentService) GetPublic ¶
func (pp *PublicIncomingPaymentService) GetPublic(ctx context.Context, params IncomingPaymentGetPublicParams) (rs.PublicIncomingPayment, error)
type QuoteCreateParams ¶
type QuoteCreateParams struct {
BaseURL string // The base URL for creating a quote (e.g., wallet address URL).
AccessToken string
// TODO: cant use rs.CreateQuoteRequest (unexported `union`). Consumers should pass one of
// the named variants directly: rs.CreateQuoteRequestByReceiver, rs.CreateQuoteRequestWithReceiveAmount,
// or rs.CreateQuoteRequestWithDebitAmount.
Payload any
}
type QuoteGetParams ¶
type QuoteService ¶
type QuoteService struct {
DoUnsigned RequestDoer
DoSigned RequestDoer
}
func (*QuoteService) Create ¶
func (qs *QuoteService) Create(ctx context.Context, params QuoteCreateParams) (rs.Quote, error)
func (*QuoteService) Get ¶
func (qs *QuoteService) Get(ctx context.Context, params QuoteGetParams) (rs.Quote, error)
type TokenRevokeParams ¶
type TokenRotateParams ¶
type TokenService ¶
type TokenService struct {
DoSigned RequestDoer
}
func (*TokenService) Revoke ¶
func (ts *TokenService) Revoke(ctx context.Context, params TokenRevokeParams) error
func (*TokenService) Rotate ¶
func (ts *TokenService) Rotate(ctx context.Context, params TokenRotateParams) (as.AccessToken, error)
type WalletAddressGetKeysParams ¶
type WalletAddressGetKeysParams struct {
URL string // The full URL of the wallet address resource.
}
type WalletAddressGetParams ¶
type WalletAddressGetParams struct {
URL string // The full URL of the wallet address resource.
}
type WalletAddressService ¶
type WalletAddressService struct {
DoUnsigned RequestDoer
}
func (*WalletAddressService) Get ¶
func (wa *WalletAddressService) Get(ctx context.Context, params WalletAddressGetParams) (was.WalletAddress, error)
func (*WalletAddressService) GetKeys ¶
func (wa *WalletAddressService) GetKeys(ctx context.Context, params WalletAddressGetKeysParams) (was.JsonWebKeySet, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
authserver
Package api provides primitives to interact with the openapi HTTP API.
|
Package api provides primitives to interact with the openapi HTTP API. |
|
resourceserver
Package api provides primitives to interact with the openapi HTTP API.
|
Package api provides primitives to interact with the openapi HTTP API. |
|
walletaddressserver
Package api provides primitives to interact with the openapi HTTP API.
|
Package api provides primitives to interact with the openapi HTTP API. |
|
TODO ts client has key and jwk files.
|
TODO ts client has key and jwk files. |
|
internal
|
|
|
scripts/release
command
|
|
|
test
|
|