Documentation
¶
Overview ¶
Package api hosts the payment module's surfaces: the public proof submission for manual transfers, hosted-session minting, and gateway webhooks (rate-limited, no auth chain) plus the admin payment list, detail, and decisions (JWT-protected, admin-gated). Everything writes through kernel/httpx — a new surface with no legacy envelope contract.
Index ¶
- type Handler
- func (h *Handler) GetPayment(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListMethods(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListPayments(w http.ResponseWriter, r *http.Request)
- func (h *Handler) MidtransWebhook(w http.ResponseWriter, r *http.Request)
- func (h *Handler) MintPayment(w http.ResponseWriter, r *http.Request)
- func (h *Handler) RejectPayment(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SubmitPayment(w http.ResponseWriter, r *http.Request)
- func (h *Handler) VerifyPayment(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the payment module's HTTP surface. The gateway (nil when the store disabled hosted checkout) backs the session mint and the webhook authentication.
func New ¶
func New(service *paymentsdomain.Service, gateway paymentsdomain.Gateway, resolve kernel.CapabilityResolver) *Handler
New builds the payment HTTP handlers over the adopted service and the optional gateway driver.
func (*Handler) GetPayment ¶
func (h *Handler) GetPayment(w http.ResponseWriter, r *http.Request)
GetPayment returns one payment record with its order context.
func (*Handler) ListMethods ¶
func (h *Handler) ListMethods(w http.ResponseWriter, r *http.Request)
ListMethods returns the offered payment methods: the static configuration the store adopted, never merged from submissions.
func (*Handler) ListPayments ¶
func (h *Handler) ListPayments(w http.ResponseWriter, r *http.Request)
ListPayments returns the newest payment records carrying the optional status filter, at the keyset cursor, at most limit rows.
func (*Handler) MidtransWebhook ¶
func (h *Handler) MidtransWebhook(w http.ResponseWriter, r *http.Request)
MidtransWebhook authenticates and folds one gateway event. The signature rides the raw strings, a checksum failure answers 403 so forged events never fold, and a malformed amount answers 400.
func (*Handler) MintPayment ¶
func (h *Handler) MintPayment(w http.ResponseWriter, r *http.Request)
MintPayment opens a hosted checkout session for a payable order, gated on the order number, email, and tracking token matching like every guest surface. A store without a gateway driver answers 503.
func (*Handler) RejectPayment ¶
func (h *Handler) RejectPayment(w http.ResponseWriter, r *http.Request)
RejectPayment decides a pending proof for the negative: the order stays pending and the record carries the rejection.
func (*Handler) SubmitPayment ¶
func (h *Handler) SubmitPayment(w http.ResponseWriter, r *http.Request)
SubmitPayment records one manual transfer proof for a guest, gated on the order number, email, and tracking token matching.
func (*Handler) VerifyPayment ¶
func (h *Handler) VerifyPayment(w http.ResponseWriter, r *http.Request)
VerifyPayment decides a pending proof for the positive: the order flips to paid and the record carries the deciding administrator.