Documentation
¶
Overview ¶
Package ecpay mocks ECPay (綠界 / Green World) — Taiwan's dominant acquiring gateway. Real-world wire shape: AioCheckOut v5 for order creation, ReturnURL form-POST for async settlement notifications. See dto.go for the sourcing notes on where each field originates.
DTO shapes for ECPay (綠界 / Green World) payment API.
Sourcing note: the production reference DTO (test-dto-/ecpay.go) only defined the channel constants and the payment-method enum, so the response/webhook shapes below are modelled on ECPay's public integration documentation (AioCheckOut v5 + ReturnURL callback format). Key contract points preserved from the real gateway:
- `RtnCode` is the primary success flag: 1 = success, anything else is a failure. ECPay returns `RtnCode` as an *int* in the JSON response but as a *string* form field in the webhook (x-www-form- urlencoded). Our mock emits JSON for both but keeps the numeric semantics intact.
- `MerchantTradeNo` is the merchant's correlation ID (echoed back).
- `TradeNo` is ECPay's gateway-side transaction ID.
- `TradeAmt` is the gross amount as integer TWD (ECPay uses no minor units — TWD is whole-dollar).
- `PaymentType` identifies the tender (Credit_CreditCard, ATM_TAISHIN, CVS_CVS, BARCODE_BARCODE, etc.).
- `CheckMacValue` is the MD5/SHA256 signature covering the whole payload, sorted alphabetically. Our mock emits a placeholder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct{}