komoju

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package komoju mocks Komoju (Japan) payment API. Real-world shape: resource-oriented JSON — `{ id, resource: "payment", status, amount, ... }` on success; `{ error: { code, message, ... } }` on failure. Webhook is wrapped in an event envelope:

{ id, type: "payment.<state>", resource: "event", data: {...payment...} }

DTO shapes for Komoju's (Japan) payment API. Derived from the production reference library (test-dto-/payments.go, structs: KomojuInitResPayload, KomojuWebhookPayload, KomojuErrorPayload, KomojuCardTokenResponse, KomojuRefundRequsetPayload).

Komoju's API is resource-oriented — most responses carry a `resource` discriminator ("payment", "event", "refund"). Status lifecycle is:

authorized → captured → refunded

with failed/cancelled as terminal sad paths. Amounts are plain int (JPY has no minor units anyway).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct{}

func New

func New() *Adapter

func (*Adapter) BuildResponse

func (a *Adapter) BuildResponse(result *engine.Result, body []byte) (int, []byte, map[string]string)

func (*Adapter) BuildWebhookPayload

func (a *Adapter) BuildWebhookPayload(result *engine.Result, chargeID string, amount int64, currency string, requestBody map[string]any) map[string]any

func (*Adapter) Name

func (a *Adapter) Name() string

Jump to

Keyboard shortcuts

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