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

com.braintreegateway.CustomActionsPaymentMethod Maven / Gradle / Ivy

The newest version!
package com.braintreegateway;

import com.braintreegateway.util.NodeWrapper;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;

public class CustomActionsPaymentMethod implements PaymentMethod {

  private Calendar createdAt;
  private String customerId;
  private String globalId;
  private boolean isDefault;
  private String imageUrl;
  private String uniqueNumberIdentifier;
  private List subscriptions;
  private String token;
  private Calendar updatedAt;
  private String actionName;
  private List fields;

  public CustomActionsPaymentMethod(NodeWrapper node) {
    token = node.findString("token");
    globalId = node.findString("global-id");
    createdAt = node.findDateTime("created-at");
    updatedAt = node.findDateTime("updated-at");
    customerId = node.findString("customer-id");
    imageUrl = node.findString("image-url");
    isDefault = node.findBoolean("default");
    uniqueNumberIdentifier = node.findString("unique-number-identifier");
    actionName = node.findString("action-name");
    fields = new ArrayList();
    for (NodeWrapper fieldResponse : node.findAll("fields/field")) {
      fields.add(new CustomActionsPaymentMethodField(fieldResponse));
    }
    subscriptions = new ArrayList();
    for (NodeWrapper subscriptionResponse : node.findAll("subscriptions/subscription")) {
      subscriptions.add(new Subscription(subscriptionResponse));
    }
  }

  public String getGlobalId() {
    return globalId;
  }

  public Calendar getCreatedAt() {
    return createdAt;
  }

  public String getCustomerId() {
    return customerId;
  }

  public String getImageUrl() {
    return imageUrl;
  }

  public String getUniqueNumberIdentifier() {
    return uniqueNumberIdentifier;
  }

  public List getSubscriptions() {
    return subscriptions;
  }

  public String getToken() {
    return token;
  }

  public Calendar getUpdatedAt() {
    return updatedAt;
  }

  public boolean isDefault() {
    return isDefault;
  }

  public List getFields() {
    return Collections.unmodifiableList(fields);
  }

  public String getActionName() {
    return actionName;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy