Exact request/response shapes for every endpoint used in the ECPay integration. All authenticated endpoints require Authorization: Bearer <jwt>.
amount = integer TWD. tradeNo optional (auto-generated). countryCode also accepted as alias for country.
ApiResponse<SetupIntentResponse>
For ECPay, clientSecret is the HTML form that the frontend renders in an iframe or redirects to. For Stripe, it's the Stripe SetupIntent client secret.
CreatePaymentMethodRequest
billingOrganizationId is in the URL path. metadata.bindCardPayToken = the clientSecret from setup-intent. metadata.id also accepted (preferred for Stripe). returnUrl = where ECPay redirects after 3DS. invoiceId optional.
ApiResponse<Map>
No request body. Invoice ID is in the URL path.
ApiResponse<Map>
processing = authorized but capture is async (ECPay pattern). succeeded = already captured. transactionId = MerchantTradeNo for ECPay, PaymentIntent ID for Stripe.
No request body. MerchantTradeNo in URL. Transaction must be in AUTHORIZED state.
action values: C = Capture/Close, R = Refund, E = Cancel, N = Abandon.
tradeNo = ECPay's trade number (from query-trade response).
Bypasses the state machine — use with care.