@whop/sdk 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/client.d.mts +11 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +11 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/app-builds.d.mts +4 -0
  12. package/resources/app-builds.d.mts.map +1 -1
  13. package/resources/app-builds.d.ts +4 -0
  14. package/resources/app-builds.d.ts.map +1 -1
  15. package/resources/index.d.mts +4 -2
  16. package/resources/index.d.mts.map +1 -1
  17. package/resources/index.d.ts +4 -2
  18. package/resources/index.d.ts.map +1 -1
  19. package/resources/index.js +5 -1
  20. package/resources/index.js.map +1 -1
  21. package/resources/index.mjs +2 -0
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/invoices.d.mts +20 -0
  24. package/resources/invoices.d.mts.map +1 -1
  25. package/resources/invoices.d.ts +20 -0
  26. package/resources/invoices.d.ts.map +1 -1
  27. package/resources/payment-methods.d.mts +163 -0
  28. package/resources/payment-methods.d.mts.map +1 -0
  29. package/resources/payment-methods.d.ts +163 -0
  30. package/resources/payment-methods.d.ts.map +1 -0
  31. package/resources/payment-methods.js +42 -0
  32. package/resources/payment-methods.js.map +1 -0
  33. package/resources/payment-methods.mjs +38 -0
  34. package/resources/payment-methods.mjs.map +1 -0
  35. package/resources/payments.d.mts +255 -1
  36. package/resources/payments.d.mts.map +1 -1
  37. package/resources/payments.d.ts +255 -1
  38. package/resources/payments.d.ts.map +1 -1
  39. package/resources/payments.js +33 -0
  40. package/resources/payments.js.map +1 -1
  41. package/resources/payments.mjs +33 -0
  42. package/resources/payments.mjs.map +1 -1
  43. package/resources/setup-intents.d.mts +363 -0
  44. package/resources/setup-intents.d.mts.map +1 -0
  45. package/resources/setup-intents.d.ts +363 -0
  46. package/resources/setup-intents.d.ts.map +1 -0
  47. package/resources/setup-intents.js +46 -0
  48. package/resources/setup-intents.js.map +1 -0
  49. package/resources/setup-intents.mjs +42 -0
  50. package/resources/setup-intents.mjs.map +1 -0
  51. package/resources/shared.d.mts +48 -0
  52. package/resources/shared.d.mts.map +1 -1
  53. package/resources/shared.d.ts +48 -0
  54. package/resources/shared.d.ts.map +1 -1
  55. package/resources/webhooks.d.mts +72 -2
  56. package/resources/webhooks.d.mts.map +1 -1
  57. package/resources/webhooks.d.ts +72 -2
  58. package/resources/webhooks.d.ts.map +1 -1
  59. package/resources/webhooks.js.map +1 -1
  60. package/resources/webhooks.mjs.map +1 -1
  61. package/src/client.ts +47 -1
  62. package/src/resources/app-builds.ts +5 -0
  63. package/src/resources/index.ts +20 -0
  64. package/src/resources/invoices.ts +24 -0
  65. package/src/resources/payment-methods.ts +213 -0
  66. package/src/resources/payments.ts +306 -0
  67. package/src/resources/setup-intents.ts +439 -0
  68. package/src/resources/shared.ts +57 -0
  69. package/src/resources/webhooks.ts +91 -0
  70. package/src/version.ts +1 -1
  71. package/version.d.mts +1 -1
  72. package/version.d.mts.map +1 -1
  73. package/version.d.ts +1 -1
  74. package/version.d.ts.map +1 -1
  75. package/version.js +1 -1
  76. package/version.js.map +1 -1
  77. package/version.mjs +1 -1
  78. package/version.mjs.map +1 -1
@@ -0,0 +1,363 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import * as PaymentsAPI from "./payments.js";
3
+ import * as Shared from "./shared.js";
4
+ import { APIPromise } from "../core/api-promise.js";
5
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
6
+ import { RequestOptions } from "../internal/request-options.js";
7
+ export declare class SetupIntents extends APIResource {
8
+ /**
9
+ * A setup intent is an object used to securely collect and store a member’s
10
+ * payment method for future use without charging them immediately. It handles
11
+ * authentication steps up front so future off-session payments can be completed
12
+ * smoothly. This ensures the payment method is verified and ready for later
13
+ * billing.
14
+ *
15
+ * Required permissions:
16
+ *
17
+ * - `payment:setup_intent:read`
18
+ * - `member:basic:read`
19
+ * - `member:email:read`
20
+ */
21
+ retrieve(id: string, options?: RequestOptions): APIPromise<SetupIntent>;
22
+ /**
23
+ * A setup intent is an object used to securely collect and store a member’s
24
+ * payment method for future use without charging them immediately. It handles
25
+ * authentication steps up front so future off-session payments can be completed
26
+ * smoothly. This ensures the payment method is verified and ready for later
27
+ * billing.
28
+ *
29
+ * Required permissions:
30
+ *
31
+ * - `payment:setup_intent:read`
32
+ * - `member:basic:read`
33
+ * - `member:email:read`
34
+ */
35
+ list(query: SetupIntentListParams, options?: RequestOptions): PagePromise<SetupIntentListResponsesCursorPage, SetupIntentListResponse>;
36
+ }
37
+ export type SetupIntentListResponsesCursorPage = CursorPage<SetupIntentListResponse>;
38
+ /**
39
+ * An object representing a setup intent, which is a flow for allowing a customer
40
+ * to add a payment method to their account without making a purchase.
41
+ */
42
+ export interface SetupIntent {
43
+ /**
44
+ * The setup intent ID
45
+ */
46
+ id: string;
47
+ /**
48
+ * The checkout configuration associated with the setup intent
49
+ */
50
+ checkout_configuration: SetupIntent.CheckoutConfiguration | null;
51
+ /**
52
+ * The company of the setup intent
53
+ */
54
+ company: SetupIntent.Company | null;
55
+ /**
56
+ * The datetime the payment was created
57
+ */
58
+ created_at: string;
59
+ /**
60
+ * The error message, if any.
61
+ */
62
+ error_message: string | null;
63
+ /**
64
+ * The member connected to the setup intent
65
+ */
66
+ member: SetupIntent.Member | null;
67
+ /**
68
+ * The metadata associated with the setup intent
69
+ */
70
+ metadata: {
71
+ [key: string]: unknown;
72
+ } | null;
73
+ /**
74
+ * The payment method created during the setup, if available.
75
+ */
76
+ payment_method: SetupIntent.PaymentMethod | null;
77
+ /**
78
+ * The status of the setup intent
79
+ */
80
+ status: SetupIntentStatus;
81
+ }
82
+ export declare namespace SetupIntent {
83
+ /**
84
+ * The checkout configuration associated with the setup intent
85
+ */
86
+ interface CheckoutConfiguration {
87
+ /**
88
+ * The ID of the checkout configuration
89
+ */
90
+ id: string;
91
+ }
92
+ /**
93
+ * The company of the setup intent
94
+ */
95
+ interface Company {
96
+ /**
97
+ * The ID (tag) of the company.
98
+ */
99
+ id: string;
100
+ }
101
+ /**
102
+ * The member connected to the setup intent
103
+ */
104
+ interface Member {
105
+ /**
106
+ * The ID of the member
107
+ */
108
+ id: string;
109
+ /**
110
+ * The user for this member, if any.
111
+ */
112
+ user: Member.User | null;
113
+ }
114
+ namespace Member {
115
+ /**
116
+ * The user for this member, if any.
117
+ */
118
+ interface User {
119
+ /**
120
+ * The internal ID of the user account.
121
+ */
122
+ id: string;
123
+ /**
124
+ * The digital mailing address of the user.
125
+ */
126
+ email: string | null;
127
+ /**
128
+ * The user's full name.
129
+ */
130
+ name: string | null;
131
+ /**
132
+ * The whop username.
133
+ */
134
+ username: string;
135
+ }
136
+ }
137
+ /**
138
+ * The payment method created during the setup, if available.
139
+ */
140
+ interface PaymentMethod {
141
+ /**
142
+ * The ID of the payment method
143
+ */
144
+ id: string;
145
+ /**
146
+ * The card data associated with the payment method, if its a debit or credit card.
147
+ */
148
+ card: PaymentMethod.Card | null;
149
+ /**
150
+ * The date and time the payment method was created
151
+ */
152
+ created_at: string;
153
+ /**
154
+ * The payment method type of the payment method
155
+ */
156
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
157
+ }
158
+ namespace PaymentMethod {
159
+ /**
160
+ * The card data associated with the payment method, if its a debit or credit card.
161
+ */
162
+ interface Card {
163
+ /**
164
+ * Possible card brands that a payment token can have
165
+ */
166
+ brand: PaymentsAPI.CardBrands | null;
167
+ /**
168
+ * Card expiration month, like 03 for March.
169
+ */
170
+ exp_month: number | null;
171
+ /**
172
+ * Card expiration year, like 27 for 2027.
173
+ */
174
+ exp_year: number | null;
175
+ /**
176
+ * Last four digits of the card.
177
+ */
178
+ last4: string | null;
179
+ }
180
+ }
181
+ }
182
+ /**
183
+ * The status of the setup intent.
184
+ */
185
+ export type SetupIntentStatus = 'processing' | 'succeeded' | 'canceled' | 'requires_action';
186
+ /**
187
+ * An object representing a setup intent, which is a flow for allowing a customer
188
+ * to add a payment method to their account without making a purchase.
189
+ */
190
+ export interface SetupIntentListResponse {
191
+ /**
192
+ * The setup intent ID
193
+ */
194
+ id: string;
195
+ /**
196
+ * The checkout configuration associated with the setup intent
197
+ */
198
+ checkout_configuration: SetupIntentListResponse.CheckoutConfiguration | null;
199
+ /**
200
+ * The company of the setup intent
201
+ */
202
+ company: SetupIntentListResponse.Company | null;
203
+ /**
204
+ * The datetime the payment was created
205
+ */
206
+ created_at: string;
207
+ /**
208
+ * The error message, if any.
209
+ */
210
+ error_message: string | null;
211
+ /**
212
+ * The member connected to the setup intent
213
+ */
214
+ member: SetupIntentListResponse.Member | null;
215
+ /**
216
+ * The metadata associated with the setup intent
217
+ */
218
+ metadata: {
219
+ [key: string]: unknown;
220
+ } | null;
221
+ /**
222
+ * The payment method created during the setup, if available.
223
+ */
224
+ payment_method: SetupIntentListResponse.PaymentMethod | null;
225
+ /**
226
+ * The status of the setup intent
227
+ */
228
+ status: SetupIntentStatus;
229
+ }
230
+ export declare namespace SetupIntentListResponse {
231
+ /**
232
+ * The checkout configuration associated with the setup intent
233
+ */
234
+ interface CheckoutConfiguration {
235
+ /**
236
+ * The ID of the checkout configuration
237
+ */
238
+ id: string;
239
+ }
240
+ /**
241
+ * The company of the setup intent
242
+ */
243
+ interface Company {
244
+ /**
245
+ * The ID (tag) of the company.
246
+ */
247
+ id: string;
248
+ }
249
+ /**
250
+ * The member connected to the setup intent
251
+ */
252
+ interface Member {
253
+ /**
254
+ * The ID of the member
255
+ */
256
+ id: string;
257
+ /**
258
+ * The user for this member, if any.
259
+ */
260
+ user: Member.User | null;
261
+ }
262
+ namespace Member {
263
+ /**
264
+ * The user for this member, if any.
265
+ */
266
+ interface User {
267
+ /**
268
+ * The internal ID of the user account.
269
+ */
270
+ id: string;
271
+ /**
272
+ * The digital mailing address of the user.
273
+ */
274
+ email: string | null;
275
+ /**
276
+ * The user's full name.
277
+ */
278
+ name: string | null;
279
+ /**
280
+ * The whop username.
281
+ */
282
+ username: string;
283
+ }
284
+ }
285
+ /**
286
+ * The payment method created during the setup, if available.
287
+ */
288
+ interface PaymentMethod {
289
+ /**
290
+ * The ID of the payment method
291
+ */
292
+ id: string;
293
+ /**
294
+ * The card data associated with the payment method, if its a debit or credit card.
295
+ */
296
+ card: PaymentMethod.Card | null;
297
+ /**
298
+ * The date and time the payment method was created
299
+ */
300
+ created_at: string;
301
+ /**
302
+ * The payment method type of the payment method
303
+ */
304
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
305
+ }
306
+ namespace PaymentMethod {
307
+ /**
308
+ * The card data associated with the payment method, if its a debit or credit card.
309
+ */
310
+ interface Card {
311
+ /**
312
+ * Possible card brands that a payment token can have
313
+ */
314
+ brand: PaymentsAPI.CardBrands | null;
315
+ /**
316
+ * Card expiration month, like 03 for March.
317
+ */
318
+ exp_month: number | null;
319
+ /**
320
+ * Card expiration year, like 27 for 2027.
321
+ */
322
+ exp_year: number | null;
323
+ /**
324
+ * Last four digits of the card.
325
+ */
326
+ last4: string | null;
327
+ }
328
+ }
329
+ }
330
+ export interface SetupIntentListParams extends CursorPageParams {
331
+ /**
332
+ * The ID of the company to list setup intents for
333
+ */
334
+ company_id: string;
335
+ /**
336
+ * Returns the elements in the list that come before the specified cursor.
337
+ */
338
+ before?: string | null;
339
+ /**
340
+ * The minimum creation date to filter by
341
+ */
342
+ created_after?: string | null;
343
+ /**
344
+ * The maximum creation date to filter by
345
+ */
346
+ created_before?: string | null;
347
+ /**
348
+ * The direction of the sort.
349
+ */
350
+ direction?: Shared.Direction | null;
351
+ /**
352
+ * Returns the first _n_ elements from the list.
353
+ */
354
+ first?: number | null;
355
+ /**
356
+ * Returns the last _n_ elements from the list.
357
+ */
358
+ last?: number | null;
359
+ }
360
+ export declare namespace SetupIntents {
361
+ export { type SetupIntent as SetupIntent, type SetupIntentStatus as SetupIntentStatus, type SetupIntentListResponse as SetupIntentListResponse, type SetupIntentListResponsesCursorPage as SetupIntentListResponsesCursorPage, type SetupIntentListParams as SetupIntentListParams, };
362
+ }
363
+ //# sourceMappingURL=setup-intents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-intents.d.ts","sourceRoot":"","sources":["../src/resources/setup-intents.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;IAIvE;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,EAAE,qBAAqB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,kCAAkC,EAAE,uBAAuB,CAAC;CAM5E;AAED,MAAM,MAAM,kCAAkC,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,sBAAsB,EAAE,WAAW,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAEjE;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC;IAElC;;OAEG;IACH,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;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I,WAAW,EAC/B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SetupIntents = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const path_1 = require("../internal/utils/path.js");
8
+ class SetupIntents extends resource_1.APIResource {
9
+ /**
10
+ * A setup intent is an object used to securely collect and store a member’s
11
+ * payment method for future use without charging them immediately. It handles
12
+ * authentication steps up front so future off-session payments can be completed
13
+ * smoothly. This ensures the payment method is verified and ready for later
14
+ * billing.
15
+ *
16
+ * Required permissions:
17
+ *
18
+ * - `payment:setup_intent:read`
19
+ * - `member:basic:read`
20
+ * - `member:email:read`
21
+ */
22
+ retrieve(id, options) {
23
+ return this._client.get((0, path_1.path) `/setup_intents/${id}`, options);
24
+ }
25
+ /**
26
+ * A setup intent is an object used to securely collect and store a member’s
27
+ * payment method for future use without charging them immediately. It handles
28
+ * authentication steps up front so future off-session payments can be completed
29
+ * smoothly. This ensures the payment method is verified and ready for later
30
+ * billing.
31
+ *
32
+ * Required permissions:
33
+ *
34
+ * - `payment:setup_intent:read`
35
+ * - `member:basic:read`
36
+ * - `member:email:read`
37
+ */
38
+ list(query, options) {
39
+ return this._client.getAPIList('/setup_intents', (pagination_1.CursorPage), {
40
+ query,
41
+ ...options,
42
+ });
43
+ }
44
+ }
45
+ exports.SetupIntents = SetupIntents;
46
+ //# sourceMappingURL=setup-intents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-intents.js","sourceRoot":"","sources":["../src/resources/setup-intents.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,kBAAkB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAA,uBAAmC,CAAA,EAAE;YACpF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAxCD,oCAwCC"}
@@ -0,0 +1,42 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { CursorPage } from "../core/pagination.mjs";
4
+ import { path } from "../internal/utils/path.mjs";
5
+ export class SetupIntents extends APIResource {
6
+ /**
7
+ * A setup intent is an object used to securely collect and store a member’s
8
+ * payment method for future use without charging them immediately. It handles
9
+ * authentication steps up front so future off-session payments can be completed
10
+ * smoothly. This ensures the payment method is verified and ready for later
11
+ * billing.
12
+ *
13
+ * Required permissions:
14
+ *
15
+ * - `payment:setup_intent:read`
16
+ * - `member:basic:read`
17
+ * - `member:email:read`
18
+ */
19
+ retrieve(id, options) {
20
+ return this._client.get(path `/setup_intents/${id}`, options);
21
+ }
22
+ /**
23
+ * A setup intent is an object used to securely collect and store a member’s
24
+ * payment method for future use without charging them immediately. It handles
25
+ * authentication steps up front so future off-session payments can be completed
26
+ * smoothly. This ensures the payment method is verified and ready for later
27
+ * billing.
28
+ *
29
+ * Required permissions:
30
+ *
31
+ * - `payment:setup_intent:read`
32
+ * - `member:basic:read`
33
+ * - `member:email:read`
34
+ */
35
+ list(query, options) {
36
+ return this._client.getAPIList('/setup_intents', (CursorPage), {
37
+ query,
38
+ ...options,
39
+ });
40
+ }
41
+ }
42
+ //# sourceMappingURL=setup-intents.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-intents.mjs","sourceRoot":"","sources":["../src/resources/setup-intents.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAA,UAAmC,CAAA,EAAE;YACpF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1640,6 +1640,10 @@ export interface Payment {
1640
1640
  * The datetime the payment was paid
1641
1641
  */
1642
1642
  paid_at: string | null;
1643
+ /**
1644
+ * The payment method used for the payment, if available.
1645
+ */
1646
+ payment_method: Payment.PaymentMethod | null;
1643
1647
  /**
1644
1648
  * The different types of payment methods that can be used.
1645
1649
  */
@@ -1782,6 +1786,50 @@ export declare namespace Payment {
1782
1786
  */
1783
1787
  status: Shared.MembershipStatus;
1784
1788
  }
1789
+ /**
1790
+ * The payment method used for the payment, if available.
1791
+ */
1792
+ interface PaymentMethod {
1793
+ /**
1794
+ * The ID of the payment method
1795
+ */
1796
+ id: string;
1797
+ /**
1798
+ * The card data associated with the payment method, if its a debit or credit card.
1799
+ */
1800
+ card: PaymentMethod.Card | null;
1801
+ /**
1802
+ * The date and time the payment method was created
1803
+ */
1804
+ created_at: string;
1805
+ /**
1806
+ * The payment method type of the payment method
1807
+ */
1808
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
1809
+ }
1810
+ namespace PaymentMethod {
1811
+ /**
1812
+ * The card data associated with the payment method, if its a debit or credit card.
1813
+ */
1814
+ interface Card {
1815
+ /**
1816
+ * Possible card brands that a payment token can have
1817
+ */
1818
+ brand: PaymentsAPI.CardBrands | null;
1819
+ /**
1820
+ * Card expiration month, like 03 for March.
1821
+ */
1822
+ exp_month: number | null;
1823
+ /**
1824
+ * Card expiration year, like 27 for 2027.
1825
+ */
1826
+ exp_year: number | null;
1827
+ /**
1828
+ * Last four digits of the card.
1829
+ */
1830
+ last4: string | null;
1831
+ }
1832
+ }
1785
1833
  /**
1786
1834
  * The plan attached to this payment.
1787
1835
  */