@@ -31,6 +31,7 @@ public class LinkTokenResource {
3131 private final List <String > countryCodes ;
3232 private final String redirectUri ;
3333 private final List <Products > correctedPlaidProducts ;
34+ private final List <CountryCode > correctedCountryCodes ;
3435
3536 public LinkTokenResource (PlaidApi plaidClient , List <String > plaidProducts ,
3637 List <String > countryCodes , String redirectUri ) {
@@ -39,6 +40,7 @@ public LinkTokenResource(PlaidApi plaidClient, List<String> plaidProducts,
3940 this .countryCodes = countryCodes ;
4041 this .redirectUri = redirectUri ;
4142 this .correctedPlaidProducts = new ArrayList <>();
43+ this .correctedCountryCodes = new ArrayList <>();
4244 }
4345
4446 public static class LinkToken {
@@ -62,11 +64,15 @@ public LinkToken(String linkToken) {
6264 this .correctedPlaidProducts .add (Products .fromValue (this .plaidProducts .get (i )));
6365 };
6466
67+ for (int i = 0 ; i < this .countryCodes .size (); i ++){
68+ this .correctedCountryCodes .add (CountryCode .fromValue (this .countryCodes .get (i )));
69+ };
70+
6571 LinkTokenCreateRequest request = new LinkTokenCreateRequest ()
6672 .user (user )
6773 .clientName ("Quickstart Client" )
6874 .products (this .correctedPlaidProducts )
69- .countryCodes (Arrays . asList ( CountryCode . US , CountryCode . CA ) )
75+ .countryCodes (this . correctedCountryCodes )
7076 .language ("en" )
7177 .redirectUri (this .redirectUri );
7278
0 commit comments