All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.braintreegateway.RevokedPaymentMethodMetadata Maven / Gradle / Ivy

package com.braintreegateway;

import com.braintreegateway.exceptions.UnexpectedException;
import com.braintreegateway.util.NodeWrapper;
import com.braintreegateway.util.PaymentMethodParser;

public class RevokedPaymentMethodMetadata {
    private String customerId;
    private String token;
    private PaymentMethod revokedPaymentMethod;

    public RevokedPaymentMethodMetadata(NodeWrapper node) {
        if (node.getChildren().size() == 0) {
            throw new UnexpectedException("Couldn't parse webhook");
        }

        revokedPaymentMethod = PaymentMethodParser.parsePaymentMethod(node.getChildren().get(0)).getTarget();
        customerId = revokedPaymentMethod.getCustomerId();
        token = revokedPaymentMethod.getToken();
    }

    public String getToken() {
        return token;
    }

    public String getCustomerId() {
        return customerId;
    }

    public PaymentMethod getRevokedPaymentMethod() {
        return revokedPaymentMethod;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy