Documentation ¶
Overview ¶
Package qvapay is the no-official qvapay apps SDK for Go. Use it to interact with the Qvapay API. Examples can be found at https://github.com/kenriortega/qvapay-go/tree/main/examples If you find an issue with the SDK, please report through https://github.com/kenriortega/qvapay-go/issues/new
https://documenter.getpostman.com/view/8765260/TzzHnDGw#55629b48-821c-49cf-af14-ce76cfe0d65f
Index ¶
- Constants
- func DrainBody(respBody io.ReadCloser)
- func HandleAPIErrorResponse(response string) error
- func ParseUrlQueryParams(query QueryParams, requestUrl *url.URL)
- type APIError
- type APIQueryParams
- type App
- type AppInfoResponse
- type IQvaPay
- type InvoiceResponse
- type Options
- type Owner
- type PaymentAppClient
- type QueryParams
- type QvaClient
- type TransPortAuthBasic
- type Transaction
- type TransactionPaidBy
- type TransactionReponse
- type TransactionsResponse
Constants ¶
View Source
const ( ApiVersion = "v1" BaseURL = "https://qvapay.com/api" )
View Source
const ( RouteInfo = "info" RouteInvoice = "create_invoice" RouteTxs = "transactions" RouteTx = "transaction" RouteBalance = "balance" )
Variables ¶
This section is empty.
Functions ¶
func DrainBody ¶ added in v0.2.0
func DrainBody(respBody io.ReadCloser)
func HandleAPIErrorResponse ¶ added in v0.3.0
func ParseUrlQueryParams ¶ added in v0.3.0
func ParseUrlQueryParams(query QueryParams, requestUrl *url.URL)
ParseUrlQueryParams ...
Types ¶
type APIError ¶ added in v0.3.0
type APIError struct {
ErrorMessage interface{} `json:"error"`
}
APIError is used to describe errors from the API. See https://docs.blockfrost.io/#section/Errors
type APIQueryParams ¶
type APIQueryParams struct {
Page int
}
type App ¶
type App struct { UserID int `json:"user_id,omitempty"` Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` Desc string `json:"desc,omitempty"` Callback string `json:"callback,omitempty"` Logo string `json:"logo,omitempty"` Uuid string `json:"uuid,omitempty"` Active int `json:"active,omitempty"` Enabled int `json:"enabled,omitempty"` }
App object
type AppInfoResponse ¶
type AppInfoResponse struct { UserID int `json:"user_id,omitempty"` Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` Desc string `json:"desc,omitempty"` Callback string `json:"callback,omitempty"` Logo string `json:"logo,omitempty"` Uuid string `json:"uuid,omitempty"` Active int `json:"active,omitempty"` Enabled int `json:"enabled,omitempty"` Secret string `json:"secret,omitempty"` }
AppInfoResponse it`s an object that show general datail about your app
func (*AppInfoResponse) ToJSON ¶ added in v0.2.0
func (ai *AppInfoResponse) ToJSON() string
ToJSON ...
type IQvaPay ¶ added in v0.3.0
type IQvaPay interface { // GetInfo returns the corresponding object info on fetch call, or an error. GetInfo(ctx context.Context) (*AppInfoResponse, error) // CreateInvoice ... CreateInvoice( ctx context.Context, amount float64, description string, remoteID string, ) (*InvoiceResponse, error) // GetTransactions ... GetTransactions(ctx context.Context, query APIQueryParams) (*TransactionsResponse, error) // GetTransaction ... GetTransaction(ctx context.Context, id string) (*TransactionReponse, error) // GetBalance ... GetBalance(ctx context.Context) (float64, error) // Offers ... Offers(ctx context.Context, query QueryParams) (map[string]any, error) }
type InvoiceResponse ¶
type InvoiceResponse struct { AppID string `json:"app_id,omitempty"` Amount string `json:"amount,omitempty"` Desciption string `json:"desciption,omitempty"` RemoteID string `json:"remote_id,omitempty"` Signed string `json:"signed,omitempty"` TransactionUUID string `json:"transation_uuid,omitempty"` // report typo miss c (transaction_uuid) URL string `json:"url,omitempty"` SignedUrl string `json:"signedUrl,omitempty"` }
InvoiceResponse object
func (*InvoiceResponse) ToJSON ¶ added in v0.2.0
func (i *InvoiceResponse) ToJSON() string
type Owner ¶
type Owner struct { ID string `json:"uuid,omitempty"` Username string `json:"username,omitempty"` Name string `json:"name,omitempty"` Lastname string `json:"lastname,omitempty"` Logo string `json:"logo,omitempty"` }
Owner object
type PaymentAppClient ¶ added in v0.3.0
type PaymentAppClient interface { IQvaPay }
PaymentAppClient is an interface that implements https://qvapay.com/api
func NewPaymentAppClient ¶ added in v0.3.0
func NewPaymentAppClient( opts Options, ) PaymentAppClient
type QvaClient ¶ added in v0.3.0
type QvaClient interface { IQvaPay }
QvaClient is an interface that implements some method for Qvapay
type TransPortAuthBasic ¶ added in v0.3.0
type TransPortAuthBasic struct { Transport http.RoundTripper Token string }
type Transaction ¶
type Transaction struct { ID string `json:"uuid,omitempty"` UserID int `json:"user_id,omitempty"` AppID int `json:"app_id,omitempty"` Amount string `json:"amount,omitempty"` Description string `json:"description,omitempty"` RemoteID string `json:"remote_id,omitempty"` Status string `json:"status,omitempty"` PaidByUserID int `json:"paid_by_user_id,omitempty"` Signed int `json:"signed,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` }
Transaction object
type TransactionPaidBy ¶
type TransactionPaidBy struct { Name string `json:"name,omitempty"` Logo string `json:"logo,omitempty"` }
TransactionPaidBy object
type TransactionReponse ¶
type TransactionReponse struct { ID string `json:"uuid,omitempty"` UserID int `json:"user_id,omitempty"` AppID int `json:"app_id,omitempty"` Amount string `json:"amount,omitempty"` Description string `json:"description,omitempty"` RemoteID string `json:"remote_id,omitempty"` Status string `json:"status,omitempty"` PaidByUserID int `json:"paid_by_user_id,omitempty"` Signed int `json:"signed,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` TransactionPaidBy `json:"paid_by,omitempty"` App `json:"app,omitempty"` Owner `json:"owner,omitempty"` }
TransactionReponse object
func (*TransactionReponse) ToJSON ¶ added in v0.2.0
func (tx *TransactionReponse) ToJSON() string
type TransactionsResponse ¶
type TransactionsResponse struct { CurrentPage int `json:"current_page,omitempty"` Data []Transaction `json:"data,omitempty"` FristPageURL string `json:"frist_page_url,omitempty"` From int `json:"from,omitempty"` LastPage int `json:"last_page,omitempty"` LastPageURL string `json:"last_page_url,omitempty"` NextPageURL string `json:"next_page_url,omitempty"` Path string `json:"path,omitempty"` PerPage int `json:"per_page,omitempty"` PrevPageURL string `json:"prev_page_url,omitempty"` To int `json:"to,omitempty"` Total int `json:"total,omitempty"` }
TransactionsResponse reposnses
func (*TransactionsResponse) ToJSON ¶ added in v0.2.0
func (txs *TransactionsResponse) ToJSON() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.