How hirotomasato/scbz works
scbz provides both a Go SDK and a REST gateway for SociaBuzz donations. The gateway workflow is fee estimation (optional), donation submission and session retention, payment-method listing, payment creation, then status checks; the SDK exposes the corresponding donation and payment operations directly. A separate webhook dispatcher polls persisted payments and sends terminal events to callback URLs. The graph follows documented routes and excerpted calls; some lower-level SDK request details and the webhook’s startup wiring are only partially shown.
Main entry points: client.go Donation workflow · main.go HTTP router · donate.go Donation endpoint · fees.go Fee endpoints
Components 20
REST gateway
- HTTP router
cmd/scbz-server/main.go - Settings
server/config.go - API authentication
server/auth.go - API schemas
server/schemas.go - Donation endpoint
server/routes/donate.go - Fee endpoints
server/routes/fees.go - Payment endpoints
server/routes/payment.go
Donation SDK
- Donation workflow
sociabuzz/client.go - Fee estimator
sociabuzz/fees.go - SociaBuzz transport
sociabuzz/http.go - Country catalog
sociabuzz/constants.go - SDK data models
sociabuzz/models.go - SDK errors
sociabuzz/errors.go - JSON helpers
sociabuzz/json.go
Sessions and callbacks
- Session store
server/session.go - Webhook poller
server/webhook.go
Other components
- API client
- SDK caller
- Callback receiver
- SociaBuzz service
Connections 29
- API client → HTTP router: sends requests
README.md - HTTP router → API authentication: applies middleware
cmd/scbz-server/main.go - HTTP router → Settings: loads settings
cmd/scbz-server/main.go - HTTP router → Donation endpoint: routes donation
cmd/scbz-server/main.go - HTTP router → Fee endpoints: routes fees
cmd/scbz-server/main.go - HTTP router → Payment endpoints: routes payments
cmd/scbz-server/main.go - Donation endpoint → API schemas: decodes and returns
server/routes/donate.go - Fee endpoints → API schemas: decodes and returns
server/routes/fees.go - Payment endpoints → API schemas: decodes and returns
server/routes/payment.go - Donation endpoint → Donation workflow: submits donation
server/routes/donate.go - Fee endpoints → Fee estimator: estimates fees
server/routes/fees.go - Fee endpoints → Country catalog: lists countries
server/routes/fees.go - Payment endpoints → Session store: loads and updates
server/routes/payment.go - Donation endpoint → Session store: stores session
server/routes/donate.go - Payment endpoints → Donation workflow: requests payment actions
server/routes/payment.go - Donation workflow → SociaBuzz transport: delegates requests
sociabuzz/client.go - Fee estimator → SociaBuzz transport: delegates requests
sociabuzz/fees.go - Donation workflow → Country catalog: validates country
sociabuzz/client.go - Fee estimator → Country catalog: selects currency
sociabuzz/fees.go - SociaBuzz transport → SociaBuzz service: calls service
README.md - SDK caller → Donation workflow: starts donation flow
README.md - SDK caller → Fee estimator: requests estimate
README.md - Session store → Donation workflow: restores donation
server/session.go - Webhook poller → Session store: loads pending sessions
server/webhook.go - Webhook poller → Donation workflow: checks payment status
server/webhook.go - Webhook poller → Callback receiver: posts terminal event
server/webhook.go - Donation workflow → SDK data models: uses data types
- Donation workflow → SDK errors: returns typed errors
- SociaBuzz transport → JSON helpers: parses responses