• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-java / #16380

30 Aug 2024 07:54PM UTC coverage: 12.882% (-0.004%) from 12.886%
#16380

push

github

web-flow
Merge from master after the changes to not pass api_mode from individual methods (#1857)

* Generate SDK for OpenAPI spec version 1230 (#1856)

* Bump version to 26.9.0

* No need for APIMode to be passed around from individual API methods (#1855)

* Generated code

* Update the code around raw request

* Update the v2 tests to use v2 path

16 of 23 new or added lines in 7 files covered. (69.57%)

706 existing lines in 213 files now uncovered.

18468 of 143365 relevant lines covered (12.88%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.62
/src/main/java/com/stripe/model/financialconnections/Transaction.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model.financialconnections;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.HasId;
7
import com.stripe.model.StripeObject;
8
import com.stripe.net.ApiRequest;
9
import com.stripe.net.ApiRequestParams;
10
import com.stripe.net.ApiResource;
11
import com.stripe.net.BaseAddress;
12
import com.stripe.net.RequestOptions;
13
import com.stripe.net.StripeResponseGetter;
14
import com.stripe.param.financialconnections.TransactionListParams;
15
import com.stripe.param.financialconnections.TransactionRetrieveParams;
16
import java.util.Map;
17
import lombok.EqualsAndHashCode;
18
import lombok.Getter;
19
import lombok.Setter;
20

21
/**
22
 * A Transaction represents a real transaction that affects a Financial Connections Account balance.
23
 */
24
@Getter
25
@Setter
26
@EqualsAndHashCode(callSuper = false)
27
public class Transaction extends ApiResource implements HasId {
1✔
28
  /** The ID of the Financial Connections Account this transaction belongs to. */
29
  @SerializedName("account")
30
  String account;
31

32
  /** The amount of this transaction, in cents (or local equivalent). */
33
  @SerializedName("amount")
34
  Long amount;
35

36
  /**
37
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
38
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
39
   */
40
  @SerializedName("currency")
41
  String currency;
42

43
  /** The description of this transaction. */
44
  @SerializedName("description")
45
  String description;
46

47
  /** Unique identifier for the object. */
48
  @Getter(onMethod_ = {@Override})
49
  @SerializedName("id")
50
  String id;
51

52
  /**
53
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
54
   * object exists in test mode.
55
   */
56
  @SerializedName("livemode")
57
  Boolean livemode;
58

59
  /**
60
   * String representing the object's type. Objects of the same type share the same value.
61
   *
62
   * <p>Equal to {@code financial_connections.transaction}.
63
   */
64
  @SerializedName("object")
65
  String object;
66

67
  /**
68
   * The status of the transaction.
69
   *
70
   * <p>One of {@code pending}, {@code posted}, or {@code void}.
71
   */
72
  @SerializedName("status")
73
  String status;
74

75
  @SerializedName("status_transitions")
76
  StatusTransitions statusTransitions;
77

78
  /** Time at which the transaction was transacted. Measured in seconds since the Unix epoch. */
79
  @SerializedName("transacted_at")
80
  Long transactedAt;
81

82
  /** The token of the transaction refresh that last updated or created this transaction. */
83
  @SerializedName("transaction_refresh")
84
  String transactionRefresh;
85

86
  /** Time at which the object was last updated. Measured in seconds since the Unix epoch. */
87
  @SerializedName("updated")
88
  Long updated;
89

90
  /** Returns a list of Financial Connections {@code Transaction} objects. */
91
  public static TransactionCollection list(Map<String, Object> params) throws StripeException {
92
    return list(params, (RequestOptions) null);
×
93
  }
94

95
  /** Returns a list of Financial Connections {@code Transaction} objects. */
96
  public static TransactionCollection list(Map<String, Object> params, RequestOptions options)
97
      throws StripeException {
98
    String path = "/v1/financial_connections/transactions";
×
99
    ApiRequest request =
×
100
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
UNCOV
101
    return getGlobalResponseGetter().request(request, TransactionCollection.class);
×
102
  }
103

104
  /** Returns a list of Financial Connections {@code Transaction} objects. */
105
  public static TransactionCollection list(TransactionListParams params) throws StripeException {
106
    return list(params, (RequestOptions) null);
1✔
107
  }
108

109
  /** Returns a list of Financial Connections {@code Transaction} objects. */
110
  public static TransactionCollection list(TransactionListParams params, RequestOptions options)
111
      throws StripeException {
112
    String path = "/v1/financial_connections/transactions";
1✔
113
    ApiResource.checkNullTypedParams(path, params);
1✔
114
    ApiRequest request =
1✔
115
        new ApiRequest(
116
            BaseAddress.API,
117
            ApiResource.RequestMethod.GET,
118
            path,
119
            ApiRequestParams.paramsToMap(params),
1✔
120
            options);
121
    return getGlobalResponseGetter().request(request, TransactionCollection.class);
1✔
122
  }
123

124
  /** Retrieves the details of a Financial Connections {@code Transaction}. */
125
  public static Transaction retrieve(String transaction) throws StripeException {
126
    return retrieve(transaction, (Map<String, Object>) null, (RequestOptions) null);
1✔
127
  }
128

129
  /** Retrieves the details of a Financial Connections {@code Transaction}. */
130
  public static Transaction retrieve(String transaction, RequestOptions options)
131
      throws StripeException {
132
    return retrieve(transaction, (Map<String, Object>) null, options);
×
133
  }
134

135
  /** Retrieves the details of a Financial Connections {@code Transaction}. */
136
  public static Transaction retrieve(
137
      String transaction, Map<String, Object> params, RequestOptions options)
138
      throws StripeException {
139
    String path =
1✔
140
        String.format(
1✔
141
            "/v1/financial_connections/transactions/%s", ApiResource.urlEncodeId(transaction));
1✔
142
    ApiRequest request =
1✔
143
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
144
    return getGlobalResponseGetter().request(request, Transaction.class);
1✔
145
  }
146

147
  /** Retrieves the details of a Financial Connections {@code Transaction}. */
148
  public static Transaction retrieve(
149
      String transaction, TransactionRetrieveParams params, RequestOptions options)
150
      throws StripeException {
151
    String path =
×
152
        String.format(
×
153
            "/v1/financial_connections/transactions/%s", ApiResource.urlEncodeId(transaction));
×
154
    ApiResource.checkNullTypedParams(path, params);
×
155
    ApiRequest request =
×
156
        new ApiRequest(
157
            BaseAddress.API,
158
            ApiResource.RequestMethod.GET,
159
            path,
160
            ApiRequestParams.paramsToMap(params),
×
161
            options);
UNCOV
162
    return getGlobalResponseGetter().request(request, Transaction.class);
×
163
  }
164

165
  @Getter
166
  @Setter
167
  @EqualsAndHashCode(callSuper = false)
168
  public static class StatusTransitions extends StripeObject {
1✔
169
    /** Time at which this transaction posted. Measured in seconds since the Unix epoch. */
170
    @SerializedName("posted_at")
171
    Long postedAt;
172

173
    /** Time at which this transaction was voided. Measured in seconds since the Unix epoch. */
174
    @SerializedName("void_at")
175
    Long voidAt;
176
  }
177

178
  @Override
179
  public void setResponseGetter(StripeResponseGetter responseGetter) {
180
    super.setResponseGetter(responseGetter);
1✔
181
    trySetResponseGetter(statusTransitions, responseGetter);
1✔
182
  }
1✔
183
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc