Documentation ¶
Index ¶
- func CheckResponse(r *http.Response) error
- type AccountService
- func (s *AccountService) Get(id string) (*types.Account, *Response, error)
- func (s *AccountService) GetBalance(id string) (*types.Balance, *Response, error)
- func (s *AccountService) GetFees(accountID string, feeType string) (*types.Fee, *Response, error)
- func (s *AccountService) GetStatement(id string) ([]types.Statement, *Response, error)
- func (s *AccountService) GetStatementEntry(id string) (*types.Statement, *Response, error)
- func (s *AccountService) List() ([]types.Account, *Response, error)
- func (s *AccountService) ListFees(accountID string) ([]types.Fee, *Response, error)
- type Client
- func (c *Client) AddAccountIdHeader(req *http.Request, accountId string) error
- func (c *Client) AddIdempotencyHeader(req *http.Request, idempotencyKey string) error
- func (c *Client) ApplyOpts(opts ...ClientOpt)
- func (c *Client) Authenticate() error
- func (c *Client) ConsentLink(sessionID string) (string, error)
- func (c *Client) DecryptAndValidateWebhook(encryptedJWE string) ([]byte, error)
- func (c *Client) DecryptJWE(encryptedBody string) ([]byte, error)
- func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)
- func (c *Client) NewAPIRequest(method, pathStr string, body interface{}) (*http.Request, error)
- type ClientOpt
- func EnableDebug() ClientOpt
- func SetAccountURL(newAccountUrl string) (ClientOpt, error)
- func SetBaseURL(newBaseUrl string) (ClientOpt, error)
- func SetConsentURL(url string) ClientOpt
- func SetUserAgent(ua string) ClientOpt
- func UseSandbox() ClientOpt
- func WithClientID(key string) ClientOpt
- func WithHttpClient(hc http.Client) ClientOpt
- func WithPEMPrivateKey(pk []byte) ClientOpt
- type ErrorResponse
- type InstitutionContext
- type InstitutionService
- type PIXService
- func (s *PIXService) ConfirmPedingPayment(input types.ConfirmPendingPaymentInput, idempotencyKey, pixID string) (*Response, error)
- func (s *PIXService) CreateDynamicQRCode(input types.CreateDynamicQRCodeInput, idempotencyKey string) (*types.PIXInvoiceOutput, *Response, error)
- func (s *PIXService) CreatePedingPayment(input types.CreatePedingPaymentInput, idempotencyKey string) (*types.PendingPaymentOutput, *Response, error)
- func (s *PIXService) GetEntries(accountID string) (*types.AllPixEntries, *Response, error)
- func (s *PIXService) GetOutboundPix(id string) (*types.PIXOutBoundOutput, *Response, error)
- func (s *PIXService) GetQRCodeData(input types.GetQRCodeInput) (*types.QRCode, *Response, error)
- func (s *PIXService) ListDynamicQRCodes(accountID string) ([]types.QRCodeDynamic, *Response, error)
- func (s *PIXService) ListKeys(accountID string) ([]types.PIXKey, *Response, error)
- type PaymentInvoiceService
- func (s *PaymentInvoiceService) Cancel(paymentInvoiceID string) (*Response, error)
- func (s *PaymentInvoiceService) Get(paymentInvoiceID string) (types.PaymentInvoice, *Response, error)
- func (s *PaymentInvoiceService) List(accountID string) ([]types.PaymentInvoice, *Response, error)
- func (s *PaymentInvoiceService) PaymentInvoice(input types.PaymentInvoiceInput, idempotencyKey string) (*types.PaymentInvoice, *Response, error)
- type PaymentLinkService
- func (s *PaymentLinkService) Cancel(orderID string, input types.PaymentLinkCancelInput) (types.PaymentLink, *Response, error)
- func (s *PaymentLinkService) Create(input types.PaymentLinkInput) (types.PaymentLink, *Response, error)
- func (s *PaymentLinkService) Get(accountID, orderID string) (types.PaymentLink, *Response, error)
- type Response
- type TopUpsService
- type TransferError
- type TransferService
- func (s *TransferService) CancelExternal(transferID string) (*Response, error)
- func (s *TransferService) CancelInternal(transferID string) (*Response, error)
- func (s *TransferService) DryRunTransfer(input types.TransferInput, idempotencyKey string) (*types.Transfer, *Response, error)
- func (s *TransferService) GetExternal(transferID string) (*types.Transfer, *Response, error)
- func (s *TransferService) GetInternal(transferID string) (*types.Transfer, *Response, error)
- func (s *TransferService) ListExternal(accountID string) ([]types.Transfer, *Response, error)
- func (s *TransferService) ListInternal(accountID string) ([]types.Transfer, *Response, error)
- func (s *TransferService) Transfer(input types.TransferInput, idempotencyKey string) (*types.Transfer, *Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
Types ¶
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
AccountService handles communication with Stone Openbank API
func (*AccountService) GetBalance ¶
Get Account Balance
func (*AccountService) GetStatement ¶
Get Account Statement
func (*AccountService) GetStatementEntry ¶
Get Statement Entry
type Client ¶
type Client struct { AccountURL *url.URL ApiBaseURL *url.URL StonePublicKeys types.StonePublicKeys ClientID string ConsentRedirectURL string Sandbox bool UserAgent string //Services used for comunicating with API Institution *InstitutionService Account *AccountService Transfer *TransferService PaymentInvoice *PaymentInvoiceService PIXService *PIXService PaymentLink *PaymentLinkService TopUpsService *TopUpsService // contains filtered or unexported fields }
func (*Client) AddAccountIdHeader ¶ added in v1.1.4
AddAccountIdHeader add in request the header used in some pix operations and maybe others
func (*Client) AddIdempotencyHeader ¶ added in v1.1.4
AddIdempotencyHeader add in request the header used to realize idempotent operations
func (*Client) Authenticate ¶
func (*Client) DecryptAndValidateWebhook ¶
type ClientOpt ¶
type ClientOpt func(*Client)
func EnableDebug ¶
func EnableDebug() ClientOpt
func SetAccountURL ¶ added in v1.0.5
func SetBaseURL ¶ added in v1.0.5
func SetConsentURL ¶
func SetUserAgent ¶
func UseSandbox ¶
func UseSandbox() ClientOpt
func WithClientID ¶
func WithHttpClient ¶
func WithPEMPrivateKey ¶
type ErrorResponse ¶
type ErrorResponse struct { // HTTP response that caused this error Response *http.Response // Error message Message string `json:"message"` // RequestID returned from the API, useful to contact support. RequestID string `json:"request_id"` TransferError TransferError `json:"transfer_error"` }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type InstitutionContext ¶ added in v1.1.0
type InstitutionContext string
const ( AllInstitutions InstitutionContext = "all" SPIParticipants InstitutionContext = "spi" STRParticipants InstitutionContext = "str" )
type InstitutionService ¶ added in v1.1.0
type InstitutionService struct {
// contains filtered or unexported fields
}
func (InstitutionService) Get ¶ added in v1.1.0
func (s InstitutionService) Get(context string) (*types.Institution, *Response, error)
Get institution info
func (InstitutionService) List ¶ added in v1.1.0
func (s InstitutionService) List(context InstitutionContext) ([]types.Institution, *Response, error)
List institutions
type PIXService ¶ added in v1.1.4
type PIXService struct {
// contains filtered or unexported fields
}
PIXService handles communication with Stone Openbank API
func (*PIXService) ConfirmPedingPayment ¶ added in v1.2.0
func (s *PIXService) ConfirmPedingPayment(input types.ConfirmPendingPaymentInput, idempotencyKey, pixID string) (*Response, error)
ConfirmPedingPayment is a service used to confirm a pending payment.
func (*PIXService) CreateDynamicQRCode ¶ added in v1.2.0
func (s *PIXService) CreateDynamicQRCode(input types.CreateDynamicQRCodeInput, idempotencyKey string) (*types.PIXInvoiceOutput, *Response, error)
CreateDynamicQRCode make a bar code payment invoice
func (*PIXService) CreatePedingPayment ¶ added in v1.2.0
func (s *PIXService) CreatePedingPayment(input types.CreatePedingPaymentInput, idempotencyKey string) (*types.PendingPaymentOutput, *Response, error)
CreatePedingPayment is a service used to create a pending payment.
func (*PIXService) GetEntries ¶ added in v1.2.0
func (s *PIXService) GetEntries(accountID string) (*types.AllPixEntries, *Response, error)
GetEntries is a service used to retrieve all Pix entries of a given account.
func (*PIXService) GetOutboundPix ¶ added in v1.1.4
func (s *PIXService) GetOutboundPix(id string) (*types.PIXOutBoundOutput, *Response, error)
GetOutboundPix is a service used to retrieve information details from a Pix.
func (*PIXService) GetQRCodeData ¶ added in v1.1.4
func (s *PIXService) GetQRCodeData(input types.GetQRCodeInput) (*types.QRCode, *Response, error)
GetQRCodeData is a service used to retrieve information details from a Pix QRCode.
func (*PIXService) ListDynamicQRCodes ¶ added in v1.1.4
func (s *PIXService) ListDynamicQRCodes(accountID string) ([]types.QRCodeDynamic, *Response, error)
ListQRCodeDynamic list the dynamic qrcodes of an account
type PaymentInvoiceService ¶
type PaymentInvoiceService struct {
// contains filtered or unexported fields
}
PaymentInvoiceService handlers communication with Stone Openbank API
func (*PaymentInvoiceService) Cancel ¶ added in v1.1.4
func (s *PaymentInvoiceService) Cancel(paymentInvoiceID string) (*Response, error)
func (*PaymentInvoiceService) Get ¶
func (s *PaymentInvoiceService) Get(paymentInvoiceID string) (types.PaymentInvoice, *Response, error)
Get return a PaymentInvoice
func (*PaymentInvoiceService) List ¶
func (s *PaymentInvoiceService) List(accountID string) ([]types.PaymentInvoice, *Response, error)
List returns a list of PaymentInvoices
func (*PaymentInvoiceService) PaymentInvoice ¶
func (s *PaymentInvoiceService) PaymentInvoice(input types.PaymentInvoiceInput, idempotencyKey string) (*types.PaymentInvoice, *Response, error)
PaymentInvoice make a bar code payment invoice
type PaymentLinkService ¶ added in v1.1.4
type PaymentLinkService struct {
// contains filtered or unexported fields
}
func (*PaymentLinkService) Cancel ¶ added in v1.1.4
func (s *PaymentLinkService) Cancel(orderID string, input types.PaymentLinkCancelInput) (types.PaymentLink, *Response, error)
func (*PaymentLinkService) Create ¶ added in v1.1.4
func (s *PaymentLinkService) Create(input types.PaymentLinkInput) (types.PaymentLink, *Response, error)
func (*PaymentLinkService) Get ¶ added in v1.1.4
func (s *PaymentLinkService) Get(accountID, orderID string) (types.PaymentLink, *Response, error)
type TopUpsService ¶ added in v1.1.4
type TopUpsService struct {
// contains filtered or unexported fields
}
TopUpsService handles communication with Stone Openbank API
func (*TopUpsService) GetValuesFromGameProvider ¶ added in v1.1.4
GetValuesFromGameProvider list all values from a game provider
func (*TopUpsService) ListGameProviders ¶ added in v1.1.4
func (s *TopUpsService) ListGameProviders() (*types.Providers, *Response, error)
ListGameProviders list all game providers
type TransferError ¶ added in v1.0.2
type TransferError struct { Type string `json:"type,omitempty"` ValidationErrors []struct { Error string `json:"error,omitempty"` Path []string `json:"path,omitempty"` } `json:"validation_errors,omitempty"` Reason []struct { Error string `json:"error,omitempty"` Path []string `json:"path,omitempty"` } `json:"reason,omitempty"` }
type TransferService ¶
type TransferService struct {
// contains filtered or unexported fields
}
TransferService handles communication with Stone Openbank API
func (*TransferService) CancelExternal ¶
func (s *TransferService) CancelExternal(transferID string) (*Response, error)
CancelExternal cancels a scheduled external transference
func (*TransferService) CancelInternal ¶
func (s *TransferService) CancelInternal(transferID string) (*Response, error)
CancelInternal cancels a scheduled internal transference
func (*TransferService) DryRunTransfer ¶
func (s *TransferService) DryRunTransfer(input types.TransferInput, idempotencyKey string) (*types.Transfer, *Response, error)
DryRunTransfer simulate an Internal or External Transfer
func (*TransferService) GetExternal ¶
GetExternal returns an external transfer
func (*TransferService) GetInternal ¶
GetInternal returns an internal transfer
func (*TransferService) ListExternal ¶
ListExternal returns a list of external_transfers
func (*TransferService) ListInternal ¶
ListInternal returns a list of internal_transfers
func (*TransferService) Transfer ¶
func (s *TransferService) Transfer(input types.TransferInput, idempotencyKey string) (*types.Transfer, *Response, error)
Transfer makes Internal or External Transfer