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

com.stripe.model.CustomerBalanceTransactionCollection Maven / Gradle / Ivy

There is a newer version: 28.2.0
Show newest version
package com.stripe.model;

import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.CustomerBalanceTransactionCollectionCreateParams;
import com.stripe.param.CustomerBalanceTransactionCollectionListParams;
import com.stripe.param.CustomerBalanceTransactionCollectionRetrieveParams;
import java.util.Map;

public class CustomerBalanceTransactionCollection
    extends StripeCollection {
  /**
   * Retrieves a specific transaction that updated the customer’s balance.
   */
  public CustomerBalanceTransaction retrieve(String id) throws StripeException {
    return retrieve(id, (Map) null, (RequestOptions) null);
  }

  /**
   * Retrieves a specific transaction that updated the customer’s balance.
   */
  public CustomerBalanceTransaction retrieve(String id, RequestOptions options)
      throws StripeException {
    return retrieve(id, (Map) null, options);
  }

  /**
   * Retrieves a specific transaction that updated the customer’s balance.
   */
  public CustomerBalanceTransaction retrieve(
      String id, Map params, RequestOptions options) throws StripeException {
    String url =
        String.format(
            "%s%s",
            Stripe.getApiBase(),
            String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
    return ApiResource.request(
        ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options);
  }

  /**
   * Retrieves a specific transaction that updated the customer’s balance.
   */
  public CustomerBalanceTransaction retrieve(
      String id, CustomerBalanceTransactionCollectionRetrieveParams params, RequestOptions options)
      throws StripeException {
    String url =
        String.format(
            "%s%s",
            Stripe.getApiBase(),
            String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
    return ApiResource.request(
        ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options);
  }

  /**
   * Returns a list of transactions that updated the customer’s balance.
   */
  public CustomerBalanceTransactionCollection list(Map params)
      throws StripeException {
    return list(params, (RequestOptions) null);
  }

  /**
   * Returns a list of transactions that updated the customer’s balance.
   */
  public CustomerBalanceTransactionCollection list(
      Map params, RequestOptions options) throws StripeException {
    String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
    return ApiResource.requestCollection(
        url, params, CustomerBalanceTransactionCollection.class, options);
  }

  /**
   * Returns a list of transactions that updated the customer’s balance.
   */
  public CustomerBalanceTransactionCollection list(
      CustomerBalanceTransactionCollectionListParams params) throws StripeException {
    return list(params, (RequestOptions) null);
  }

  /**
   * Returns a list of transactions that updated the customer’s balance.
   */
  public CustomerBalanceTransactionCollection list(
      CustomerBalanceTransactionCollectionListParams params, RequestOptions options)
      throws StripeException {
    String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
    return ApiResource.requestCollection(
        url, params, CustomerBalanceTransactionCollection.class, options);
  }

  /**
   * Creates an immutable transaction that updates the customer’s balance.
   */
  public CustomerBalanceTransaction create(Map params) throws StripeException {
    return create(params, (RequestOptions) null);
  }

  /**
   * Creates an immutable transaction that updates the customer’s balance.
   */
  public CustomerBalanceTransaction create(Map params, RequestOptions options)
      throws StripeException {
    String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
    return ApiResource.request(
        ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options);
  }

  /**
   * Creates an immutable transaction that updates the customer’s balance.
   */
  public CustomerBalanceTransaction create(CustomerBalanceTransactionCollectionCreateParams params)
      throws StripeException {
    return create(params, (RequestOptions) null);
  }

  /**
   * Creates an immutable transaction that updates the customer’s balance.
   */
  public CustomerBalanceTransaction create(
      CustomerBalanceTransactionCollectionCreateParams params, RequestOptions options)
      throws StripeException {
    String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
    return ApiResource.request(
        ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy