paymentrefusal

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package paymentrefusal recognises the narrow response shape that proves a key authenticated but its account cannot fund a request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Matches

func Matches(status int, body []byte) bool

Matches reports whether status and body describe an account that cannot pay. A bare 429 is pacing and stays false; only payment-bearing words or a known payment code turn that otherwise transient status into a terminal answer.

func ResetAt

func ResetAt(body []byte) string

ResetAt returns the vendor's reset value when a window refusal names one. It returns only the value after "reset at" so a surface can compose its own sentence without copying an entire error envelope onto the status line.

Types

type Kind

type Kind int

Kind is the meaning of a payment-shaped vendor response. The numeric code decides before prose because a plan-window message may also say that the account has insufficient balance for EXTRA usage.

const (
	Unknown Kind = iota
	Payment
	WindowExhausted
	NoPlan
	Pacing
)

func Classify

func Classify(status int, body []byte) Kind

Classify separates an empty wallet, an exhausted subscription window, a door the key cannot use, and ordinary pacing. A vendor code is the stronger fact and a body carrying one never falls through to ambiguous prose.

Jump to

Keyboard shortcuts

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