@whop/sdk 0.0.10 → 0.0.12

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 (96) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/client.d.mts +5 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/checkout-configurations.d.mts +4 -0
  12. package/resources/checkout-configurations.d.mts.map +1 -1
  13. package/resources/checkout-configurations.d.ts +4 -0
  14. package/resources/checkout-configurations.d.ts.map +1 -1
  15. package/resources/index.d.mts +2 -2
  16. package/resources/index.d.mts.map +1 -1
  17. package/resources/index.d.ts +2 -2
  18. package/resources/index.d.ts.map +1 -1
  19. package/resources/index.js +3 -3
  20. package/resources/index.js.map +1 -1
  21. package/resources/index.mjs +1 -1
  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 +23 -23
  36. package/resources/payments.d.mts.map +1 -1
  37. package/resources/payments.d.ts +23 -23
  38. package/resources/payments.d.ts.map +1 -1
  39. package/resources/payments.js +6 -4
  40. package/resources/payments.js.map +1 -1
  41. package/resources/payments.mjs +6 -4
  42. package/resources/payments.mjs.map +1 -1
  43. package/resources/plans.d.mts +8 -0
  44. package/resources/plans.d.mts.map +1 -1
  45. package/resources/plans.d.ts +8 -0
  46. package/resources/plans.d.ts.map +1 -1
  47. package/resources/products.d.mts +1 -1
  48. package/resources/products.d.ts +1 -1
  49. package/resources/setup-intents.d.mts +32 -28
  50. package/resources/setup-intents.d.mts.map +1 -1
  51. package/resources/setup-intents.d.ts +32 -28
  52. package/resources/setup-intents.d.ts.map +1 -1
  53. package/resources/setup-intents.js +10 -2
  54. package/resources/setup-intents.js.map +1 -1
  55. package/resources/setup-intents.mjs +10 -2
  56. package/resources/setup-intents.mjs.map +1 -1
  57. package/resources/shared.d.mts +17 -15
  58. package/resources/shared.d.mts.map +1 -1
  59. package/resources/shared.d.ts +17 -15
  60. package/resources/shared.d.ts.map +1 -1
  61. package/resources/webhooks.d.mts +269 -2
  62. package/resources/webhooks.d.mts.map +1 -1
  63. package/resources/webhooks.d.ts +269 -2
  64. package/resources/webhooks.d.ts.map +1 -1
  65. package/resources/webhooks.js.map +1 -1
  66. package/resources/webhooks.mjs.map +1 -1
  67. package/resources/withdrawals.d.mts +26 -34
  68. package/resources/withdrawals.d.mts.map +1 -1
  69. package/resources/withdrawals.d.ts +26 -34
  70. package/resources/withdrawals.d.ts.map +1 -1
  71. package/src/client.ts +19 -15
  72. package/src/resources/checkout-configurations.ts +5 -0
  73. package/src/resources/index.ts +9 -7
  74. package/src/resources/invoices.ts +24 -0
  75. package/src/resources/payment-methods.ts +213 -0
  76. package/src/resources/payments.ts +23 -23
  77. package/src/resources/plans.ts +10 -0
  78. package/src/resources/products.ts +1 -1
  79. package/src/resources/setup-intents.ts +32 -28
  80. package/src/resources/shared.ts +18 -15
  81. package/src/resources/webhooks.ts +417 -0
  82. package/src/resources/withdrawals.ts +76 -95
  83. package/src/version.ts +1 -1
  84. package/version.d.mts +1 -1
  85. package/version.d.ts +1 -1
  86. package/version.js +1 -1
  87. package/version.mjs +1 -1
  88. package/resources/payment-tokens.d.mts +0 -157
  89. package/resources/payment-tokens.d.mts.map +0 -1
  90. package/resources/payment-tokens.d.ts +0 -157
  91. package/resources/payment-tokens.d.ts.map +0 -1
  92. package/resources/payment-tokens.js +0 -34
  93. package/resources/payment-tokens.js.map +0 -1
  94. package/resources/payment-tokens.mjs +0 -30
  95. package/resources/payment-tokens.mjs.map +0 -1
  96. package/src/resources/payment-tokens.ts +0 -207
@@ -87,6 +87,67 @@ export interface WithdrawalRetrieveResponse {
87
87
  */
88
88
  currency: Shared.Currency;
89
89
 
90
+ /**
91
+ * The different error codes a payout can be in.
92
+ */
93
+ error_code:
94
+ | 'account_closed'
95
+ | 'account_does_not_exist'
96
+ | 'account_information_invalid'
97
+ | 'account_number_invalid_region'
98
+ | 'account_frozen'
99
+ | 'account_lookup_failed'
100
+ | 'account_not_found'
101
+ | 'amount_out_of_bounds'
102
+ | 'attributes_not_validated'
103
+ | 'b2b_payments_prohibited'
104
+ | 'bank_statement_required'
105
+ | 'compliance_review'
106
+ | 'currency_not_supported'
107
+ | 'deposit_canceled'
108
+ | 'deposit_failed'
109
+ | 'deposit_rejected'
110
+ | 'destination_unavailable'
111
+ | 'exceeded_account_limit'
112
+ | 'expired_quote'
113
+ | 'generic_payout_error'
114
+ | 'technical_problem'
115
+ | 'identification_number_invalid'
116
+ | 'invalid_account_number'
117
+ | 'invalid_bank_code'
118
+ | 'invalid_beneficiary'
119
+ | 'invalid_branch_number'
120
+ | 'invalid_branch_code'
121
+ | 'invalid_phone_number'
122
+ | 'invalid_routing_number'
123
+ | 'invalid_swift_code'
124
+ | 'invalid_company_details'
125
+ | 'manual_cancelation'
126
+ | 'misc_error'
127
+ | 'missing_city_and_country'
128
+ | 'missing_phone_number'
129
+ | 'missing_remittance_info'
130
+ | 'payee_name_invalid'
131
+ | 'receiving_account_locked'
132
+ | 'rejected_by_compliance'
133
+ | 'rtp_not_supported'
134
+ | 'non_transaction_account'
135
+ | 'source_token_insufficient_funds'
136
+ | 'ssn_invalid'
137
+ | 'wallet_screenshot_required'
138
+ | 'unsupported_region'
139
+ | null;
140
+
141
+ /**
142
+ * The error message for the withdrawal, if any.
143
+ */
144
+ error_message: string | null;
145
+
146
+ /**
147
+ * The estimated availability date for the withdrawal, if any.
148
+ */
149
+ estimated_availability: string | null;
150
+
90
151
  /**
91
152
  * The fee amount that was charged for the withdrawal. This is in the same currency
92
153
  * as the withdrawal amount.
@@ -99,9 +160,9 @@ export interface WithdrawalRetrieveResponse {
99
160
  fee_type: WithdrawalFeeTypes | null;
100
161
 
101
162
  /**
102
- * The latest payout associated with this withdrawal, if any.
163
+ * The ledger account associated with the withdrawal.
103
164
  */
104
- latest_payout: WithdrawalRetrieveResponse.LatestPayout | null;
165
+ ledger_account: WithdrawalRetrieveResponse.LedgerAccount;
105
166
 
106
167
  /**
107
168
  * The payout token used for the withdrawal, if applicable.
@@ -118,6 +179,12 @@ export interface WithdrawalRetrieveResponse {
118
179
  */
119
180
  status: WithdrawalStatus;
120
181
 
182
+ /**
183
+ * The trace code for the payout, if applicable. Provided on ACH transactions when
184
+ * available.
185
+ */
186
+ trace_code: string | null;
187
+
121
188
  /**
122
189
  * The type of withdrawal.
123
190
  */
@@ -126,104 +193,18 @@ export interface WithdrawalRetrieveResponse {
126
193
 
127
194
  export namespace WithdrawalRetrieveResponse {
128
195
  /**
129
- * The latest payout associated with this withdrawal, if any.
196
+ * The ledger account associated with the withdrawal.
130
197
  */
131
- export interface LatestPayout {
198
+ export interface LedgerAccount {
132
199
  /**
133
- * The internal ID of the payout.
200
+ * The ID of the LedgerAccount.
134
201
  */
135
202
  id: string;
136
203
 
137
204
  /**
138
- * The date and time the payout was created.
139
- */
140
- created_at: string;
141
-
142
- /**
143
- * The different error codes a payout can be in.
205
+ * The ID of the company associated with this ledger account.
144
206
  */
145
- error_code:
146
- | 'account_closed'
147
- | 'account_does_not_exist'
148
- | 'account_information_invalid'
149
- | 'account_number_invalid_region'
150
- | 'account_frozen'
151
- | 'account_lookup_failed'
152
- | 'account_not_found'
153
- | 'amount_out_of_bounds'
154
- | 'attributes_not_validated'
155
- | 'b2b_payments_prohibited'
156
- | 'bank_statement_required'
157
- | 'compliance_review'
158
- | 'currency_not_supported'
159
- | 'deposit_canceled'
160
- | 'deposit_failed'
161
- | 'deposit_rejected'
162
- | 'destination_unavailable'
163
- | 'exceeded_account_limit'
164
- | 'expired_quote'
165
- | 'generic_payout_error'
166
- | 'technical_problem'
167
- | 'identification_number_invalid'
168
- | 'invalid_account_number'
169
- | 'invalid_bank_code'
170
- | 'invalid_beneficiary'
171
- | 'invalid_branch_number'
172
- | 'invalid_branch_code'
173
- | 'invalid_phone_number'
174
- | 'invalid_routing_number'
175
- | 'invalid_swift_code'
176
- | 'invalid_company_details'
177
- | 'manual_cancelation'
178
- | 'misc_error'
179
- | 'missing_city_and_country'
180
- | 'missing_phone_number'
181
- | 'missing_remittance_info'
182
- | 'payee_name_invalid'
183
- | 'receiving_account_locked'
184
- | 'rejected_by_compliance'
185
- | 'rtp_not_supported'
186
- | 'non_transaction_account'
187
- | 'source_token_insufficient_funds'
188
- | 'ssn_invalid'
189
- | 'wallet_screenshot_required'
190
- | 'unsupported_region'
191
- | null;
192
-
193
- /**
194
- * The error message for the payout.
195
- */
196
- error_message: string | null;
197
-
198
- /**
199
- * The estimated availability date of the payout.
200
- */
201
- estimated_availability: string | null;
202
-
203
- /**
204
- * The name of the payer for the payout.
205
- */
206
- payer_name: string | null;
207
-
208
- /**
209
- * The status of the payout.
210
- */
211
- status:
212
- | 'scheduled'
213
- | 'pending'
214
- | 'processing'
215
- | 'completed'
216
- | 'canceled'
217
- | 'ready_for_pickup'
218
- | 'hold'
219
- | 'error'
220
- | 'expired';
221
-
222
- /**
223
- * The trace code for the payout, if applicable. Provided on ACH transactions when
224
- * available.
225
- */
226
- trace_code: string | null;
207
+ company_id: string | null;
227
208
  }
228
209
 
229
210
  /**
@@ -253,9 +234,9 @@ export namespace WithdrawalRetrieveResponse {
253
234
  nickname: string | null;
254
235
 
255
236
  /**
256
- * The status of the payout token.
237
+ * The name of the payer associated with the payout token.
257
238
  */
258
- status: 'created' | 'active' | 'broken';
239
+ payer_name: string | null;
259
240
  }
260
241
  }
261
242
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.10'; // x-release-please-version
1
+ export const VERSION = '0.0.12'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.10";
1
+ export declare const VERSION = "0.0.12";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.10";
1
+ export declare const VERSION = "0.0.12";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.0.10'; // x-release-please-version
4
+ exports.VERSION = '0.0.12'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.10'; // x-release-please-version
1
+ export const VERSION = '0.0.12'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
@@ -1,157 +0,0 @@
1
- import { APIResource } from "../core/resource.mjs";
2
- import * as PaymentsAPI from "./payments.mjs";
3
- import * as Shared from "./shared.mjs";
4
- import { APIPromise } from "../core/api-promise.mjs";
5
- import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.mjs";
6
- import { RequestOptions } from "../internal/request-options.mjs";
7
- export declare class PaymentTokens extends APIResource {
8
- /**
9
- * Retrieves a PaymentToken by ID
10
- *
11
- * Required permissions:
12
- *
13
- * - `member:payment_methods:read`
14
- */
15
- retrieve(id: string, query: PaymentTokenRetrieveParams, options?: RequestOptions): APIPromise<PaymentTokenRetrieveResponse>;
16
- /**
17
- * Lists PaymentTokens
18
- *
19
- * Required permissions:
20
- *
21
- * - `member:payment_methods:read`
22
- */
23
- list(query: PaymentTokenListParams, options?: RequestOptions): PagePromise<PaymentTokenListResponsesCursorPage, PaymentTokenListResponse>;
24
- }
25
- export type PaymentTokenListResponsesCursorPage = CursorPage<PaymentTokenListResponse>;
26
- /**
27
- * A payment token used to process payments.
28
- */
29
- export interface PaymentTokenRetrieveResponse {
30
- /**
31
- * The ID of the payment token
32
- */
33
- id: string;
34
- /**
35
- * The card data associated with the payment token, if its a debit or credit card
36
- * token.
37
- */
38
- card: PaymentTokenRetrieveResponse.Card | null;
39
- /**
40
- * The date and time the payment token was created
41
- */
42
- created_at: string;
43
- /**
44
- * The payment method type of the payment token
45
- */
46
- payment_method_type: PaymentsAPI.PaymentMethodTypes;
47
- }
48
- export declare namespace PaymentTokenRetrieveResponse {
49
- /**
50
- * The card data associated with the payment token, if its a debit or credit card
51
- * token.
52
- */
53
- interface Card {
54
- /**
55
- * Possible card brands that a payment token can have
56
- */
57
- brand: PaymentsAPI.CardBrands | null;
58
- /**
59
- * Card expiration month, like 03 for March.
60
- */
61
- exp_month: number | null;
62
- /**
63
- * Card expiration year, like 27 for 2027.
64
- */
65
- exp_year: number | null;
66
- /**
67
- * Last four digits of the card.
68
- */
69
- last4: string | null;
70
- }
71
- }
72
- /**
73
- * A payment token used to process payments.
74
- */
75
- export interface PaymentTokenListResponse {
76
- /**
77
- * The ID of the payment token
78
- */
79
- id: string;
80
- /**
81
- * The card data associated with the payment token, if its a debit or credit card
82
- * token.
83
- */
84
- card: PaymentTokenListResponse.Card | null;
85
- /**
86
- * The date and time the payment token was created
87
- */
88
- created_at: string;
89
- /**
90
- * The payment method type of the payment token
91
- */
92
- payment_method_type: PaymentsAPI.PaymentMethodTypes;
93
- }
94
- export declare namespace PaymentTokenListResponse {
95
- /**
96
- * The card data associated with the payment token, if its a debit or credit card
97
- * token.
98
- */
99
- interface Card {
100
- /**
101
- * Possible card brands that a payment token can have
102
- */
103
- brand: PaymentsAPI.CardBrands | null;
104
- /**
105
- * Card expiration month, like 03 for March.
106
- */
107
- exp_month: number | null;
108
- /**
109
- * Card expiration year, like 27 for 2027.
110
- */
111
- exp_year: number | null;
112
- /**
113
- * Last four digits of the card.
114
- */
115
- last4: string | null;
116
- }
117
- }
118
- export interface PaymentTokenRetrieveParams {
119
- /**
120
- * The ID of the Member associated with the PaymentToken
121
- */
122
- member_id: string;
123
- }
124
- export interface PaymentTokenListParams extends CursorPageParams {
125
- /**
126
- * The ID of the Member to list payment tokens for
127
- */
128
- member_id: string;
129
- /**
130
- * Returns the elements in the list that come before the specified cursor.
131
- */
132
- before?: string | null;
133
- /**
134
- * The minimum creation date to filter by
135
- */
136
- created_after?: string | null;
137
- /**
138
- * The maximum creation date to filter by
139
- */
140
- created_before?: string | null;
141
- /**
142
- * The direction of the sort.
143
- */
144
- direction?: Shared.Direction | null;
145
- /**
146
- * Returns the first _n_ elements from the list.
147
- */
148
- first?: number | null;
149
- /**
150
- * Returns the last _n_ elements from the list.
151
- */
152
- last?: number | null;
153
- }
154
- export declare namespace PaymentTokens {
155
- export { type PaymentTokenRetrieveResponse as PaymentTokenRetrieveResponse, type PaymentTokenListResponse as PaymentTokenListResponse, type PaymentTokenListResponsesCursorPage as PaymentTokenListResponsesCursorPage, type PaymentTokenRetrieveParams as PaymentTokenRetrieveParams, type PaymentTokenListParams as PaymentTokenListParams, };
156
- }
157
- //# sourceMappingURL=payment-tokens.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment-tokens.d.mts","sourceRoot":"","sources":["../src/resources/payment-tokens.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,aAAc,SAAQ,WAAW;IAC5C;;;;;;OAMG;IACH,QAAQ,CACN,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,0BAA0B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,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WAEG;QACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAExB;;WAEG;QACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB;CACF;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -1,157 +0,0 @@
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 PaymentTokens extends APIResource {
8
- /**
9
- * Retrieves a PaymentToken by ID
10
- *
11
- * Required permissions:
12
- *
13
- * - `member:payment_methods:read`
14
- */
15
- retrieve(id: string, query: PaymentTokenRetrieveParams, options?: RequestOptions): APIPromise<PaymentTokenRetrieveResponse>;
16
- /**
17
- * Lists PaymentTokens
18
- *
19
- * Required permissions:
20
- *
21
- * - `member:payment_methods:read`
22
- */
23
- list(query: PaymentTokenListParams, options?: RequestOptions): PagePromise<PaymentTokenListResponsesCursorPage, PaymentTokenListResponse>;
24
- }
25
- export type PaymentTokenListResponsesCursorPage = CursorPage<PaymentTokenListResponse>;
26
- /**
27
- * A payment token used to process payments.
28
- */
29
- export interface PaymentTokenRetrieveResponse {
30
- /**
31
- * The ID of the payment token
32
- */
33
- id: string;
34
- /**
35
- * The card data associated with the payment token, if its a debit or credit card
36
- * token.
37
- */
38
- card: PaymentTokenRetrieveResponse.Card | null;
39
- /**
40
- * The date and time the payment token was created
41
- */
42
- created_at: string;
43
- /**
44
- * The payment method type of the payment token
45
- */
46
- payment_method_type: PaymentsAPI.PaymentMethodTypes;
47
- }
48
- export declare namespace PaymentTokenRetrieveResponse {
49
- /**
50
- * The card data associated with the payment token, if its a debit or credit card
51
- * token.
52
- */
53
- interface Card {
54
- /**
55
- * Possible card brands that a payment token can have
56
- */
57
- brand: PaymentsAPI.CardBrands | null;
58
- /**
59
- * Card expiration month, like 03 for March.
60
- */
61
- exp_month: number | null;
62
- /**
63
- * Card expiration year, like 27 for 2027.
64
- */
65
- exp_year: number | null;
66
- /**
67
- * Last four digits of the card.
68
- */
69
- last4: string | null;
70
- }
71
- }
72
- /**
73
- * A payment token used to process payments.
74
- */
75
- export interface PaymentTokenListResponse {
76
- /**
77
- * The ID of the payment token
78
- */
79
- id: string;
80
- /**
81
- * The card data associated with the payment token, if its a debit or credit card
82
- * token.
83
- */
84
- card: PaymentTokenListResponse.Card | null;
85
- /**
86
- * The date and time the payment token was created
87
- */
88
- created_at: string;
89
- /**
90
- * The payment method type of the payment token
91
- */
92
- payment_method_type: PaymentsAPI.PaymentMethodTypes;
93
- }
94
- export declare namespace PaymentTokenListResponse {
95
- /**
96
- * The card data associated with the payment token, if its a debit or credit card
97
- * token.
98
- */
99
- interface Card {
100
- /**
101
- * Possible card brands that a payment token can have
102
- */
103
- brand: PaymentsAPI.CardBrands | null;
104
- /**
105
- * Card expiration month, like 03 for March.
106
- */
107
- exp_month: number | null;
108
- /**
109
- * Card expiration year, like 27 for 2027.
110
- */
111
- exp_year: number | null;
112
- /**
113
- * Last four digits of the card.
114
- */
115
- last4: string | null;
116
- }
117
- }
118
- export interface PaymentTokenRetrieveParams {
119
- /**
120
- * The ID of the Member associated with the PaymentToken
121
- */
122
- member_id: string;
123
- }
124
- export interface PaymentTokenListParams extends CursorPageParams {
125
- /**
126
- * The ID of the Member to list payment tokens for
127
- */
128
- member_id: string;
129
- /**
130
- * Returns the elements in the list that come before the specified cursor.
131
- */
132
- before?: string | null;
133
- /**
134
- * The minimum creation date to filter by
135
- */
136
- created_after?: string | null;
137
- /**
138
- * The maximum creation date to filter by
139
- */
140
- created_before?: string | null;
141
- /**
142
- * The direction of the sort.
143
- */
144
- direction?: Shared.Direction | null;
145
- /**
146
- * Returns the first _n_ elements from the list.
147
- */
148
- first?: number | null;
149
- /**
150
- * Returns the last _n_ elements from the list.
151
- */
152
- last?: number | null;
153
- }
154
- export declare namespace PaymentTokens {
155
- export { type PaymentTokenRetrieveResponse as PaymentTokenRetrieveResponse, type PaymentTokenListResponse as PaymentTokenListResponse, type PaymentTokenListResponsesCursorPage as PaymentTokenListResponsesCursorPage, type PaymentTokenRetrieveParams as PaymentTokenRetrieveParams, type PaymentTokenListParams as PaymentTokenListParams, };
156
- }
157
- //# sourceMappingURL=payment-tokens.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment-tokens.d.ts","sourceRoot":"","sources":["../src/resources/payment-tokens.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,cA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wB,CAAC;IACxC;;;OAGG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,KAAK,EAAE,WAAW,CAAC,UAAU,GAAG,IAAI,CAAC;QAErC;;WAEG;QACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAEzB;;WAEG;QACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAExB;;WAEG;QACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB;CACF;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -1,34 +0,0 @@
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.PaymentTokens = 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 PaymentTokens extends resource_1.APIResource {
9
- /**
10
- * Retrieves a PaymentToken by ID
11
- *
12
- * Required permissions:
13
- *
14
- * - `member:payment_methods:read`
15
- */
16
- retrieve(id, query, options) {
17
- return this._client.get((0, path_1.path) `/payment_tokens/${id}`, { query, ...options });
18
- }
19
- /**
20
- * Lists PaymentTokens
21
- *
22
- * Required permissions:
23
- *
24
- * - `member:payment_methods:read`
25
- */
26
- list(query, options) {
27
- return this._client.getAPIList('/payment_tokens', (pagination_1.CursorPage), {
28
- query,
29
- ...options,
30
- });
31
- }
32
- }
33
- exports.PaymentTokens = PaymentTokens;
34
- //# sourceMappingURL=payment-tokens.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment-tokens.js","sourceRoot":"","sources":["../src/resources/payment-tokens.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;;;OAMG;IACH,QAAQ,CACN,EAAU,EACV,KAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,mBAAmB,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,KAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAA,uBAAoC,CAAA,EAAE;YACtF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAhCD,sCAgCC"}
@@ -1,30 +0,0 @@
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 PaymentTokens extends APIResource {
6
- /**
7
- * Retrieves a PaymentToken by ID
8
- *
9
- * Required permissions:
10
- *
11
- * - `member:payment_methods:read`
12
- */
13
- retrieve(id, query, options) {
14
- return this._client.get(path `/payment_tokens/${id}`, { query, ...options });
15
- }
16
- /**
17
- * Lists PaymentTokens
18
- *
19
- * Required permissions:
20
- *
21
- * - `member:payment_methods:read`
22
- */
23
- list(query, options) {
24
- return this._client.getAPIList('/payment_tokens', (CursorPage), {
25
- query,
26
- ...options,
27
- });
28
- }
29
- }
30
- //# sourceMappingURL=payment-tokens.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment-tokens.mjs","sourceRoot":"","sources":["../src/resources/payment-tokens.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;OAMG;IACH,QAAQ,CACN,EAAU,EACV,KAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,mBAAmB,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,KAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAA,UAAoC,CAAA,EAAE;YACtF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}