Skip to content

Commit

Permalink
Fixed phone detection type validation ACDM-1811 #resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Rodrigues committed Oct 19, 2020
1 parent ddd6912 commit 041838f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.fenixedu.bennu.core.i18n.BundleUtil;
import org.fenixedu.commons.StringNormalizer;
import org.fenixedu.messaging.smsdispatch.SMSMessage;

import pt.ist.fenixframework.Atomic;

public class PhoneValidation extends PhoneValidation_Base {
Expand Down Expand Up @@ -64,12 +65,12 @@ public void triggerValidationProcess() {
final Country country = person.getCountry();
final String language = Country.isCPLPCountry(country) ? "pt" : "en";

if (PhoneUtil.shouldReceiveValidationCall(number)) {
PhoneValidationUtils.getInstance().makeCall(PhoneUtil.getInternacionalFormatNumber(number), token, language);
} else if (PhoneUtil.shouldReceiveValidationSMS(number)) {
if (getPartyContact() instanceof MobilePhone) {
final String message = StringNormalizer.normalizePreservingCapitalizedLetters(BundleUtil.getString(
"resources.GlobalResources", "sms.confirmationCode", token));
SMSMessage.getInstance().sendSMS(PhoneUtil.getInternacionalFormatNumber(number), message);
} else if (getPartyContact() instanceof Phone) {
PhoneValidationUtils.getInstance().makeCall(PhoneUtil.getInternacionalFormatNumber(number), token, language);
}

person.incValidationRequest();
Expand Down

0 comments on commit 041838f

Please sign in to comment.