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

com.stripe.service.SourceTransactionService Maven / Gradle / Ivy

There is a newer version: 28.1.0-beta.3
Show newest version
// File generated from our OpenAPI spec
package com.stripe.service;

import com.google.gson.reflect.TypeToken;
import com.stripe.exception.StripeException;
import com.stripe.model.SourceTransaction;
import com.stripe.model.StripeCollection;
import com.stripe.net.ApiRequest;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
import com.stripe.net.ApiService;
import com.stripe.net.BaseAddress;
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.SourceTransactionListParams;

public final class SourceTransactionService extends ApiService {
  public SourceTransactionService(StripeResponseGetter responseGetter) {
    super(responseGetter);
  }

  /** List source transactions for a given source. */
  public StripeCollection list(String source, SourceTransactionListParams params)
      throws StripeException {
    return list(source, params, (RequestOptions) null);
  }
  /** List source transactions for a given source. */
  public StripeCollection list(String source, RequestOptions options)
      throws StripeException {
    return list(source, (SourceTransactionListParams) null, options);
  }
  /** List source transactions for a given source. */
  public StripeCollection list(String source) throws StripeException {
    return list(source, (SourceTransactionListParams) null, (RequestOptions) null);
  }
  /** List source transactions for a given source. */
  public StripeCollection list(
      String source, SourceTransactionListParams params, RequestOptions options)
      throws StripeException {
    String path =
        String.format("/v1/sources/%s/source_transactions", ApiResource.urlEncodeId(source));
    ApiRequest request =
        new ApiRequest(
            BaseAddress.API,
            ApiResource.RequestMethod.GET,
            path,
            ApiRequestParams.paramsToMap(params),
            options);
    return this.request(request, new TypeToken>() {}.getType());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy