Documentation
¶
Index ¶
- type Address
- type BillingDetails
- type ChargeListPaginatedParams
- type ChargeListParams
- type ChargesPage
- type CheckoutInfo
- type CheckoutManager
- type CheckoutParams
- type Error
- func NewCheckoutExpiredError(message string) *Error
- func NewFailedToCreateCheckoutSessionError(message string, cause error) *Error
- func NewInvalidWebhookEventDataError(message string, cause error) *Error
- func NewNotCheckoutConfirmedEventError(message string) *Error
- func NewNotPaidError(message string) *Error
- func NewSignatureValidationError(message string, cause error) *Error
- type Item
- type Payment
- type PaymentQuerier
- type Reason
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BillingDetails ¶ added in v0.6.0
type ChargeListPaginatedParams ¶ added in v0.7.0
type ChargeListParams ¶ added in v0.6.0
type ChargesPage ¶ added in v0.7.0
type CheckoutInfo ¶
type CheckoutManager ¶
type CheckoutManager interface {
CreateCheckout(ctx context.Context, params CheckoutParams) (CheckoutInfo, error)
// Confirms that a checkout was sucessful based on event data.
//
// Note that this can still return metadata even if err != nil, in the event that the
// checkout was expired, since the caller may still want to know checkout information.
ConfirmCheckout(ctx context.Context, payload []byte, signature string) (map[string]string, error)
}
type CheckoutParams ¶
type CheckoutParams struct {
ReturnURL string
Items []Item
Metadata map[string]string
// How long to keep the checkout session alive.
// Check payment operator for allowed values.
SessionAliveDuration *time.Duration
// If the payment processor has an adaptive pricing feature (i.e. auto converting currencies),
// enable or disable it.
AllowAdaptivePricing bool
CustomerEmail *string
// Email address where the payment provider should send the payment receipt.
ReceiptEmail *string
}
type Error ¶
func NewCheckoutExpiredError ¶ added in v0.3.0
func NewNotPaidError ¶
type PaymentQuerier ¶ added in v0.6.0
type PaymentQuerier interface {
ListCharges(ctx context.Context, params ChargeListParams) iter.Seq2[Payment, error]
ListChargesPaginated(ctx context.Context, params ChargeListPaginatedParams) (ChargesPage, error)
}
type Reason ¶
type Reason string
const ( ErrorReasonSignatureValidation Reason = "SignatureValidationError" ErrorReasonFailedToCreateCheckoutSession Reason = "FailedToCreateCheckoutSession" ErrorReasonInvalidWebhookEventData Reason = "InvalidWebhookEventData" ErrorReasonCheckoutExpired Reason = "CheckoutExpired" ErrorReasonNotCheckoutConfirmedEvent Reason = "NotCheckoutConfirmedEvent" ErrorReasonNotPaid Reason = "PaymentStatusIsNotPaid" )
Click to show internal directories.
Click to hide internal directories.