Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GatewayFromPath ¶
GatewayFromPath returns just the gateway name string.
Types ¶
type Adapter ¶
type Adapter interface {
Name() string
// BuildResponse turns an engine Result into an HTTP response body + status.
BuildResponse(result *engine.Result, originalBody []byte) (statusCode int, body []byte, headers map[string]string)
// BuildWebhookPayload returns the webhook payload for a given result.
// requestBody is the decoded original charge request; adapters MUST echo any
// relevant customer-supplied fields (Stripe: metadata, Razorpay: notes,
// Agnostic: whole body) so callers can correlate incoming webhooks with
// their own requests (e.g. order_id).
BuildWebhookPayload(result *engine.Result, chargeID string, amount int64, currency string, requestBody map[string]any) map[string]any
}
Adapter translates between a gateway's wire format and TestPay internals.
type GatewayRequest ¶
type GatewayRequest struct {
ChargeID string
Amount int64
Currency string
RawBody []byte
Headers http.Header
}
GatewayRequest is the parsed, gateway-agnostic form of an incoming mock request.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) KnownGateways ¶
KnownGateways returns the canonical gateway names (not URL aliases). Used by the dashboard to render per-gateway webhook configuration.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package adyen mocks Adyen's payment API surface.
|
Package adyen mocks Adyen's payment API surface. |
|
Package ecpay mocks ECPay (綠界 / Green World) — Taiwan's dominant acquiring gateway.
|
Package ecpay mocks ECPay (綠界 / Green World) — Taiwan's dominant acquiring gateway. |
|
Package espay mocks ESPay (Indonesia) payment API.
|
Package espay mocks ESPay (Indonesia) payment API. |
|
Package instamojo mocks Instamojo's (India) payment-request API.
|
Package instamojo mocks Instamojo's (India) payment-request API. |
|
Package komoju mocks Komoju (Japan) payment API.
|
Package komoju mocks Komoju (Japan) payment API. |
|
Package mastercard mocks the Mastercard Payment Gateway Services (MPGS) surface area.
|
Package mastercard mocks the Mastercard Payment Gateway Services (MPGS) surface area. |
|
Package paynamics mocks Paynamics's (PH / SEA) payment API surface.
|
Package paynamics mocks Paynamics's (PH / SEA) payment API surface. |
|
Package razorpay mocks Razorpay's payment API surface.
|
Package razorpay mocks Razorpay's payment API surface. |
|
Package tappay mocks TapPay's payment API surface.
|
Package tappay mocks TapPay's payment API surface. |
|
Package tillpay mocks the TillPayment acquirer API.
|
Package tillpay mocks the TillPayment acquirer API. |
Click to show internal directories.
Click to hide internal directories.