api

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 9 Imported by: 1 module, 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 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

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

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.

Jump to

Keyboard shortcuts

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