55import com .starkbank .utils .Rest ;
66import com .starkbank .utils .SubResource ;
77
8- import java .io .InputStream ;
98import java .util .List ;
109import java .util .ArrayList ;
1110import java .util .HashMap ;
@@ -22,7 +21,7 @@ public class MerchantSession extends Resource {
2221 static ClassData data = new ClassData (MerchantSession .class , "MerchantSession" );
2322
2423 public List <String > allowedFundingTypes ;
25- public List <MerchantSession . AllowedInstallments > allowedInstallments ;
24+ public List <AllowedInstallment > allowedInstallments ;
2625 public List <String > allowedIps ;
2726 public String challengeMode ;
2827 public String created ;
@@ -32,7 +31,7 @@ public class MerchantSession extends Resource {
3231 public String updated ;
3332 public String uuid ;
3433
35- public MerchantSession (String id , List <String > allowedFundingTypes , List <MerchantSession . AllowedInstallments > allowedInstallments , List <String > allowedIps , String challengeMode , String created , Number expiration , String status , String [] tags , String updated , String uuid ) {
34+ public MerchantSession (String id , List <String > allowedFundingTypes , List <AllowedInstallment > allowedInstallments , List <String > allowedIps , String challengeMode , String created , Number expiration , String status , String [] tags , String updated , String uuid ) {
3635 super (id );
3736 this .allowedFundingTypes = allowedFundingTypes ;
3837 this .allowedInstallments = allowedInstallments ;
@@ -69,21 +68,21 @@ public MerchantSession(Map<String, Object> data) throws Exception {
6968 }
7069
7170
72- private List <MerchantSession . AllowedInstallments > parseAllowedInstallments (List <Object > allowedInstallments ) {
71+ private List <AllowedInstallment > parseAllowedInstallments (List <Object > allowedInstallments ) {
7372 if (allowedInstallments == null )
7473 return null ;
7574
76- List <MerchantSession . AllowedInstallments > parsed = new ArrayList <>();
77- if (allowedInstallments .isEmpty () || allowedInstallments .get (0 ) instanceof MerchantSession . AllowedInstallments ) {
75+ List <AllowedInstallment > parsed = new ArrayList <>();
76+ if (allowedInstallments .isEmpty () || allowedInstallments .get (0 ) instanceof AllowedInstallment ) {
7877 for (Object allowedInstallment : allowedInstallments ) {
79- parsed .add ((MerchantSession . AllowedInstallments ) allowedInstallment );
78+ parsed .add ((AllowedInstallment ) allowedInstallment );
8079 }
8180
8281 return parsed ;
8382 }
8483
8584 for (Object allowedInstallment : allowedInstallments ) {
86- MerchantSession . AllowedInstallments allowedInstallmentObject = new MerchantSession . AllowedInstallments (
85+ AllowedInstallment allowedInstallmentObject = new AllowedInstallment (
8786 (Long ) ((Map <String , Object >) allowedInstallment ).get ("totalAmount" ),
8887 (Integer ) ((Map <String , Object >) allowedInstallment ).get ("count" )
8988 );
@@ -161,14 +160,14 @@ public Page(List<MerchantSession> merchantSessions, String cursor) {
161160 }
162161 }
163162
164- public static class AllowedInstallments extends SubResource {
163+ public static class AllowedInstallment extends SubResource {
165164
166- static SubResource .ClassData data = new SubResource .ClassData (AllowedInstallments .class , "AllowedInstallments" );
165+ static SubResource .ClassData data = new SubResource .ClassData (AllowedInstallment .class , "AllowedInstallments" );
167166
168167 public long totalAmount ;
169168 public int count ;
170169
171- public AllowedInstallments (long totalAmount , int count ){
170+ public AllowedInstallment (long totalAmount , int count ){
172171 this .totalAmount = totalAmount ;
173172 this .count = count ;
174173 }
@@ -246,11 +245,11 @@ public Purchase(Map<String, Object> data) throws Exception {
246245 this .billingStreetLine2 = (String ) dataCopy .remove ("billingStreetLine2" );
247246 this .billingZipCode = (String ) dataCopy .remove ("billingZipCode" );
248247 this .metadata = (Map <String , Object >) dataCopy .remove ("metadata" );
248+ this .tags = (String []) dataCopy .remove ("tags" );
249249 this .challengeMode = null ;
250250 this .network = null ;
251251 this .source = null ;
252252 this .status = null ;
253- this .tags = null ;
254253 this .update = null ;
255254
256255 if (!dataCopy .isEmpty ()) {
0 commit comments