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
- func APIConfigured() bool
- func MerchantID() string
- func PremiumAmount() string
- func PremiumBlockchain() string
- func PremiumCurrency() string
- func PremiumReference(pubkeyFP string) string
- func Reference(plan, pubkeyFP string) string
- func VerifyPremium(payID string) (paid bool, checked bool)
- type Charge
Constants ¶
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.
const PodTerm = 31 * 24 * time.Hour
PodTerm is how much access one manual pod grant buys (grant-pod CLI).
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 ¶
PremiumReference derives a stable memo for a user's lifetime membership from their key fingerprint; sent as payment metadata for reconciliation.
func VerifyPremium ¶
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 ¶
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.