• erio's avatar
    test(payment): add unit tests for payment audit fixes + allow empty supported_types · 3c884f8e
    erio authored
    Tests (1033 new lines, 100% coverage on modified functions):
    - amount.go: YuanToFen/FenToYuan with precision edge cases
    - wxpay: mapWxState, wxSV, formatPEM, NewWxpay validation
    - alipay: isTradeNotExist, NewAlipay validation
    - webhook: writeSuccessResponse (wxpay JSON, stripe empty, others text)
    - config: validateProviderRequest, isSensitiveConfigField, joinTypes
    - fulfillment: resolveRedeemAction idempotency logic
    
    Business logic changes:
    - Allow empty supported_types on provider instances
    - Block removing payment types when instance has pending orders
    - Extract resolveRedeemAction as testable pure function
    3c884f8e
wxpay_test.go 5.83 KB