v1.5.118
Changelog
v1.5.118
Refactor: Unified do* Method Signatures & Auto-Encryption
Breaking Change — All internal do* methods no longer accept authorization parameter; authorization is computed automatically.
Core Changes
doPostauto-encryption: WhenaesKeyis set,doPostautomatically encrypts the request body and signs the ciphertext (encrypt-then-sign). No need to calldoPostWithEncryptanymore.- Removed
doPostWithEncrypt: Logic merged intodoPost. - Unified
authorizationmethod: MergedauthorizationWithEncryptBodyintoauthorizationwith anencryptedBodyparameter. doProdPostFilefully internalized: File separation,datafield encoding, and signing are now handled internally. Callers only pass the originalBodyMap(including file fields) — no moretempFile/signMapboilerplate.
Method Signature Changes
| Method | Before | After |
|---|---|---|
doPost |
(ctx, bm, uri, authorization, aat) |
(ctx, bm, uri, aat) |
doGet |
(ctx, uri, authorization, aat) |
(ctx, uri, aat) |
doPatch |
(ctx, bm, uri, authorization, aat) |
(ctx, bm, uri, aat) |
doPut |
(ctx, bm, uri, authorization, aat) |
(ctx, bm, uri, aat) |
doDelete |
(ctx, bm, uri, authorization, aat) |
(ctx, bm, uri, aat) |
doProdPostFile |
(ctx, bm, uri, authorization, aat) or (ctx, bm, uri, aat, signBm) |
(ctx, bm, uri, aat) |
Files Changed
alipay/v3/request.go—doPostauto-encryption;doProdPostFileinternalized; removeddoPostWithEncryptalipay/v3/sign.go— Unifiedauthorizationmethodalipay/v3/face_verify_api.go— Removed all if/else encryption branches- 15 API files — Removed
authorizationdeclarations and parameter fromdo*calls - 5 file upload APIs — Removed
tempFile/signMap/databoilerplate (~28 lines each)
Migration
No external API changes. All public method signatures remain the same. This is only an internal refactoring.
Full Changelog: https://github.com/cloud2c/gopay/commits/v1.5.118