fix(upgrade): preserve legacy auth and payment compatibility
This commit is contained in:
@@ -282,7 +282,19 @@ func mergeWeChatConnectCapabilitySettings(settings map[string]string, base confi
|
||||
mobileConfigured := hasMobile && strings.TrimSpace(rawMobile) != ""
|
||||
|
||||
if openConfigured || mpConfigured || mobileConfigured {
|
||||
return parseWeChatConnectCapabilitySettings(settings, enabled, mode)
|
||||
openEnabled := strings.TrimSpace(rawOpen) == "true"
|
||||
mpEnabled := strings.TrimSpace(rawMP) == "true"
|
||||
mobileEnabled := strings.TrimSpace(rawMobile) == "true"
|
||||
_, enabledConfigured := settings[SettingKeyWeChatConnectEnabled]
|
||||
if !enabledConfigured &&
|
||||
enabled &&
|
||||
!openEnabled &&
|
||||
!mpEnabled &&
|
||||
!mobileEnabled &&
|
||||
(base.OpenEnabled || base.MPEnabled || base.MobileEnabled) {
|
||||
return base.OpenEnabled, base.MPEnabled, base.MobileEnabled
|
||||
}
|
||||
return openEnabled, mpEnabled, mobileEnabled
|
||||
}
|
||||
if !enabled {
|
||||
return false, false, false
|
||||
@@ -1921,14 +1933,9 @@ func isFalseSettingValue(value string) bool {
|
||||
}
|
||||
|
||||
func normalizeVisibleMethodSettingSource(method, source string, enabled bool) (string, error) {
|
||||
_ = enabled
|
||||
source = strings.TrimSpace(source)
|
||||
if source == "" {
|
||||
if enabled {
|
||||
return "", infraerrors.BadRequest(
|
||||
"INVALID_PAYMENT_VISIBLE_METHOD_SOURCE",
|
||||
fmt.Sprintf("%s source is required when the visible method is enabled", method),
|
||||
)
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user