payments

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package payments gates the one-time $99 Founding Lifetime membership on CoinPay (coinpayportal.com). It talks to the CoinPay REST API directly over HTTP — no `coinpay` CLI needs to be installed on the host.

Config (env):

COINPAY_API_KEY                Bearer key for the CoinPay API (cp_live_…)
AGENTBBS_COINPAY_MERCHANT_ID   merchant/business id payments are created under
AGENTBBS_COINPAY_API_URL       API base (default https://coinpayportal.com/api)
AGENTBBS_PREMIUM_AMOUNT        fiat amount (default 99)
AGENTBBS_PREMIUM_CURRENCY      fiat currency (default USD)
AGENTBBS_PREMIUM_BLOCKCHAIN    settlement chain (default eth)

Operators can also grant pod time manually: `agentbbs grant-pod <user> N`.

Index

Constants

View Source
const FoundingCap = "1,000"

FoundingCap is the marketing cap on Founding Lifetime memberships — the offer is pitched as available to the first this-many accounts.

View Source
const PodTerm = 31 * 24 * time.Hour

PodTerm is how much access one manual pod grant buys (grant-pod CLI).

View Source
const PremiumPriceLabel = "$99 (lifetime)"

PremiumPriceLabel is the human-readable price for the one-time lifetime membership offered at join@.

Variables

This section is empty.

Functions

func APIConfigured

func APIConfigured() bool

APIConfigured reports whether live CoinPay calls can be made.

func MerchantID

func MerchantID() string

MerchantID is the CoinPay merchant/business id payments are created under.

func PremiumAmount

func PremiumAmount() string

Premium charge parameters — overridable via env so the offer can change without a rebuild.

func PremiumBlockchain

func PremiumBlockchain() string

func PremiumCurrency

func PremiumCurrency() string

func PremiumReference

func PremiumReference(pubkeyFP string) string

PremiumReference derives a stable memo for a user's lifetime membership from their key fingerprint; sent as payment metadata for reconciliation.

func Reference

func Reference(plan, pubkeyFP string) string

Reference derives a stable, short payment reference for a user+plan.

func VerifyPremium

func VerifyPremium(payID string) (paid bool, checked bool)

VerifyPremium reports whether a created premium payment has settled. payID is the CoinPay payment id from CreatePremiumCharge. checked is false when we could not reach CoinPay (caller falls back to store state); paid is true on a confirmed/forwarded status.

Types

type Charge

type Charge struct {
	Address      string
	CryptoAmount string
	Currency     string
	FiatAmount   string
	FiatCurrency string
	ID           string
	QR           string
}

Charge is a created CoinPay payment a user must fund: a unique deposit address, the crypto amount, the fiat amount it settles, and the payment id (store it to verify settlement later).

func CreatePremiumCharge

func CreatePremiumCharge(ref string) (Charge, bool, error)

CreatePremiumCharge creates a CoinPay payment for the lifetime membership and returns the deposit address, amount, and payment id (store the id to verify settlement later). created is false when CoinPay isn't configured.

Jump to

Keyboard shortcuts

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