CheckoutOptions

CheckoutOptions describes the contribution to suggest.

On this page

CheckoutOptions describes the contribution to suggest. All fields are optional.

type CheckoutOptions struct {
	Provider     Provider
	Amount       int64
	Currency     string
	Frequency    Frequency
	Timeout      time.Duration
	PollInterval time.Duration
	SignInMethod SignInMethod
}

Fields#

Provider#

Provider Provider

Provider preselects "github" or "open-collective"; the page never silently switches to another provider.

Amount#

Amount int64

Amount in minor units (cents). Zero means unset; a negative amount is invalid.

Currency#

Currency string

Currency is an ISO 4217 code. GitHub is always USD.

Frequency#

Frequency Frequency

Frequency is OneTime, Monthly or Yearly.

Timeout#

Timeout time.Duration

Timeout bounds how long OpenCheckout polls for a new contribution. It covers only the polling phase: a sign-in that OpenCheckout needs first is bounded by Options.SignInTimeout. Defaults to 10 minutes. Ignored by CheckoutURL.

PollInterval#

PollInterval time.Duration

PollInterval overrides Options.CheckoutPollInterval for this call.

SignInMethod#

SignInMethod SignInMethod

SignInMethod overrides Options.SignInMethod when OpenCheckout has to sign the user in first.