package com.braintreegateway;

import com.braintreegateway.util.NodeWrapper;

public class PaymentMethodNonce {
    private String publicId;
    private Boolean isLocked;
    private Boolean isConsumed;
    private PaymentMethodNonceDetails details;
    private ThreeDSecureInfo threeDSecureInfo;

    public PaymentMethodNonce(NodeWrapper node) {
        publicId = node.findString("nonce");
        isLocked = node.findBoolean("locked");
        isConsumed = node.findBoolean("consumed");

        NodeWrapper detailsNode = node.findFirst("details");
        if (detailsNode != null && !detailsNode.isBlank()) {
            details = new PaymentMethodNonceDetails(detailsNode);
        }

        NodeWrapper threeDSecureInfoNode = node.findFirst("three-d-secure-info");
        if (threeDSecureInfoNode != null && !threeDSecureInfoNode.isBlank()) {
            threeDSecureInfo = new ThreeDSecureInfo(threeDSecureInfoNode);
        }
    }

    public String getPublicId() {
        return publicId;
    }

    public String getNonce() {
        return getPublicId();
    }

    public Boolean isLocked() {
        return isLocked;
    }

    public Boolean isConsumed() {
        return isConsumed;
    }

    public PaymentMethodNonceDetails getDetails() {
        return details;
    }

    public ThreeDSecureInfo getThreeDSecureInfo() {
        return threeDSecureInfo;
    }
}

@@ -105,16 +105,47 @@
 Nonce %7B%0A
+    private Boolean isDefault;%0A
     priv
@@ -161,24 +161,24 @@
 g publicId;%0A
-
     private 
@@ -320,16 +320,41 @@
 ureInfo;
+%0A    private String type;
 %0A%0A    pu
@@ -393,24 +393,73 @@
 per node) %7B%0A
+        isDefault = node.findBoolean(%22default%22);%0A
         publ
@@ -588,16 +588,56 @@
 sumed%22);
+%0A        type = node.findString(%22type%22);
 %0A%0A      
@@ -1074,32 +1074,98 @@
        %7D%0A    %7D%0A%0A
+    public Boolean isDefault() %7B%0A        return isDefault;%0A    %7D%0A%0A
     public Strin
@@ -1545,24 +1545,24 @@
 ureInfo() %7B%0A
-
         retu
@@ -1587,11 +1587,69 @@
 o;%0A    %7D
+%0A%0A    public String getType() %7B%0A        return type;%0A    %7D
 %0A%7D%0A

add other missing fields