addressInfo in bttps file 增加容错

master
yixian 4 years ago
parent 1609284d26
commit 1767cb98e9

@ -13,6 +13,7 @@ public class AddressInfo {
public AddressInfo(String address, String suburb, String state, String postCode, String country) { public AddressInfo(String address, String suburb, String state, String postCode, String country) {
this.address = address; this.address = address;
this.suburb = suburb; this.suburb = suburb;
postCode = postCode.replaceAll("\\D", "");
if (!postCode.matches("^\\d{4}$")) { if (!postCode.matches("^\\d{4}$")) {
postCode = "9999"; postCode = "9999";
country = "OTH"; country = "OTH";
@ -24,7 +25,9 @@ public class AddressInfo {
postCode = "9999"; postCode = "9999";
} }
this.postCode = postCode; this.postCode = postCode;
this.state = state; if (state != null) {
this.state = state.toUpperCase();
}
this.country = country; this.country = country;
} }

Loading…
Cancel
Save