mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 09:16:47 +00:00
Enable Payments Beta for more country codes
This commit is contained in:
1 parent
1e1394560d
commit
da5c0ae4b6
4 files changed
+13
-16
No files matched your search
+3
-3
@@ -12,9 +12,9 @@ import java.util.Set;
|
||||
public class DynamicPaymentsConfiguration {
|
||||
|
||||
@JsonProperty
|
||||
private Set<String> allowedCountryCodes = Collections.emptySet();
|
||||
private Set<String> disallowedCountryCodes = Collections.emptySet();
|
||||
|
||||
public Set<String> getAllowedCountryCodes() {
|
||||
return allowedCountryCodes;
|
||||
public Set<String> getDisallowedCountryCodes() {
|
||||
return disallowedCountryCodes;
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -137,11 +137,11 @@ public class ProfileController {
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public Response setProfile(@Auth AuthenticatedAccount auth, @Valid CreateProfileRequest request) {
|
||||
final Set<String> allowedPaymentsCountryCodes =
|
||||
dynamicConfigurationManager.getConfiguration().getPaymentsConfiguration().getAllowedCountryCodes();
|
||||
final Set<String> disallowedPaymentsCountryCodes =
|
||||
dynamicConfigurationManager.getConfiguration().getPaymentsConfiguration().getDisallowedCountryCodes();
|
||||
|
||||
if (StringUtils.isNotBlank(request.getPaymentAddress()) &&
|
||||
!allowedPaymentsCountryCodes.contains(Util.getCountryCode(auth.getAccount().getNumber()))) {
|
||||
disallowedPaymentsCountryCodes.contains(Util.getCountryCode(auth.getAccount().getNumber()))) {
|
||||
|
||||
return Response.status(Status.FORBIDDEN).build();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user