v1.5.120
Changelog
v1.5.120
Feat: Add WithoutAES and Clone methods for Alipay V3 Client
Different Alipay APIs have different AES encryption requirements:
- Face verification/OCR APIs require AES encryption for
biz_content - Payment APIs (TradeCreate, TradePay, etc.) do NOT support content encryption, setting AES key causes parameter errors
Added thread-safe methods to handle mixed encryption scenarios:
WithoutAES(): Returns a new Client instance without AES encryption, original client unaffectedClone(): Returns an independent Client copy without inheriting AES config
Usage
// Option A: Separate clients (recommended)
faceClient := alipay.NewClientV3(...).SetAESKey(aesKey)
payClient := alipay.NewClientV3(...)
// Option B: Thread-safe temporary switch
client.SetAESKey(aesKey)
client.FaceVerificationInitialize(...)
client.WithoutAES().TradeCreate(...) // original client still has AESFiles Changed
alipay/v3/client.go
Full Changelog: v1.5.119...v1.5.120