tappay

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 tappay mocks TapPay's payment API surface. The underlying wire format matches the Appotapay DTOs from the reference library (errorCode float + message + signature envelope). Real Appotapay signs payloads with HMAC-SHA256 over concatenated request fields; the mock emits a fixed signature placeholder.

DTO shapes for TapPay's payment API surface. Derived from the production reference library (test-dto-/payments.go, structs: AppotapayPaymentResponse, AppotapayWebhookOrderStatusResponse, AppotapayRefundResponse, AppotapayErrorResponse, ...).

The reference DTOs are named "Appotapay*" — the wire format the mock emits matches those shapes 1:1. The Name() on the adapter remains "tappay" because that's what the repo registers the adapter under; only the payload field names / error vocabulary come from Appotapay.

Wire conventions: errorCode is a numeric (0 on success, non-zero on failure) and signature is a fixed mock placeholder — real Appotapay uses HMAC-SHA256(partnerCode + apiKey + orderId + ...). Consumers verifying signatures should detect the mock prefix and skip.

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