1414import java .util .ArrayList ;
1515import android .content .Context ;
1616import android .util .Log ;
17- import android .
18- widget .Toast ;
17+ import android .widget .Toast ;
1918
2019import androidx .annotation .NonNull ;
2120import androidx .annotation .Nullable ;
2726import com .smallcase .gateway .data .models .InitialisationResponse ;
2827import com .smallcase .gateway .data .listeners .DataListener ;
2928import com .google .gson .Gson ;
30- import com .smallcase .gateway .data .models .UserInfo ;
3129import com .smallcase .gateway .data .models .SmallcaseGatewayDataResponse ;
3230import com .smallcase .gateway .data .listeners .TransactionResponseListener ;
3331import com .smallcase .gateway .data .listeners .MFHoldingsResponseListener ;
@@ -251,7 +249,7 @@ public void onSuccess(@NotNull SmallPlugResult smallPlugResult) {
251249 }
252250
253251 @ Override
254- public void onFailure (int i , @ NotNull String s , @ Nullable String smallcaseAuthToken , @ Nullable UserInfo userInfo ) {
252+ public void onFailure (int i , @ NotNull String s ) {
255253
256254 Log .d ("SCGatewayPhoneGap" , "smallplug onFailure: " + i + s );
257255
@@ -260,22 +258,6 @@ public void onFailure(int i, @NotNull String s, @Nullable String smallcaseAuthTo
260258 jo .put ("errorCode" , i );
261259 jo .put ("errorMessage" , s );
262260
263- JSONObject dataObj = new JSONObject ();
264- if (userInfo != null ) {
265- JSONObject userInfoObj = new JSONObject ();
266- if (userInfo .getNumber () != null ) {
267- userInfoObj .put ("number" , userInfo .getNumber ());
268- }
269- if (userInfo .getCountryCode () != null ) {
270- userInfoObj .put ("countryCode" , userInfo .getCountryCode ());
271- }
272- dataObj .put ("userInfo" , userInfoObj );
273- }
274-
275- if (dataObj .length () > 0 ) {
276- jo .put ("data" , dataObj );
277- }
278-
279261 callbackContext .error (jo );
280262 } catch (JSONException e ) {
281263 e .printStackTrace ();
@@ -329,7 +311,7 @@ public void onSuccess(@NotNull SmallPlugResult smallPlugResult) {
329311 }
330312
331313 @ Override
332- public void onFailure (int i , @ NotNull String s , @ Nullable String smallcaseAuthToken , @ Nullable UserInfo userInfo ) {
314+ public void onFailure (int i , @ NotNull String s ) {
333315
334316 Log .d ("SCGatewayPhoneGap" , "smallplug onFailure: " + i + s );
335317
@@ -338,22 +320,6 @@ public void onFailure(int i, @NotNull String s, @Nullable String smallcaseAuthTo
338320 jo .put ("errorCode" , i );
339321 jo .put ("errorMessage" , s );
340322
341- JSONObject dataObj = new JSONObject ();
342- if (userInfo != null ) {
343- JSONObject userInfoObj = new JSONObject ();
344- if (userInfo .getNumber () != null ) {
345- userInfoObj .put ("number" , userInfo .getNumber ());
346- }
347- if (userInfo .getCountryCode () != null ) {
348- userInfoObj .put ("countryCode" , userInfo .getCountryCode ());
349- }
350- dataObj .put ("userInfo" , userInfoObj );
351- }
352-
353- if (dataObj .length () > 0 ) {
354- jo .put ("data" , dataObj );
355- }
356-
357323 callbackContext .error (jo );
358324 } catch (JSONException e ) {
359325 e .printStackTrace ();
0 commit comments