Documentation ¶
Index ¶
- Constants
- func NewOrderPath(endpoint string, orderID string, token string) string
- func NewRefundPath(endpoint string, orderID string, hContract string) string
- type Address
- type AuthMethod
- type BearerAuthClient
- type CheckPaymentClaimedResponse
- type CheckPaymentPaidResponse
- type CheckPaymentUnpaidResponse
- type Client
- func (s *Client) CreateInstance(arg CreateInstanceRequest) error
- func (s *Client) CreateOrder(instance string, arg CreateOrderRequest) (*PostOrderReponse, error)
- func (s *Client) CreateProduct(instanceID string, req CreateProductRequest) error
- func (s *Client) GetOrder(instance, orderID string, query GetOrderQuery) (*MerchantOrderStatusResponse, error)
- func (s *Client) GetOrders(instanceID string, query GetOrdersQuery) (*OrderHistory, error)
- func (s *Client) RefundOrder(instance, orderID string, req RefundOrderRequest) (*MerchantRefundResponse, error)
- func (s Client) Request(method string, statusCode *int, path string, req, resp interface{}) (int, error)
- type ContractTermsIncomplete
- type CreateInstanceRequest
- type CreateOrderRequest
- type CreateProductRequest
- type GetOrderQuery
- type GetOrdersQuery
- type HTMLImage
- type HTTPRequester
- type Instance
- type InventoryProducts
- type MerchantOrderStatusResponse
- type MerchantRefundResponse
- type Order
- type OrderHistory
- type OrderHistoryEntry
- type OrderStatus
- type PostOrderReponse
- type RefundDetails
- type RefundOrderRequest
- type Tax
- type UUID
- type Unit
Constants ¶
View Source
const AuthMethodExternal = "external"
AuthMethodExternal gives authorization responsibility to another layer, like the Apache HTTPserver. Taler will accept direct unauthenticated requests.
View Source
const AuthMethodToken = "token"
AuthMethodToken expects the correct user/password combination in the HTTP Authorization header.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct{}
type AuthMethod ¶
type AuthMethod struct{}
method can be 'external'
"auth" : { "method" : "token", "token" : "secret-token:booknook" }
type BearerAuthClient ¶
type BearerAuthClient struct { HTTPRequester Username string Password string }
func WithBearerAuth ¶
func WithBearerAuth( cli HTTPRequester, username, password string, ) *BearerAuthClient
cover this in examples
type CheckPaymentClaimedResponse ¶
type CheckPaymentClaimedResponse struct { // OrderStatus always "claimed" OrderStatus string `json:"order_status"` }
type CheckPaymentPaidResponse ¶
type CheckPaymentPaidResponse struct { // OrderStatus always "paid" OrderStatus string `json:"order_status"` Refunded bool `json:"refunded"` RefundPending bool `json:"refund_pending"` Wired bool `json:"wired"` DepositTotal api.Amount `json:"deposit_total"` ExchangeEC int64 `json:"exchange_ec"` ExchangeHC int64 `json:"exchange_hc"` RefundAmount api.Amount `json:"refund_amount"` RefundDetails []RefundDetails `json:"refund_details"` OrderStatusURL string `json:"order_status_url"` ContractTerms ContractTermsIncomplete `json:"contract_terms"` }
type CheckPaymentUnpaidResponse ¶
type CheckPaymentUnpaidResponse struct { // OrderStatus always "unpaid" OrderStatus string `json:"order_status"` TalerPayURI string `json:"taler_pay_uri"` CreationTime api.Timestamp `json:"creation_time"` Summary string `json:"summary"` TotalAmount api.Amount `json:"total_amount"` AlreadyPaidOrderID *string `json:"already_paid_order_id"` AlreadyPaidFullfillmentURL *string `json:"already_paid_fullfillment_url"` OrderStatusURL string `json:"order_status_url"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient( cli HTTPRequester, basePath string, ) *Client
func (*Client) CreateInstance ¶
func (s *Client) CreateInstance(arg CreateInstanceRequest) error
func (*Client) CreateOrder ¶
func (s *Client) CreateOrder(instance string, arg CreateOrderRequest) (*PostOrderReponse, error)
func (*Client) CreateProduct ¶
func (s *Client) CreateProduct(instanceID string, req CreateProductRequest) error
func (*Client) GetOrder ¶
func (s *Client) GetOrder( instance, orderID string, query GetOrderQuery, ) (*MerchantOrderStatusResponse, error)
func (*Client) GetOrders ¶
func (s *Client) GetOrders( instanceID string, query GetOrdersQuery, ) (*OrderHistory, error)
func (*Client) RefundOrder ¶
func (s *Client) RefundOrder( instance, orderID string, req RefundOrderRequest, ) (*MerchantRefundResponse, error)
type ContractTermsIncomplete ¶
type CreateInstanceRequest ¶
type CreateInstanceRequest struct { Address Address Auth AuthMethod DefaultMaxDepositFee api.Amount DefaultMaxWireFee api.Amount DefaultWireFeeAmortization int // Check what this means DefaultWireTransferDelay api.RelativeTime ID string Jurisdiction interface{} // Check Name string PaytoURIs []api.PayToURI }
type CreateOrderRequest ¶
type CreateOrderRequest struct { InventoryProducts []InventoryProducts `json:"inventory_products,omitempty"` Order Order `json:"order,omitempty"` RefundDelay *api.RelativeTime `json:"refund_delay,omitempty"` PaymentTarget string `json:"payment_target,omitempty"` LockUUIDs []UUID `json:"lock_uuids,omitempty"` CreateToken *bool `json:"create_token,omitempty"` }
type CreateProductRequest ¶
type GetOrderQuery ¶
type GetOrdersQuery ¶
type GetOrdersQuery struct { Paid *api.QueryBool `schema:"paid,omitempty"` Refunded *api.QueryBool `schema:"refunded,omitempty"` Wired *api.QueryBool `schema:"wired,omitempty"` DateMS *int64 `schema:"date_ms,omitempty"` Start *int64 `schema:"start,omitempty"` Delta *int64 `schema:"delta,omitempty"` TimeoutMS *int64 `schema:"timeout_ms,omitempty"` }
type Instance ¶
type Instance struct { }
type InventoryProducts ¶
type InventoryProducts struct { Quantity int `json:"quantity"` ProductID string `json:"product_id"` }
"inventory_products" : [
{ "quantity" : 1, "product_id" : "2" }
],
type MerchantOrderStatusResponse ¶
type MerchantOrderStatusResponse struct { OrderStatus OrderStatus `json:"order_status"` *CheckPaymentPaidResponse *CheckPaymentClaimedResponse *CheckPaymentUnpaidResponse }
func (*MerchantOrderStatusResponse) MarshalJSON ¶
func (s *MerchantOrderStatusResponse) MarshalJSON() ([]byte, error)
func (*MerchantOrderStatusResponse) UnmarshalJSON ¶
func (s *MerchantOrderStatusResponse) UnmarshalJSON(buf []byte) error
type MerchantRefundResponse ¶
type Order ¶
type Order struct { ContractTermsIncomplete Amount *api.Amount `json:"amount"` // this is an odd format 'KUDOS:1' FulfillmentUrl *string `json:"fulfillment_url,omitempty"` Summary string `json:"summary"` }
type OrderHistory ¶
type OrderHistory struct {
Orders []OrderHistoryEntry `json:"orders"`
}
type OrderHistoryEntry ¶
type OrderStatus ¶
type OrderStatus string
var ( OrderStatusUnknown OrderStatus = "" OrderStatusClaimed OrderStatus = "claimed" OrderStatusPaid OrderStatus = "paid" OrderStatusUnpaid OrderStatus = "unpaid" )
type PostOrderReponse ¶
type RefundDetails ¶
type RefundOrderRequest ¶
Click to show internal directories.
Click to hide internal directories.