Braintree/src/main/java/com/braintreepayments/api/models/ThreeDSecureAuthenticationResponse.java
public static ThreeDSecureAuthenticationResponse fromJson(String jsonString) {
        ThreeDSecureAuthenticationResponse authenticationResponse = new ThreeDSecureAuthenticationResponse();

        try {
            JSONObject json = new JSONObject(jsonString);

            JSONObject cardJson = json.optJSONObject(PAYMENT_METHOD_KEY);
            if (cardJson != null) {
                CardNonce cardNonce = new CardNonce();
                cardNonce.fromJson(cardJson);
                authenticationResponse.mCardNonce = cardNonce;
            }

            authenticationResponse.mSuccess = json.getBoolean(SUCCESS_KEY);

            if (!authenticationResponse.mSuccess) {
                authenticationResponse.mErrors = jsonString;
            }
        } catch (JSONException e) {
            authenticationResponse.mSuccess = false;
        }

        return authenticationResponse;
    }
public static ThreeDSecureAuthenticationResponse fromJson(String jsonString) {
        ThreeDSecureAuthenticationResponse authenticationResponse = new ThreeDSecureAuthenticationResponse();

        try {
            JSONObject json = new JSONObject(jsonString);

            JSONObject cardJson = json.optJSONObject(PAYMENT_METHOD_KEY);
            if (cardJson != null) {
                CardNonce cardNonce = new CardNonce();
                cardNonce.fromJson(cardJson);
                authenticationResponse.mCardNonce = cardNonce;
            }

            authenticationResponse.mSuccess = json.getBoolean(SUCCESS_KEY);

            if (!authenticationResponse.mSuccess) {
                authenticationResponse.mErrors = jsonString;
            }
        } catch (JSONException e) {
            authenticationResponse.mSuccess = false;
        }

        return authenticationResponse;
    }
public static ThreeDSecureAuthenticationResponse fromJson ( String jsonString ) { ThreeDSecureAuthenticationResponse authenticationResponse = new ThreeDSecureAuthenticationResponse ( ) ; try { JSONObject json = new JSONObject ( jsonString ) ; JSONObject cardJson = json . optJSONObject ( PAYMENT_METHOD_KEY ) ; if ( cardJson != null ) { CardNonce cardNonce = new CardNonce ( ) ; cardNonce . fromJson ( cardJson ) ; authenticationResponse . mCardNonce = cardNonce ; } authenticationResponse . mSuccess = json . getBoolean ( SUCCESS_KEY ) ; if ( ! authenticationResponse . mSuccess ) { authenticationResponse . mErrors = jsonString ; } } catch ( JSONException e ) { authenticationResponse . mSuccess = false ; } return authenticationResponse ; }
Used to parse a response from the Braintree Gateway to be used for 3D Secure.

@param jsonString The json response from the Braintree Gateway 3D Secure authentication route.
@return The {@link ThreeDSecureAuthenticationResponse} to use when performing 3D Secure
authentication.
Used to parse a response from the Braintree Gateway to be used for 3D Secure .