espay

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 espay mocks ESPay (Indonesia) payment API. Real-world shape: RSA-2048 signed payloads with a uniform error_code / error_message envelope. "0000" is the success code; anything else is an ESPxx-style failure. We mock with a fixed signature placeholder.

DTO shapes for ESPay's (Indonesia) payment API surface. Derived from the production reference library (test-dto-/payments.go, structs: ESPayInquireResponse, ESPayPaymentStatusResponse, ESPayWebhookResponse, ESPayRefundResponse, ...).

ESPay uses RSA-signed JSON payloads with a strict error_code / error_message envelope — "0000" for success, arbitrary ESPxx codes otherwise. We mock the signature field with a fixed placeholder; callers that verify signatures should short-circuit on the mock prefix.

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