merchant

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckPaymentPaytoResponse

type CheckPaymentPaytoResponse struct {
	// Status of the order
	TalerPayUri string `json:"taler_pay_uri"`
}

type CheckPaymentStatusResponse

type CheckPaymentStatusResponse struct {
	// Status of the order
	OrderStatus string `json:"order_status"`
}

type FulfillmentMetadata

type FulfillmentMetadata struct {
	// See documentation of fulfillment_url in ContractTerms.
	// Either fulfillment_url or fulfillment_message must be specified.
	FulfillmentUrl string `json:"fulfillment_url,omitempty"`

	// See documentation of fulfillment_message in ContractTerms.
	// Either fulfillment_url or fulfillment_message must be specified.
	FulfillmentMessage string `json:"fulfillment_message,omitempty"`
}

NOTE: Part of the above but optional

type Merchant

type Merchant struct {

	// The host of this merchant
	BaseUrlPrivate string

	// The access token to use for the private API
	AccessToken string
}

func NewMerchant

func NewMerchant(merchBaseUrlPrivate string, merchAccessToken string) Merchant

func (*Merchant) AddNewOrder

func (m *Merchant) AddNewOrder(cost util.Amount, summary string, fulfillment_url string) (string, error)

func (*Merchant) IsOrderPaid

func (m *Merchant) IsOrderPaid(orderId string) (int, string, error)

type MinimalOrderDetail

type MinimalOrderDetail struct {
	// Amount to be paid by the customer.
	Amount string `json:"amount"`

	// Short summary of the order.
	Summary string `json:"summary"`

	// See documentation of fulfillment_url in ContractTerms.
	// Either fulfillment_url or fulfillment_message must be specified.
	FulfillmentUrl string `json:"fulfillment_url"`
}

type PostOrderRequest

type PostOrderRequest struct {
	// The order must at least contain the minimal
	// order detail, but can override all.
	Order MinimalOrderDetail `json:"order"`

	// If set, the backend will then set the refund deadline to the current
	// time plus the specified delay.  If it's not set, refunds will not be
	// possible.
	RefundDelay int64 `json:"refund_delay,omitempty"`

	// Specifies the payment target preferred by the client. Can be used
	// to select among the various (active) wire methods supported by the instance.
	PaymentTarget string `json:"payment_target,omitempty"`

	// Specifies a lock identifier that was used to
	// lock a product in the inventory.  Only useful if
	// inventory_products is set.  Used in case a frontend
	// reserved quantities of the individual products while
	// the shopping cart was being built.  Multiple UUIDs can
	// be used in case different UUIDs were used for different
	// products (i.e. in case the user started with multiple
	// shopping sessions that were combined during checkout).
	LockUuids []string `json:"lock_uuids,omitempty"`

	// Should a token for claiming the order be generated?
	// False can make sense if the ORDER_ID is sufficiently
	// high entropy to prevent adversarial claims (like it is
	// if the backend auto-generates one). Default is 'true'.
	CreateToken bool `json:"create_token,omitempty"`
}

type PostOrderResponse

type PostOrderResponse struct {
	// Order ID of the response that was just created.
	OrderId string `json:"order_id"`
}

type PostOrderResponseToken

type PostOrderResponseToken struct {
	// Token that authorizes the wallet to claim the order.
	// Provided only if "create_token" was set to 'true'
	// in the request.
	Token string
}

Jump to

Keyboard shortcuts

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