palbase 0.65.0 → 0.68.0
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.
- package/README.md +3 -2
- package/dist/ai/index.js +2 -2
- package/dist/ai-sdk/index.js +4 -0
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +8 -8
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{YP3QTS4L.js → 22GRHCVI.js} +1 -1
- package/dist/chunks/{CZGZTOK7.js → 2ZHSNWVZ.js} +2 -2
- package/dist/chunks/3OP3YJ63.js +22 -0
- package/dist/chunks/{5HMDOBEH.js → 4YV35XDP.js} +2 -2
- package/dist/chunks/5ZXXBM6L.js +18 -0
- package/dist/chunks/{KZZ3Y3DC.js → 622BI7EV.js} +1 -1
- package/dist/chunks/65QZXK2S.js +2 -0
- package/dist/chunks/{ZF3WKPVM.js → 7SGTDHXJ.js} +2 -2
- package/dist/chunks/D6EUPFUR.js +2 -0
- package/dist/chunks/EGWQ3EJE.js +21 -0
- package/dist/chunks/{ARRJICH3.js → EJAGO6ZV.js} +2 -2
- package/dist/chunks/{6GRY63N6.js → F4B6ELAN.js} +2 -2
- package/dist/chunks/IZWB7FGX.js +6 -0
- package/dist/chunks/{G2JBUBZO.js → J7WJF7F4.js} +2 -2
- package/dist/chunks/{DFX37NU3.js → LUUXXMXH.js} +1 -1
- package/dist/chunks/MVY4K43S.js +13 -0
- package/dist/chunks/{JHM7GTPD.js → OWLXCD3D.js} +1 -1
- package/dist/chunks/PP7MW4OT.js +2 -0
- package/dist/chunks/{DLMWZYLL.js → QFZ4GCJH.js} +2 -2
- package/dist/chunks/QQUIM4VK.js +2 -0
- package/dist/chunks/UJLFALKX.js +2 -0
- package/dist/chunks/{TEF7WS37.js → XJLAH42O.js} +1 -1
- package/dist/chunks/{XSOQNHZ5.js → XU4G5W72.js} +1 -1
- package/dist/chunks/YCDAV3WO.js +2 -0
- package/dist/cli.js +351 -364
- package/dist/cloud/index.js +2 -2
- package/dist/refuse/ai-sdk.js +2 -0
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/cloud.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/message.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/payments-ui.js +264 -0
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +1 -1
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +4 -3
- package/package.json +19 -2
- package/types/ai/src/ai.d.ts +55 -29
- package/types/ai/src/chats.d.ts +163 -171
- package/types/ai/src/index.d.ts +5 -5
- package/types/ai/src/pools.d.ts +17 -7
- package/types/ai/src/tools.d.ts +6 -64
- package/types/ai-sdk/src/index.d.ts +166 -0
- package/types/backend/src/decorators.d.ts +3 -9
- package/types/backend/src/idempotency.d.ts +18 -0
- package/types/backend/src/index.d.ts +1 -1
- package/types/backend/src/services.d.ts +2 -2
- package/types/backend/src/stack.d.ts +2 -4
- package/types/backend/src/strings-files.d.ts +5 -6
- package/types/backend/src/upload.d.ts +2 -1
- package/types/cloud/src/generated/project.d.ts +3 -2
- package/types/cloud/src/generated/studio.d.ts +3 -3
- package/types/internal/src/chat.d.ts +56 -2
- package/types/internal/src/event.d.ts +1 -1
- package/types/internal/src/modules/ai.d.ts +939 -1133
- package/types/internal/src/modules/analytics.d.ts +1 -1
- package/types/internal/src/modules/events.d.ts +5 -4
- package/types/internal/src/modules/{purchases.d.ts → iap.d.ts} +2183 -2438
- package/types/internal/src/modules/index.d.ts +2 -1
- package/types/internal/src/modules/journeys.d.ts +1 -1
- package/types/internal/src/modules/notify.d.ts +3 -3
- package/types/internal/src/modules/payments.d.ts +3286 -0
- package/types/internal/src/modules/stores.d.ts +7 -7
- package/types/internal/src/modules/workspaces.d.ts +22 -0
- package/types/server/src/{purchases.d.ts → iap.d.ts} +7 -7
- package/types/server/src/index.d.ts +2 -1
- package/types/server/src/payments.d.ts +65 -0
- package/types/server/src/server.d.ts +4 -1
- package/types/web/src/chat.d.ts +30 -4
- package/types/web/src/client.d.ts +13 -10
- package/types/web/src/{purchases.d.ts → iap.d.ts} +46 -56
- package/types/web/src/inapp.d.ts +5 -5
- package/types/web/src/index.d.ts +4 -2
- package/types/web/src/messaging.d.ts +1 -0
- package/types/web/src/notify.d.ts +2 -2
- package/types/web/src/payments-ui/index.d.ts +7 -0
- package/types/web/src/payments-ui/payment-sheet.d.ts +13 -0
- package/types/web/src/payments-ui/qr.d.ts +9 -0
- package/types/web/src/payments-ui/saved-cards-view.d.ts +7 -0
- package/types/web/src/payments-ui/spend-qr-view.d.ts +8 -0
- package/types/web/src/payments-ui/theme.d.ts +16 -0
- package/types/web/src/payments-ui/types.d.ts +149 -0
- package/types/web/src/payments-ui/wallet-topup-sheet.d.ts +7 -0
- package/types/web/src/payments.d.ts +281 -0
- package/types/web/src/paywall/placement.d.ts +6 -8
- package/types/web/src/screen/assets.d.ts +1 -1
- package/types/web/src/screen/resolve.d.ts +3 -3
- package/types/web/src/vite.d.ts +8 -0
- package/dist/chunks/2HJQSGOO.js +0 -13
- package/dist/chunks/3TXOVBZP.js +0 -22
- package/dist/chunks/4NHRUBEF.js +0 -2
- package/dist/chunks/63TUW6P7.js +0 -18
- package/dist/chunks/BYXX373R.js +0 -21
- package/dist/chunks/CTWUVLVE.js +0 -2
- package/dist/chunks/GFG7WVN2.js +0 -2
- package/dist/chunks/KU6B2OXP.js +0 -2
- package/dist/chunks/X6JMSZBD.js +0 -6
- package/dist/chunks/ZZRRJOEP.js +0 -2
|
@@ -0,0 +1,3286 @@
|
|
|
1
|
+
import { type Reply, type Transport } from '../transport.js';
|
|
2
|
+
/**
|
|
3
|
+
* Initiate saving a new card or linking Masterpass.
|
|
4
|
+
*/
|
|
5
|
+
export type AddMethodRequest = {
|
|
6
|
+
/**
|
|
7
|
+
* Allowed cancel URL.
|
|
8
|
+
*/
|
|
9
|
+
cancel_url?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Optional channel override.
|
|
12
|
+
*/
|
|
13
|
+
channel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Phone number for Masterpass card lookup.
|
|
16
|
+
*/
|
|
17
|
+
phone?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Allowed return URL.
|
|
20
|
+
*/
|
|
21
|
+
return_url?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional vault override (masterpass).
|
|
24
|
+
*/
|
|
25
|
+
vault?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Billing or shipping postal address.
|
|
29
|
+
*/
|
|
30
|
+
export type Address = {
|
|
31
|
+
/**
|
|
32
|
+
* City.
|
|
33
|
+
*/
|
|
34
|
+
city?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Recipient contact name.
|
|
37
|
+
*/
|
|
38
|
+
contact_name?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Country name or code.
|
|
41
|
+
*/
|
|
42
|
+
country?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Street address line 1.
|
|
45
|
+
*/
|
|
46
|
+
line1?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Street address line 2.
|
|
49
|
+
*/
|
|
50
|
+
line2?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Postal or ZIP code.
|
|
53
|
+
*/
|
|
54
|
+
postal_code?: string;
|
|
55
|
+
/**
|
|
56
|
+
* State or province.
|
|
57
|
+
*/
|
|
58
|
+
state?: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* List of attempts for a PaymentIntent.
|
|
62
|
+
*/
|
|
63
|
+
export type AttemptListResponse = {
|
|
64
|
+
/**
|
|
65
|
+
* Payment attempts in chronological order.
|
|
66
|
+
*/
|
|
67
|
+
attempts: AttemptView[];
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* One payment attempt in the 1:N audit history of a PaymentIntent.
|
|
71
|
+
*/
|
|
72
|
+
export type AttemptView = {
|
|
73
|
+
/**
|
|
74
|
+
* Sequential 1-based attempt number.
|
|
75
|
+
*/
|
|
76
|
+
attempt_no: number;
|
|
77
|
+
/**
|
|
78
|
+
* Gross amount charged by provider in minor units.
|
|
79
|
+
*/
|
|
80
|
+
charged_amount: number;
|
|
81
|
+
/**
|
|
82
|
+
* Attempt creation timestamp.
|
|
83
|
+
*/
|
|
84
|
+
created_at: string;
|
|
85
|
+
/**
|
|
86
|
+
* Canonical decline code if declined.
|
|
87
|
+
*/
|
|
88
|
+
decline_code?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Provider fee in minor units.
|
|
91
|
+
*/
|
|
92
|
+
fee_amount: number;
|
|
93
|
+
/**
|
|
94
|
+
* Attempt UUID.
|
|
95
|
+
*/
|
|
96
|
+
id: string;
|
|
97
|
+
/**
|
|
98
|
+
* Installment count.
|
|
99
|
+
*/
|
|
100
|
+
installment_count: number;
|
|
101
|
+
/**
|
|
102
|
+
* Parent PaymentIntent UUID.
|
|
103
|
+
*/
|
|
104
|
+
intent_id: string;
|
|
105
|
+
/**
|
|
106
|
+
* Provider API round-trip latency in milliseconds.
|
|
107
|
+
*/
|
|
108
|
+
latency_ms: number;
|
|
109
|
+
/**
|
|
110
|
+
* NextAction type emitted.
|
|
111
|
+
*/
|
|
112
|
+
next_action_kind: string;
|
|
113
|
+
/**
|
|
114
|
+
* Provider used for this attempt.
|
|
115
|
+
*/
|
|
116
|
+
provider: string;
|
|
117
|
+
/**
|
|
118
|
+
* Raw provider error code.
|
|
119
|
+
*/
|
|
120
|
+
provider_code?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Provider diagnostic message.
|
|
123
|
+
*/
|
|
124
|
+
provider_message?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Provider payment/session identifier.
|
|
127
|
+
*/
|
|
128
|
+
provider_payment_id?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the attempt failure is retryable.
|
|
131
|
+
*/
|
|
132
|
+
retryable: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Attempt settlement timestamp.
|
|
135
|
+
*/
|
|
136
|
+
settled_at?: string | null;
|
|
137
|
+
/**
|
|
138
|
+
* Attempt status.
|
|
139
|
+
*/
|
|
140
|
+
status: string;
|
|
141
|
+
/**
|
|
142
|
+
* Tax amount in minor units.
|
|
143
|
+
*/
|
|
144
|
+
tax_amount: number;
|
|
145
|
+
/**
|
|
146
|
+
* Whether 3DS was enforced.
|
|
147
|
+
*/
|
|
148
|
+
three_ds: boolean;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Immutable double-entry ledger transaction with its balanced legs.
|
|
152
|
+
*/
|
|
153
|
+
export type AuditEntry = {
|
|
154
|
+
/**
|
|
155
|
+
* Transaction amount in minor units.
|
|
156
|
+
*/
|
|
157
|
+
amount: number;
|
|
158
|
+
/**
|
|
159
|
+
* Timestamp.
|
|
160
|
+
*/
|
|
161
|
+
created_at: string;
|
|
162
|
+
/**
|
|
163
|
+
* ISO 4217 currency code.
|
|
164
|
+
*/
|
|
165
|
+
currency: string;
|
|
166
|
+
/**
|
|
167
|
+
* Ledger transaction UUID.
|
|
168
|
+
*/
|
|
169
|
+
id: string;
|
|
170
|
+
/**
|
|
171
|
+
* Transaction kind.
|
|
172
|
+
*/
|
|
173
|
+
kind: string;
|
|
174
|
+
/**
|
|
175
|
+
* Balanced debit and credit legs.
|
|
176
|
+
*/
|
|
177
|
+
legs: AuditLeg[];
|
|
178
|
+
/**
|
|
179
|
+
* Reason.
|
|
180
|
+
*/
|
|
181
|
+
reason?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Merchant reference.
|
|
184
|
+
*/
|
|
185
|
+
reference?: string;
|
|
186
|
+
/**
|
|
187
|
+
* True when replayed by Idempotency-Key.
|
|
188
|
+
*/
|
|
189
|
+
replayed?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Monotonic sequence number.
|
|
192
|
+
*/
|
|
193
|
+
seq: number;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Paginated double-entry audit ledger export.
|
|
197
|
+
*/
|
|
198
|
+
export type AuditLedgerResponse = {
|
|
199
|
+
/**
|
|
200
|
+
* Immutable double-entry ledger transactions.
|
|
201
|
+
*/
|
|
202
|
+
entries: AuditEntry[];
|
|
203
|
+
/**
|
|
204
|
+
* Cursor (sequence number) for the next page.
|
|
205
|
+
*/
|
|
206
|
+
next_cursor?: string;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Single debit or credit leg of a double-entry ledger transaction.
|
|
210
|
+
*/
|
|
211
|
+
export type AuditLeg = {
|
|
212
|
+
/**
|
|
213
|
+
* Double-entry account identifier (@wallet:..., @held:..., @external:..., @merchant:...).
|
|
214
|
+
*/
|
|
215
|
+
account_id: string;
|
|
216
|
+
/**
|
|
217
|
+
* Leg amount in minor units.
|
|
218
|
+
*/
|
|
219
|
+
amount: number;
|
|
220
|
+
/**
|
|
221
|
+
* ISO 4217 currency code.
|
|
222
|
+
*/
|
|
223
|
+
currency: string;
|
|
224
|
+
/**
|
|
225
|
+
* debit or credit.
|
|
226
|
+
*/
|
|
227
|
+
direction: "debit" | "credit";
|
|
228
|
+
/**
|
|
229
|
+
* 1-based leg index inside the balanced transaction.
|
|
230
|
+
*/
|
|
231
|
+
leg_no: number;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Customer billing/shipping details sealed at rest.
|
|
235
|
+
*/
|
|
236
|
+
export type Buyer = {
|
|
237
|
+
billing_address?: Address;
|
|
238
|
+
/**
|
|
239
|
+
* Email address.
|
|
240
|
+
*/
|
|
241
|
+
email?: string;
|
|
242
|
+
/**
|
|
243
|
+
* Customer identifier.
|
|
244
|
+
*/
|
|
245
|
+
id?: string;
|
|
246
|
+
/**
|
|
247
|
+
* Buyer IP address.
|
|
248
|
+
*/
|
|
249
|
+
ip?: string;
|
|
250
|
+
/**
|
|
251
|
+
* Given name.
|
|
252
|
+
*/
|
|
253
|
+
name?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Normalized E.164 phone number.
|
|
256
|
+
*/
|
|
257
|
+
phone?: string;
|
|
258
|
+
shipping_address?: Address;
|
|
259
|
+
/**
|
|
260
|
+
* Family name.
|
|
261
|
+
*/
|
|
262
|
+
surname?: string;
|
|
263
|
+
/**
|
|
264
|
+
* National identity or tax ID number.
|
|
265
|
+
*/
|
|
266
|
+
tax_id?: string;
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Cancel an unsettled PaymentIntent and release any split wallet hold.
|
|
270
|
+
*/
|
|
271
|
+
export type CancelIntentRequest = {
|
|
272
|
+
/**
|
|
273
|
+
* Optional cancellation reason.
|
|
274
|
+
*/
|
|
275
|
+
reason?: string;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Cancel a subscription.
|
|
279
|
+
*/
|
|
280
|
+
export type CancelSubscriptionRequest = {
|
|
281
|
+
/**
|
|
282
|
+
* Cancel at the end of the current period (default true); false cancels immediately.
|
|
283
|
+
*/
|
|
284
|
+
at_period_end?: boolean;
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* Subscription cancellation result.
|
|
288
|
+
*/
|
|
289
|
+
export type CancelSubscriptionResponse = {
|
|
290
|
+
/**
|
|
291
|
+
* Whether cancellation is deferred to period end.
|
|
292
|
+
*/
|
|
293
|
+
cancel_at_period_end: boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Subscription UUID.
|
|
296
|
+
*/
|
|
297
|
+
id: string;
|
|
298
|
+
/**
|
|
299
|
+
* Updated subscription status.
|
|
300
|
+
*/
|
|
301
|
+
status: string;
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Feature matrix supported by a connected payment channel.
|
|
305
|
+
*/
|
|
306
|
+
export type Capabilities = {
|
|
307
|
+
/**
|
|
308
|
+
* Supported ISO 4217 currencies.
|
|
309
|
+
*/
|
|
310
|
+
currencies: string[];
|
|
311
|
+
/**
|
|
312
|
+
* Whether a self-service billing portal is supported.
|
|
313
|
+
*/
|
|
314
|
+
customer_portal: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Whether Turkish card installments are supported.
|
|
317
|
+
*/
|
|
318
|
+
installments: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Whether separate auth and capture is supported.
|
|
321
|
+
*/
|
|
322
|
+
manual_capture: boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Whether Masterpass vault checkout is enabled.
|
|
325
|
+
*/
|
|
326
|
+
masterpass: boolean;
|
|
327
|
+
/**
|
|
328
|
+
* Whether tokenized card storage is supported.
|
|
329
|
+
*/
|
|
330
|
+
saved_cards: boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Whether recurring billing is supported.
|
|
333
|
+
*/
|
|
334
|
+
subscriptions: boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Whether 3D Secure authentication is supported.
|
|
337
|
+
*/
|
|
338
|
+
three_ds: boolean;
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* Resolved payment capabilities and active wallets for checkout rendering.
|
|
342
|
+
*/
|
|
343
|
+
export type CapabilitiesResponse = {
|
|
344
|
+
/**
|
|
345
|
+
* True when an active payment channel can process payments for this currency.
|
|
346
|
+
*/
|
|
347
|
+
available: boolean;
|
|
348
|
+
capabilities: Capabilities;
|
|
349
|
+
/**
|
|
350
|
+
* Selected payment channel key.
|
|
351
|
+
*/
|
|
352
|
+
channel_key?: string;
|
|
353
|
+
/**
|
|
354
|
+
* Resolved ISO 4217 currency code.
|
|
355
|
+
*/
|
|
356
|
+
currency: string;
|
|
357
|
+
/**
|
|
358
|
+
* True when the resolved channel runs in live production mode.
|
|
359
|
+
*/
|
|
360
|
+
livemode?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Deterministic routing explanation (override, rule:<id>, default, single_active).
|
|
363
|
+
*/
|
|
364
|
+
routing_reason?: string;
|
|
365
|
+
/**
|
|
366
|
+
* Active wallet keys configured for the project.
|
|
367
|
+
*/
|
|
368
|
+
wallets?: string[];
|
|
369
|
+
};
|
|
370
|
+
/**
|
|
371
|
+
* Capture a previously authorized manual-capture PaymentIntent.
|
|
372
|
+
*/
|
|
373
|
+
export type CaptureIntentRequest = {
|
|
374
|
+
/**
|
|
375
|
+
* Amount to capture in minor units (0 = full authorized amount).
|
|
376
|
+
*/
|
|
377
|
+
amount?: number;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* Aggregated cash-flow summary for one currency.
|
|
381
|
+
*/
|
|
382
|
+
export type CashFlowBucket = {
|
|
383
|
+
/**
|
|
384
|
+
* Total chargeback debits.
|
|
385
|
+
*/
|
|
386
|
+
chargeback_debits: number;
|
|
387
|
+
/**
|
|
388
|
+
* ISO 4217 currency code.
|
|
389
|
+
*/
|
|
390
|
+
currency: string;
|
|
391
|
+
/**
|
|
392
|
+
* Total provider processing fees.
|
|
393
|
+
*/
|
|
394
|
+
payment_fees: number;
|
|
395
|
+
/**
|
|
396
|
+
* Total gross card/checkout payments captured.
|
|
397
|
+
*/
|
|
398
|
+
payment_gross: number;
|
|
399
|
+
/**
|
|
400
|
+
* Net settled payment inflow.
|
|
401
|
+
*/
|
|
402
|
+
payment_net: number;
|
|
403
|
+
/**
|
|
404
|
+
* Total refunded payment volume.
|
|
405
|
+
*/
|
|
406
|
+
payment_refunded: number;
|
|
407
|
+
/**
|
|
408
|
+
* Total tax collected.
|
|
409
|
+
*/
|
|
410
|
+
payment_tax: number;
|
|
411
|
+
/**
|
|
412
|
+
* Total instant refunds credited to wallets.
|
|
413
|
+
*/
|
|
414
|
+
refunds_to_wallet: number;
|
|
415
|
+
/**
|
|
416
|
+
* Total promotional/reward credits.
|
|
417
|
+
*/
|
|
418
|
+
rewards: number;
|
|
419
|
+
/**
|
|
420
|
+
* Total top-up credits in minor units.
|
|
421
|
+
*/
|
|
422
|
+
top_ups: number;
|
|
423
|
+
/**
|
|
424
|
+
* Total peer-to-peer transfer volume.
|
|
425
|
+
*/
|
|
426
|
+
transfers: number;
|
|
427
|
+
/**
|
|
428
|
+
* Total wallet spend charges in minor units.
|
|
429
|
+
*/
|
|
430
|
+
wallet_spends: number;
|
|
431
|
+
};
|
|
432
|
+
/**
|
|
433
|
+
* Cash-flow summary across currencies.
|
|
434
|
+
*/
|
|
435
|
+
export type CashFlowResponse = {
|
|
436
|
+
/**
|
|
437
|
+
* Cash-flow buckets grouped by currency.
|
|
438
|
+
*/
|
|
439
|
+
currencies: CashFlowBucket[];
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* Mint a short-lived one-time browser handoff grant for connecting provider credentials.
|
|
443
|
+
*/
|
|
444
|
+
export type ChannelGrantRequest = {
|
|
445
|
+
/**
|
|
446
|
+
* Target channel key.
|
|
447
|
+
*/
|
|
448
|
+
channel_key?: string;
|
|
449
|
+
/**
|
|
450
|
+
* Credential kind.
|
|
451
|
+
*/
|
|
452
|
+
kind: "stripe_key" | "iyzico_key" | "masterpass_key";
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* List of configured payment channels.
|
|
456
|
+
*/
|
|
457
|
+
export type ChannelListResponse = {
|
|
458
|
+
/**
|
|
459
|
+
* Configured payment channels.
|
|
460
|
+
*/
|
|
461
|
+
channels: ChannelView[];
|
|
462
|
+
};
|
|
463
|
+
/**
|
|
464
|
+
* Public/console representation of a connected payment channel (never contains secret credentials).
|
|
465
|
+
*/
|
|
466
|
+
export type ChannelView = {
|
|
467
|
+
/**
|
|
468
|
+
* Provider account identifier.
|
|
469
|
+
*/
|
|
470
|
+
account_id?: string;
|
|
471
|
+
capabilities: Capabilities;
|
|
472
|
+
/**
|
|
473
|
+
* Last provider health check timestamp.
|
|
474
|
+
*/
|
|
475
|
+
checked_at: string;
|
|
476
|
+
/**
|
|
477
|
+
* Timestamp when the channel was connected.
|
|
478
|
+
*/
|
|
479
|
+
connected_at: string;
|
|
480
|
+
/**
|
|
481
|
+
* Actor who connected the channel.
|
|
482
|
+
*/
|
|
483
|
+
connected_by: string;
|
|
484
|
+
/**
|
|
485
|
+
* True when Masterpass vault credentials are configured on this channel.
|
|
486
|
+
*/
|
|
487
|
+
has_masterpass: boolean;
|
|
488
|
+
/**
|
|
489
|
+
* Channel UUID.
|
|
490
|
+
*/
|
|
491
|
+
id: string;
|
|
492
|
+
/**
|
|
493
|
+
* True when this channel is the default fallback.
|
|
494
|
+
*/
|
|
495
|
+
is_default: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Channel key.
|
|
498
|
+
*/
|
|
499
|
+
key: string;
|
|
500
|
+
/**
|
|
501
|
+
* Redacted non-secret key prefix and last four characters.
|
|
502
|
+
*/
|
|
503
|
+
key_hint?: string;
|
|
504
|
+
/**
|
|
505
|
+
* True if connected to a live merchant account.
|
|
506
|
+
*/
|
|
507
|
+
livemode: boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Verified provider permissions.
|
|
510
|
+
*/
|
|
511
|
+
permissions: string[];
|
|
512
|
+
/**
|
|
513
|
+
* Provider name (stripe or iyzico).
|
|
514
|
+
*/
|
|
515
|
+
provider: string;
|
|
516
|
+
/**
|
|
517
|
+
* Channel health status (active, refused, disabled).
|
|
518
|
+
*/
|
|
519
|
+
status: string;
|
|
520
|
+
/**
|
|
521
|
+
* Connection method (key or app).
|
|
522
|
+
*/
|
|
523
|
+
via: string;
|
|
524
|
+
/**
|
|
525
|
+
* Webhook endpoint URL registered for this provider.
|
|
526
|
+
*/
|
|
527
|
+
webhook_url: string;
|
|
528
|
+
};
|
|
529
|
+
/**
|
|
530
|
+
* Immediately debit a customer wallet (by customer_id or single-use QR spend_token).
|
|
531
|
+
*/
|
|
532
|
+
export type ChargeWalletRequest = {
|
|
533
|
+
/**
|
|
534
|
+
* Amount to debit in minor units.
|
|
535
|
+
*/
|
|
536
|
+
amount: number;
|
|
537
|
+
/**
|
|
538
|
+
* Customer UID (required unless spend_token is supplied).
|
|
539
|
+
*/
|
|
540
|
+
customer_id?: string;
|
|
541
|
+
/**
|
|
542
|
+
* Arbitrary JSON metadata.
|
|
543
|
+
*/
|
|
544
|
+
metadata?: {
|
|
545
|
+
[key: string]: unknown;
|
|
546
|
+
};
|
|
547
|
+
/**
|
|
548
|
+
* Charge reason.
|
|
549
|
+
*/
|
|
550
|
+
reason?: string;
|
|
551
|
+
/**
|
|
552
|
+
* Merchant order reference.
|
|
553
|
+
*/
|
|
554
|
+
reference?: string;
|
|
555
|
+
/**
|
|
556
|
+
* Single-use QR spend token (`pst_...`).
|
|
557
|
+
*/
|
|
558
|
+
spend_token?: string;
|
|
559
|
+
/**
|
|
560
|
+
* Wallet key (optional when spend_token is supplied).
|
|
561
|
+
*/
|
|
562
|
+
wallet_key?: string;
|
|
563
|
+
};
|
|
564
|
+
/**
|
|
565
|
+
* Commit a wallet hold (full or partial).
|
|
566
|
+
*/
|
|
567
|
+
export type CommitHoldRequest = {
|
|
568
|
+
/**
|
|
569
|
+
* Final amount to commit in minor units (0 = full held amount; partial releases remainder).
|
|
570
|
+
*/
|
|
571
|
+
amount?: number;
|
|
572
|
+
};
|
|
573
|
+
/**
|
|
574
|
+
* Create a new PaymentAttempt for a PaymentIntent.
|
|
575
|
+
*/
|
|
576
|
+
export type ConfirmIntentRequest = {
|
|
577
|
+
buyer?: Buyer;
|
|
578
|
+
/**
|
|
579
|
+
* Intent client_secret (required for guest/publishable-key callers).
|
|
580
|
+
*/
|
|
581
|
+
client_secret?: string;
|
|
582
|
+
installments?: InstallmentConfig;
|
|
583
|
+
/**
|
|
584
|
+
* Saved payment method UUID for one-click payment.
|
|
585
|
+
*/
|
|
586
|
+
method_id?: string;
|
|
587
|
+
/**
|
|
588
|
+
* Phone number for Masterpass OTP lookup.
|
|
589
|
+
*/
|
|
590
|
+
phone?: string;
|
|
591
|
+
provider_options?: ProviderOptions;
|
|
592
|
+
/**
|
|
593
|
+
* Tokenize and save the card after payment succeeds.
|
|
594
|
+
*/
|
|
595
|
+
save_method?: boolean;
|
|
596
|
+
/**
|
|
597
|
+
* Start a Masterpass OTP payment attempt.
|
|
598
|
+
*/
|
|
599
|
+
use_masterpass?: boolean;
|
|
600
|
+
};
|
|
601
|
+
/**
|
|
602
|
+
* Connect or update a payment channel with provider credentials.
|
|
603
|
+
*/
|
|
604
|
+
export type ConnectChannelRequest = {
|
|
605
|
+
/**
|
|
606
|
+
* Stripe restricted key (rk_test_/rk_live_) or iyzico API key.
|
|
607
|
+
*/
|
|
608
|
+
api_key: string;
|
|
609
|
+
/**
|
|
610
|
+
* Stable lowercase channel key (e.g. stripe_global, iyzico_tr).
|
|
611
|
+
*/
|
|
612
|
+
key: string;
|
|
613
|
+
/**
|
|
614
|
+
* True for live production credentials; false for sandbox/test.
|
|
615
|
+
*/
|
|
616
|
+
livemode?: boolean;
|
|
617
|
+
masterpass?: MasterpassConfig;
|
|
618
|
+
/**
|
|
619
|
+
* Payment provider.
|
|
620
|
+
*/
|
|
621
|
+
provider: "stripe" | "iyzico";
|
|
622
|
+
/**
|
|
623
|
+
* iyzico secret key (required when provider is iyzico).
|
|
624
|
+
*/
|
|
625
|
+
secret_key?: string;
|
|
626
|
+
/**
|
|
627
|
+
* Make this channel the project default.
|
|
628
|
+
*/
|
|
629
|
+
set_default?: boolean;
|
|
630
|
+
};
|
|
631
|
+
/**
|
|
632
|
+
* Create a server-sealed PaymentIntent (supports card, split wallet+card, full wallet, and guest checkout).
|
|
633
|
+
*/
|
|
634
|
+
export type CreateIntentRequest = {
|
|
635
|
+
/**
|
|
636
|
+
* Total payment amount in minor units.
|
|
637
|
+
*/
|
|
638
|
+
amount: number;
|
|
639
|
+
buyer?: Buyer;
|
|
640
|
+
/**
|
|
641
|
+
* Allowed app cancel URL.
|
|
642
|
+
*/
|
|
643
|
+
cancel_url?: string;
|
|
644
|
+
/**
|
|
645
|
+
* automatic (default) or manual.
|
|
646
|
+
*/
|
|
647
|
+
capture_method?: "automatic" | "manual";
|
|
648
|
+
/**
|
|
649
|
+
* Optional explicit channel key override.
|
|
650
|
+
*/
|
|
651
|
+
channel?: string;
|
|
652
|
+
/**
|
|
653
|
+
* 3-letter ISO 4217 currency code.
|
|
654
|
+
*/
|
|
655
|
+
currency: string;
|
|
656
|
+
/**
|
|
657
|
+
* Customer UID (optional for guest checkout).
|
|
658
|
+
*/
|
|
659
|
+
customer_id?: string;
|
|
660
|
+
/**
|
|
661
|
+
* Human-readable payment description.
|
|
662
|
+
*/
|
|
663
|
+
description?: string;
|
|
664
|
+
installments?: InstallmentConfig;
|
|
665
|
+
/**
|
|
666
|
+
* Order line items.
|
|
667
|
+
*/
|
|
668
|
+
items?: LineItem[];
|
|
669
|
+
/**
|
|
670
|
+
* Arbitrary JSON metadata.
|
|
671
|
+
*/
|
|
672
|
+
metadata?: {
|
|
673
|
+
[key: string]: unknown;
|
|
674
|
+
};
|
|
675
|
+
provider_options?: ProviderOptions;
|
|
676
|
+
/**
|
|
677
|
+
* Merchant order or invoice reference.
|
|
678
|
+
*/
|
|
679
|
+
reference?: string;
|
|
680
|
+
/**
|
|
681
|
+
* Allowed app return URL after checkout or 3DS.
|
|
682
|
+
*/
|
|
683
|
+
return_url?: string;
|
|
684
|
+
/**
|
|
685
|
+
* Portion of amount paid from the customer's wallet in minor units.
|
|
686
|
+
*/
|
|
687
|
+
wallet_amount?: number;
|
|
688
|
+
/**
|
|
689
|
+
* Wallet key for split or full-wallet payment.
|
|
690
|
+
*/
|
|
691
|
+
wallet_key?: string;
|
|
692
|
+
};
|
|
693
|
+
/**
|
|
694
|
+
* Refund a succeeded payment to the original payment method or instantly to the customer's wallet.
|
|
695
|
+
*/
|
|
696
|
+
export type CreateRefundRequest = {
|
|
697
|
+
/**
|
|
698
|
+
* Refund amount in minor units (0 = full remaining refundable amount).
|
|
699
|
+
*/
|
|
700
|
+
amount?: number;
|
|
701
|
+
/**
|
|
702
|
+
* Refund destination: original card or instant wallet credit.
|
|
703
|
+
*/
|
|
704
|
+
destination?: "original" | "wallet";
|
|
705
|
+
/**
|
|
706
|
+
* Succeeded PaymentIntent UUID.
|
|
707
|
+
*/
|
|
708
|
+
intent_id: string;
|
|
709
|
+
/**
|
|
710
|
+
* Refund reason.
|
|
711
|
+
*/
|
|
712
|
+
reason?: string;
|
|
713
|
+
/**
|
|
714
|
+
* Target wallet key when destination is wallet.
|
|
715
|
+
*/
|
|
716
|
+
wallet_key?: string;
|
|
717
|
+
};
|
|
718
|
+
/**
|
|
719
|
+
* Mint a short-lived single-use QR/barcode spend token for POS or merchant checkout.
|
|
720
|
+
*/
|
|
721
|
+
export type CreateSpendTokenRequest = {
|
|
722
|
+
/**
|
|
723
|
+
* Optional maximum amount this single-use QR token may authorize.
|
|
724
|
+
*/
|
|
725
|
+
max_amount?: number | null;
|
|
726
|
+
/**
|
|
727
|
+
* Short token TTL in seconds (default 60, max 300).
|
|
728
|
+
*/
|
|
729
|
+
ttl_seconds?: number;
|
|
730
|
+
/**
|
|
731
|
+
* Wallet key to spend from.
|
|
732
|
+
*/
|
|
733
|
+
wallet_key: string;
|
|
734
|
+
};
|
|
735
|
+
/**
|
|
736
|
+
* Create a recurring payment subscription.
|
|
737
|
+
*/
|
|
738
|
+
export type CreateSubscriptionRequest = {
|
|
739
|
+
/**
|
|
740
|
+
* Recurring charge amount in minor units.
|
|
741
|
+
*/
|
|
742
|
+
amount: number;
|
|
743
|
+
/**
|
|
744
|
+
* Allowed cancel URL.
|
|
745
|
+
*/
|
|
746
|
+
cancel_url?: string;
|
|
747
|
+
/**
|
|
748
|
+
* Optional channel key override.
|
|
749
|
+
*/
|
|
750
|
+
channel?: string;
|
|
751
|
+
/**
|
|
752
|
+
* 3-letter ISO 4217 currency code.
|
|
753
|
+
*/
|
|
754
|
+
currency: string;
|
|
755
|
+
/**
|
|
756
|
+
* Customer UID.
|
|
757
|
+
*/
|
|
758
|
+
customer_id: string;
|
|
759
|
+
/**
|
|
760
|
+
* Subscription description.
|
|
761
|
+
*/
|
|
762
|
+
description?: string;
|
|
763
|
+
/**
|
|
764
|
+
* Billing interval.
|
|
765
|
+
*/
|
|
766
|
+
interval: "day" | "week" | "month" | "year";
|
|
767
|
+
/**
|
|
768
|
+
* Number of intervals per cycle (default 1).
|
|
769
|
+
*/
|
|
770
|
+
interval_count?: number;
|
|
771
|
+
/**
|
|
772
|
+
* Arbitrary JSON metadata.
|
|
773
|
+
*/
|
|
774
|
+
metadata?: {
|
|
775
|
+
[key: string]: unknown;
|
|
776
|
+
};
|
|
777
|
+
/**
|
|
778
|
+
* Subscription product name.
|
|
779
|
+
*/
|
|
780
|
+
product_name: string;
|
|
781
|
+
/**
|
|
782
|
+
* Allowed return URL.
|
|
783
|
+
*/
|
|
784
|
+
return_url: string;
|
|
785
|
+
/**
|
|
786
|
+
* Optional trial duration in days.
|
|
787
|
+
*/
|
|
788
|
+
trial_days?: number;
|
|
789
|
+
};
|
|
790
|
+
/**
|
|
791
|
+
* Grant promotional reward or administrative adjustment to a customer wallet.
|
|
792
|
+
*/
|
|
793
|
+
export type CreditWalletRequest = {
|
|
794
|
+
/**
|
|
795
|
+
* Credit amount in minor units.
|
|
796
|
+
*/
|
|
797
|
+
amount: number;
|
|
798
|
+
/**
|
|
799
|
+
* Customer UID.
|
|
800
|
+
*/
|
|
801
|
+
customer_id: string;
|
|
802
|
+
/**
|
|
803
|
+
* Optional lot expiration timestamp.
|
|
804
|
+
*/
|
|
805
|
+
expires_at?: string | null;
|
|
806
|
+
/**
|
|
807
|
+
* Credit kind (reward, adjustment, top_up).
|
|
808
|
+
*/
|
|
809
|
+
kind?: "reward" | "adjustment" | "top_up";
|
|
810
|
+
/**
|
|
811
|
+
* Arbitrary JSON metadata.
|
|
812
|
+
*/
|
|
813
|
+
metadata?: {
|
|
814
|
+
[key: string]: unknown;
|
|
815
|
+
};
|
|
816
|
+
/**
|
|
817
|
+
* Reason.
|
|
818
|
+
*/
|
|
819
|
+
reason?: string;
|
|
820
|
+
/**
|
|
821
|
+
* Reference.
|
|
822
|
+
*/
|
|
823
|
+
reference?: string;
|
|
824
|
+
/**
|
|
825
|
+
* Wallet key.
|
|
826
|
+
*/
|
|
827
|
+
wallet_key: string;
|
|
828
|
+
};
|
|
829
|
+
/**
|
|
830
|
+
* Emitted when a chargeback/dispute opens or closes (won or lost).
|
|
831
|
+
*/
|
|
832
|
+
export type DisputeEvent = {
|
|
833
|
+
/**
|
|
834
|
+
* Disputed amount in minor units.
|
|
835
|
+
*/
|
|
836
|
+
amount: number;
|
|
837
|
+
/**
|
|
838
|
+
* ISO 4217 currency code.
|
|
839
|
+
*/
|
|
840
|
+
currency: string;
|
|
841
|
+
/**
|
|
842
|
+
* Customer UID.
|
|
843
|
+
*/
|
|
844
|
+
customer_id?: string;
|
|
845
|
+
/**
|
|
846
|
+
* Dispute UUID.
|
|
847
|
+
*/
|
|
848
|
+
dispute_id: string;
|
|
849
|
+
/**
|
|
850
|
+
* Optional IAP metadata.
|
|
851
|
+
*/
|
|
852
|
+
iap_context?: {
|
|
853
|
+
[key: string]: unknown;
|
|
854
|
+
};
|
|
855
|
+
/**
|
|
856
|
+
* Disputed PaymentIntent UUID.
|
|
857
|
+
*/
|
|
858
|
+
intent_id: string;
|
|
859
|
+
/**
|
|
860
|
+
* Provider name.
|
|
861
|
+
*/
|
|
862
|
+
provider?: string;
|
|
863
|
+
/**
|
|
864
|
+
* Provider dispute ID.
|
|
865
|
+
*/
|
|
866
|
+
provider_dispute_id?: string;
|
|
867
|
+
/**
|
|
868
|
+
* Dispute reason.
|
|
869
|
+
*/
|
|
870
|
+
reason?: string;
|
|
871
|
+
/**
|
|
872
|
+
* Dispute status.
|
|
873
|
+
*/
|
|
874
|
+
status: string;
|
|
875
|
+
};
|
|
876
|
+
/**
|
|
877
|
+
* Paginated list of disputes.
|
|
878
|
+
*/
|
|
879
|
+
export type DisputeListResponse = {
|
|
880
|
+
/**
|
|
881
|
+
* Dispute records.
|
|
882
|
+
*/
|
|
883
|
+
disputes: DisputeView[];
|
|
884
|
+
/**
|
|
885
|
+
* Cursor for the next page.
|
|
886
|
+
*/
|
|
887
|
+
next_cursor?: string;
|
|
888
|
+
};
|
|
889
|
+
/**
|
|
890
|
+
* Payment dispute / chargeback record.
|
|
891
|
+
*/
|
|
892
|
+
export type DisputeView = {
|
|
893
|
+
/**
|
|
894
|
+
* Disputed amount in minor units.
|
|
895
|
+
*/
|
|
896
|
+
amount: number;
|
|
897
|
+
/**
|
|
898
|
+
* Dispute closed timestamp.
|
|
899
|
+
*/
|
|
900
|
+
closed_at?: string | null;
|
|
901
|
+
/**
|
|
902
|
+
* Dispute opened timestamp.
|
|
903
|
+
*/
|
|
904
|
+
created_at: string;
|
|
905
|
+
/**
|
|
906
|
+
* ISO 4217 currency code.
|
|
907
|
+
*/
|
|
908
|
+
currency: string;
|
|
909
|
+
/**
|
|
910
|
+
* Evidence submission deadline.
|
|
911
|
+
*/
|
|
912
|
+
evidence_due_at?: string | null;
|
|
913
|
+
/**
|
|
914
|
+
* Dispute UUID.
|
|
915
|
+
*/
|
|
916
|
+
id: string;
|
|
917
|
+
/**
|
|
918
|
+
* Disputed PaymentIntent UUID.
|
|
919
|
+
*/
|
|
920
|
+
intent_id: string;
|
|
921
|
+
/**
|
|
922
|
+
* Provider name.
|
|
923
|
+
*/
|
|
924
|
+
provider: string;
|
|
925
|
+
/**
|
|
926
|
+
* Provider dispute/chargeback ID.
|
|
927
|
+
*/
|
|
928
|
+
provider_dispute_id: string;
|
|
929
|
+
/**
|
|
930
|
+
* Dispute reason code.
|
|
931
|
+
*/
|
|
932
|
+
reason?: string;
|
|
933
|
+
/**
|
|
934
|
+
* Dispute status (needs_response, under_review, won, lost).
|
|
935
|
+
*/
|
|
936
|
+
status: string;
|
|
937
|
+
};
|
|
938
|
+
/**
|
|
939
|
+
* Zero-drift accounting integrity verification report.
|
|
940
|
+
*/
|
|
941
|
+
export type DriftReport = {
|
|
942
|
+
/**
|
|
943
|
+
* Total wallet accounts reconciled against lots, holds, and ledger entries.
|
|
944
|
+
*/
|
|
945
|
+
accounts_checked: number;
|
|
946
|
+
/**
|
|
947
|
+
* True when zero drift and zero unbalanced transactions exist.
|
|
948
|
+
*/
|
|
949
|
+
ok: boolean;
|
|
950
|
+
/**
|
|
951
|
+
* List of accounting discrepancies found (always empty when ok is true).
|
|
952
|
+
*/
|
|
953
|
+
problems: string[];
|
|
954
|
+
/**
|
|
955
|
+
* Total double-entry transactions verified.
|
|
956
|
+
*/
|
|
957
|
+
transactions_checked: number;
|
|
958
|
+
};
|
|
959
|
+
/**
|
|
960
|
+
* Standard Palbase API error envelope.
|
|
961
|
+
*/
|
|
962
|
+
export type ErrorResponse = {
|
|
963
|
+
/**
|
|
964
|
+
* Stable machine-readable error code.
|
|
965
|
+
*/
|
|
966
|
+
error: string;
|
|
967
|
+
/**
|
|
968
|
+
* Human-readable error explanation.
|
|
969
|
+
*/
|
|
970
|
+
error_description: string;
|
|
971
|
+
};
|
|
972
|
+
/**
|
|
973
|
+
* Extend a subscription's billing period or trial.
|
|
974
|
+
*/
|
|
975
|
+
export type ExtendSubscriptionRequest = {
|
|
976
|
+
/**
|
|
977
|
+
* Days to extend the subscription (1-90).
|
|
978
|
+
*/
|
|
979
|
+
days: number;
|
|
980
|
+
};
|
|
981
|
+
/**
|
|
982
|
+
* Subscription extension result.
|
|
983
|
+
*/
|
|
984
|
+
export type ExtendSubscriptionResponse = {
|
|
985
|
+
/**
|
|
986
|
+
* Extended period end.
|
|
987
|
+
*/
|
|
988
|
+
current_period_end?: string | null;
|
|
989
|
+
/**
|
|
990
|
+
* Subscription UUID.
|
|
991
|
+
*/
|
|
992
|
+
id: string;
|
|
993
|
+
/**
|
|
994
|
+
* Updated subscription status.
|
|
995
|
+
*/
|
|
996
|
+
status: string;
|
|
997
|
+
};
|
|
998
|
+
/**
|
|
999
|
+
* Freeze or unfreeze a customer wallet.
|
|
1000
|
+
*/
|
|
1001
|
+
export type FreezeWalletRequest = {
|
|
1002
|
+
/**
|
|
1003
|
+
* True to freeze spending on this wallet; false to unfreeze.
|
|
1004
|
+
*/
|
|
1005
|
+
frozen: boolean;
|
|
1006
|
+
};
|
|
1007
|
+
/**
|
|
1008
|
+
* One-time browser credential handoff grant.
|
|
1009
|
+
*/
|
|
1010
|
+
export type GrantResponse = {
|
|
1011
|
+
/**
|
|
1012
|
+
* Browser URL where a human enters credentials directly.
|
|
1013
|
+
*/
|
|
1014
|
+
connect_url: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* Grant expiration timestamp.
|
|
1017
|
+
*/
|
|
1018
|
+
expires_at: string;
|
|
1019
|
+
/**
|
|
1020
|
+
* One-time handoff grant token.
|
|
1021
|
+
*/
|
|
1022
|
+
grant: string;
|
|
1023
|
+
};
|
|
1024
|
+
/**
|
|
1025
|
+
* Reserve wallet balance in a two-phase hold (commit or release later).
|
|
1026
|
+
*/
|
|
1027
|
+
export type HoldWalletRequest = {
|
|
1028
|
+
/**
|
|
1029
|
+
* Amount to reserve in minor units.
|
|
1030
|
+
*/
|
|
1031
|
+
amount: number;
|
|
1032
|
+
/**
|
|
1033
|
+
* Customer UID (required unless spend_token is supplied).
|
|
1034
|
+
*/
|
|
1035
|
+
customer_id?: string;
|
|
1036
|
+
/**
|
|
1037
|
+
* Arbitrary JSON metadata.
|
|
1038
|
+
*/
|
|
1039
|
+
metadata?: {
|
|
1040
|
+
[key: string]: unknown;
|
|
1041
|
+
};
|
|
1042
|
+
/**
|
|
1043
|
+
* Merchant reference.
|
|
1044
|
+
*/
|
|
1045
|
+
reference?: string;
|
|
1046
|
+
/**
|
|
1047
|
+
* Single-use QR spend token (`pst_...`).
|
|
1048
|
+
*/
|
|
1049
|
+
spend_token?: string;
|
|
1050
|
+
/**
|
|
1051
|
+
* Hold expiration in seconds (default 900).
|
|
1052
|
+
*/
|
|
1053
|
+
ttl_seconds?: number;
|
|
1054
|
+
/**
|
|
1055
|
+
* Wallet key.
|
|
1056
|
+
*/
|
|
1057
|
+
wallet_key?: string;
|
|
1058
|
+
};
|
|
1059
|
+
/**
|
|
1060
|
+
* Installment configuration for an intent.
|
|
1061
|
+
*/
|
|
1062
|
+
export type InstallmentConfig = {
|
|
1063
|
+
/**
|
|
1064
|
+
* Explicit list of allowed installment counts.
|
|
1065
|
+
*/
|
|
1066
|
+
allowed?: number[];
|
|
1067
|
+
/**
|
|
1068
|
+
* Selected installment count (saved card).
|
|
1069
|
+
*/
|
|
1070
|
+
count?: number;
|
|
1071
|
+
/**
|
|
1072
|
+
* Allow installments on this payment.
|
|
1073
|
+
*/
|
|
1074
|
+
enabled?: boolean;
|
|
1075
|
+
/**
|
|
1076
|
+
* Maximum allowed installment count.
|
|
1077
|
+
*/
|
|
1078
|
+
max?: number;
|
|
1079
|
+
};
|
|
1080
|
+
/**
|
|
1081
|
+
* Query card BIN info and installment options.
|
|
1082
|
+
*/
|
|
1083
|
+
export type InstallmentLookupRequest = {
|
|
1084
|
+
/**
|
|
1085
|
+
* Payment amount in minor units.
|
|
1086
|
+
*/
|
|
1087
|
+
amount: number;
|
|
1088
|
+
/**
|
|
1089
|
+
* First 6-8 digits of the card (BIN).
|
|
1090
|
+
*/
|
|
1091
|
+
bin?: string;
|
|
1092
|
+
/**
|
|
1093
|
+
* Optional explicit channel override.
|
|
1094
|
+
*/
|
|
1095
|
+
channel?: string;
|
|
1096
|
+
/**
|
|
1097
|
+
* 3-letter ISO 4217 currency code.
|
|
1098
|
+
*/
|
|
1099
|
+
currency: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* Saved payment method UUID (alternative to bin).
|
|
1102
|
+
*/
|
|
1103
|
+
method_id?: string;
|
|
1104
|
+
};
|
|
1105
|
+
/**
|
|
1106
|
+
* Single installment tier.
|
|
1107
|
+
*/
|
|
1108
|
+
export type InstallmentOption = {
|
|
1109
|
+
/**
|
|
1110
|
+
* Number of installments.
|
|
1111
|
+
*/
|
|
1112
|
+
count: number;
|
|
1113
|
+
/**
|
|
1114
|
+
* Per-installment amount in minor units.
|
|
1115
|
+
*/
|
|
1116
|
+
installment_amount: number;
|
|
1117
|
+
/**
|
|
1118
|
+
* Total payable amount in minor units.
|
|
1119
|
+
*/
|
|
1120
|
+
total_amount: number;
|
|
1121
|
+
};
|
|
1122
|
+
/**
|
|
1123
|
+
* BIN metadata and installment plans returned by the provider.
|
|
1124
|
+
*/
|
|
1125
|
+
export type InstallmentTable = {
|
|
1126
|
+
/**
|
|
1127
|
+
* Issuing bank name.
|
|
1128
|
+
*/
|
|
1129
|
+
bank_name?: string;
|
|
1130
|
+
/**
|
|
1131
|
+
* Card BIN prefix.
|
|
1132
|
+
*/
|
|
1133
|
+
bin: string;
|
|
1134
|
+
/**
|
|
1135
|
+
* Card brand (visa, mastercard, troy, amex).
|
|
1136
|
+
*/
|
|
1137
|
+
brand?: string;
|
|
1138
|
+
/**
|
|
1139
|
+
* Card family program (Bonus, World, Axess, Maximum, etc.).
|
|
1140
|
+
*/
|
|
1141
|
+
card_family?: string;
|
|
1142
|
+
/**
|
|
1143
|
+
* credit, debit, or prepaid.
|
|
1144
|
+
*/
|
|
1145
|
+
card_type?: string;
|
|
1146
|
+
/**
|
|
1147
|
+
* True for commercial/corporate cards.
|
|
1148
|
+
*/
|
|
1149
|
+
commercial: boolean;
|
|
1150
|
+
/**
|
|
1151
|
+
* ISO 4217 currency code.
|
|
1152
|
+
*/
|
|
1153
|
+
currency: string;
|
|
1154
|
+
/**
|
|
1155
|
+
* True when 3DS is mandatory for this card.
|
|
1156
|
+
*/
|
|
1157
|
+
force_3ds: boolean;
|
|
1158
|
+
/**
|
|
1159
|
+
* Available installment plans.
|
|
1160
|
+
*/
|
|
1161
|
+
options: InstallmentOption[];
|
|
1162
|
+
};
|
|
1163
|
+
/**
|
|
1164
|
+
* Paginated list of PaymentIntents.
|
|
1165
|
+
*/
|
|
1166
|
+
export type IntentListResponse = {
|
|
1167
|
+
/**
|
|
1168
|
+
* PaymentIntent records.
|
|
1169
|
+
*/
|
|
1170
|
+
intents: IntentSummary[];
|
|
1171
|
+
/**
|
|
1172
|
+
* Cursor for the next page (absent on the last page).
|
|
1173
|
+
*/
|
|
1174
|
+
next_cursor?: string;
|
|
1175
|
+
};
|
|
1176
|
+
/**
|
|
1177
|
+
* PaymentIntent summary returned in paginated lists (never contains client_secret or next_action).
|
|
1178
|
+
*/
|
|
1179
|
+
export type IntentSummary = {
|
|
1180
|
+
/**
|
|
1181
|
+
* Total amount in minor units.
|
|
1182
|
+
*/
|
|
1183
|
+
amount: number;
|
|
1184
|
+
/**
|
|
1185
|
+
* True when created without a customer.
|
|
1186
|
+
*/
|
|
1187
|
+
anonymous: boolean;
|
|
1188
|
+
/**
|
|
1189
|
+
* automatic or manual.
|
|
1190
|
+
*/
|
|
1191
|
+
capture_method: string;
|
|
1192
|
+
/**
|
|
1193
|
+
* Captured amount in minor units.
|
|
1194
|
+
*/
|
|
1195
|
+
captured_amount: number;
|
|
1196
|
+
/**
|
|
1197
|
+
* Card portion in minor units.
|
|
1198
|
+
*/
|
|
1199
|
+
card_amount: number;
|
|
1200
|
+
/**
|
|
1201
|
+
* Channel key.
|
|
1202
|
+
*/
|
|
1203
|
+
channel_key?: string;
|
|
1204
|
+
/**
|
|
1205
|
+
* Creation timestamp.
|
|
1206
|
+
*/
|
|
1207
|
+
created_at: string;
|
|
1208
|
+
/**
|
|
1209
|
+
* 3-letter ISO 4217 currency code.
|
|
1210
|
+
*/
|
|
1211
|
+
currency: string;
|
|
1212
|
+
/**
|
|
1213
|
+
* Customer UID.
|
|
1214
|
+
*/
|
|
1215
|
+
customer_id?: string;
|
|
1216
|
+
/**
|
|
1217
|
+
* Description.
|
|
1218
|
+
*/
|
|
1219
|
+
description?: string;
|
|
1220
|
+
/**
|
|
1221
|
+
* Expiration timestamp.
|
|
1222
|
+
*/
|
|
1223
|
+
expires_at: string;
|
|
1224
|
+
/**
|
|
1225
|
+
* PaymentIntent UUID.
|
|
1226
|
+
*/
|
|
1227
|
+
id: string;
|
|
1228
|
+
/**
|
|
1229
|
+
* Intent kind.
|
|
1230
|
+
*/
|
|
1231
|
+
kind: string;
|
|
1232
|
+
/**
|
|
1233
|
+
* Provider name.
|
|
1234
|
+
*/
|
|
1235
|
+
provider?: string;
|
|
1236
|
+
/**
|
|
1237
|
+
* Merchant reference.
|
|
1238
|
+
*/
|
|
1239
|
+
reference?: string;
|
|
1240
|
+
/**
|
|
1241
|
+
* Refunded amount in minor units.
|
|
1242
|
+
*/
|
|
1243
|
+
refunded_amount: number;
|
|
1244
|
+
/**
|
|
1245
|
+
* Routing explanation.
|
|
1246
|
+
*/
|
|
1247
|
+
routing_reason?: string;
|
|
1248
|
+
/**
|
|
1249
|
+
* Canonical status.
|
|
1250
|
+
*/
|
|
1251
|
+
status: string;
|
|
1252
|
+
/**
|
|
1253
|
+
* Success timestamp.
|
|
1254
|
+
*/
|
|
1255
|
+
succeeded_at?: string | null;
|
|
1256
|
+
/**
|
|
1257
|
+
* Wallet portion in minor units.
|
|
1258
|
+
*/
|
|
1259
|
+
wallet_amount: number;
|
|
1260
|
+
/**
|
|
1261
|
+
* Wallet key if applicable.
|
|
1262
|
+
*/
|
|
1263
|
+
wallet_key?: string;
|
|
1264
|
+
};
|
|
1265
|
+
/**
|
|
1266
|
+
* Canonical PaymentIntent view with optional NextAction.
|
|
1267
|
+
*/
|
|
1268
|
+
export type IntentView = {
|
|
1269
|
+
/**
|
|
1270
|
+
* Total intent amount in minor units.
|
|
1271
|
+
*/
|
|
1272
|
+
amount: number;
|
|
1273
|
+
/**
|
|
1274
|
+
* True when this intent has no customer_id.
|
|
1275
|
+
*/
|
|
1276
|
+
anonymous: boolean;
|
|
1277
|
+
/**
|
|
1278
|
+
* automatic or manual.
|
|
1279
|
+
*/
|
|
1280
|
+
capture_method: string;
|
|
1281
|
+
/**
|
|
1282
|
+
* Total captured amount in minor units.
|
|
1283
|
+
*/
|
|
1284
|
+
captured_amount: number;
|
|
1285
|
+
/**
|
|
1286
|
+
* Amount paid via card provider in minor units.
|
|
1287
|
+
*/
|
|
1288
|
+
card_amount: number;
|
|
1289
|
+
/**
|
|
1290
|
+
* Selected payment channel key.
|
|
1291
|
+
*/
|
|
1292
|
+
channel_key?: string;
|
|
1293
|
+
/**
|
|
1294
|
+
* One-time scoped client secret returned only on intent creation.
|
|
1295
|
+
*/
|
|
1296
|
+
client_secret?: string;
|
|
1297
|
+
/**
|
|
1298
|
+
* Creation timestamp.
|
|
1299
|
+
*/
|
|
1300
|
+
created_at: string;
|
|
1301
|
+
/**
|
|
1302
|
+
* 3-letter ISO 4217 currency code.
|
|
1303
|
+
*/
|
|
1304
|
+
currency: string;
|
|
1305
|
+
/**
|
|
1306
|
+
* Customer UID (absent for guest checkout).
|
|
1307
|
+
*/
|
|
1308
|
+
customer_id?: string;
|
|
1309
|
+
/**
|
|
1310
|
+
* Canonical decline code when failed.
|
|
1311
|
+
*/
|
|
1312
|
+
decline_code?: string;
|
|
1313
|
+
/**
|
|
1314
|
+
* Payment description.
|
|
1315
|
+
*/
|
|
1316
|
+
description?: string;
|
|
1317
|
+
/**
|
|
1318
|
+
* Intent expiration timestamp.
|
|
1319
|
+
*/
|
|
1320
|
+
expires_at: string;
|
|
1321
|
+
/**
|
|
1322
|
+
* PaymentIntent UUID.
|
|
1323
|
+
*/
|
|
1324
|
+
id: string;
|
|
1325
|
+
/**
|
|
1326
|
+
* Intent kind (payment, top_up, subscription_initial, iap_checkout).
|
|
1327
|
+
*/
|
|
1328
|
+
kind: string;
|
|
1329
|
+
/**
|
|
1330
|
+
* Arbitrary JSON metadata.
|
|
1331
|
+
*/
|
|
1332
|
+
metadata?: {
|
|
1333
|
+
[key: string]: unknown;
|
|
1334
|
+
};
|
|
1335
|
+
next_action?: NextAction;
|
|
1336
|
+
/**
|
|
1337
|
+
* Resolved provider name (stripe, iyzico, wallet).
|
|
1338
|
+
*/
|
|
1339
|
+
provider?: string;
|
|
1340
|
+
/**
|
|
1341
|
+
* Merchant reference.
|
|
1342
|
+
*/
|
|
1343
|
+
reference?: string;
|
|
1344
|
+
/**
|
|
1345
|
+
* Total refunded amount in minor units.
|
|
1346
|
+
*/
|
|
1347
|
+
refunded_amount: number;
|
|
1348
|
+
/**
|
|
1349
|
+
* True when the customer may retry the payment.
|
|
1350
|
+
*/
|
|
1351
|
+
retryable?: boolean;
|
|
1352
|
+
/**
|
|
1353
|
+
* Why this channel was selected.
|
|
1354
|
+
*/
|
|
1355
|
+
routing_reason?: string;
|
|
1356
|
+
/**
|
|
1357
|
+
* Canonical PaymentIntent status.
|
|
1358
|
+
*/
|
|
1359
|
+
status: string;
|
|
1360
|
+
/**
|
|
1361
|
+
* Timestamp when payment succeeded.
|
|
1362
|
+
*/
|
|
1363
|
+
succeeded_at?: string | null;
|
|
1364
|
+
/**
|
|
1365
|
+
* Amount paid from wallet in minor units.
|
|
1366
|
+
*/
|
|
1367
|
+
wallet_amount: number;
|
|
1368
|
+
/**
|
|
1369
|
+
* Wallet key used for top-up or split payment.
|
|
1370
|
+
*/
|
|
1371
|
+
wallet_key?: string;
|
|
1372
|
+
};
|
|
1373
|
+
/**
|
|
1374
|
+
* Typed iyzico-specific escape-hatch options.
|
|
1375
|
+
*/
|
|
1376
|
+
export type IyzicoOptions = {
|
|
1377
|
+
/**
|
|
1378
|
+
* Override 3DS requirement for this payment.
|
|
1379
|
+
*/
|
|
1380
|
+
force_three_ds?: boolean;
|
|
1381
|
+
/**
|
|
1382
|
+
* iyzico locale (tr or en).
|
|
1383
|
+
*/
|
|
1384
|
+
locale?: string;
|
|
1385
|
+
/**
|
|
1386
|
+
* iyzico paymentGroup (PRODUCT, LISTING, SUBSCRIPTION).
|
|
1387
|
+
*/
|
|
1388
|
+
payment_group?: string;
|
|
1389
|
+
};
|
|
1390
|
+
/**
|
|
1391
|
+
* Result of an immutable double-entry ledger transaction.
|
|
1392
|
+
*/
|
|
1393
|
+
export type LedgerTxResult = {
|
|
1394
|
+
/**
|
|
1395
|
+
* Amount in minor units.
|
|
1396
|
+
*/
|
|
1397
|
+
amount: number;
|
|
1398
|
+
/**
|
|
1399
|
+
* Transaction timestamp.
|
|
1400
|
+
*/
|
|
1401
|
+
created_at: string;
|
|
1402
|
+
/**
|
|
1403
|
+
* ISO 4217 currency code.
|
|
1404
|
+
*/
|
|
1405
|
+
currency: string;
|
|
1406
|
+
/**
|
|
1407
|
+
* Immutable ledger transaction UUID.
|
|
1408
|
+
*/
|
|
1409
|
+
id: string;
|
|
1410
|
+
/**
|
|
1411
|
+
* Transaction kind (top_up, charge, hold_commit, transfer, reward, refund_to_wallet, chargeback_debit, etc.).
|
|
1412
|
+
*/
|
|
1413
|
+
kind: string;
|
|
1414
|
+
/**
|
|
1415
|
+
* Human-readable reason.
|
|
1416
|
+
*/
|
|
1417
|
+
reason?: string;
|
|
1418
|
+
/**
|
|
1419
|
+
* Merchant reference.
|
|
1420
|
+
*/
|
|
1421
|
+
reference?: string;
|
|
1422
|
+
/**
|
|
1423
|
+
* True when replayed from an earlier Idempotency-Key.
|
|
1424
|
+
*/
|
|
1425
|
+
replayed: boolean;
|
|
1426
|
+
/**
|
|
1427
|
+
* Monotonic ledger sequence number.
|
|
1428
|
+
*/
|
|
1429
|
+
seq: number;
|
|
1430
|
+
};
|
|
1431
|
+
/**
|
|
1432
|
+
* Order basket item.
|
|
1433
|
+
*/
|
|
1434
|
+
export type LineItem = {
|
|
1435
|
+
/**
|
|
1436
|
+
* Primary item category.
|
|
1437
|
+
*/
|
|
1438
|
+
category?: string;
|
|
1439
|
+
/**
|
|
1440
|
+
* Merchant line item identifier.
|
|
1441
|
+
*/
|
|
1442
|
+
id?: string;
|
|
1443
|
+
/**
|
|
1444
|
+
* physical or digital.
|
|
1445
|
+
*/
|
|
1446
|
+
kind?: "physical" | "digital";
|
|
1447
|
+
/**
|
|
1448
|
+
* Item display name.
|
|
1449
|
+
*/
|
|
1450
|
+
name: string;
|
|
1451
|
+
/**
|
|
1452
|
+
* Item quantity.
|
|
1453
|
+
*/
|
|
1454
|
+
quantity?: number;
|
|
1455
|
+
/**
|
|
1456
|
+
* Unit price in minor units.
|
|
1457
|
+
*/
|
|
1458
|
+
unit_amount: number;
|
|
1459
|
+
};
|
|
1460
|
+
/**
|
|
1461
|
+
* Masterpass client action metadata.
|
|
1462
|
+
*/
|
|
1463
|
+
export type MasterpassAction = {
|
|
1464
|
+
/**
|
|
1465
|
+
* Masterpass merchant client identifier.
|
|
1466
|
+
*/
|
|
1467
|
+
checkout_id?: string;
|
|
1468
|
+
/**
|
|
1469
|
+
* Masterpass flow mode (link, pay, register).
|
|
1470
|
+
*/
|
|
1471
|
+
mode: string;
|
|
1472
|
+
/**
|
|
1473
|
+
* Masked phone number for OTP.
|
|
1474
|
+
*/
|
|
1475
|
+
phone?: string;
|
|
1476
|
+
/**
|
|
1477
|
+
* Short-lived Masterpass session token.
|
|
1478
|
+
*/
|
|
1479
|
+
session_token?: string;
|
|
1480
|
+
};
|
|
1481
|
+
/**
|
|
1482
|
+
* Optional Masterpass card vault configuration attached to a channel.
|
|
1483
|
+
*/
|
|
1484
|
+
export type MasterpassConfig = {
|
|
1485
|
+
/**
|
|
1486
|
+
* Masterpass API base URL.
|
|
1487
|
+
*/
|
|
1488
|
+
base_url?: string;
|
|
1489
|
+
/**
|
|
1490
|
+
* Masterpass merchant client identifier.
|
|
1491
|
+
*/
|
|
1492
|
+
client_id: string;
|
|
1493
|
+
/**
|
|
1494
|
+
* True for live Masterpass vault credentials.
|
|
1495
|
+
*/
|
|
1496
|
+
livemode?: boolean;
|
|
1497
|
+
/**
|
|
1498
|
+
* Masterpass macro merchant identifier.
|
|
1499
|
+
*/
|
|
1500
|
+
macro_merchant_id?: string;
|
|
1501
|
+
/**
|
|
1502
|
+
* Masterpass signing secret.
|
|
1503
|
+
*/
|
|
1504
|
+
secret_key: string;
|
|
1505
|
+
};
|
|
1506
|
+
/**
|
|
1507
|
+
* Canonical next-action discriminated union executed by Palbase SDKs.
|
|
1508
|
+
*/
|
|
1509
|
+
export type NextAction = {
|
|
1510
|
+
/**
|
|
1511
|
+
* Central Palbase callback URL prefix for iframe/webview intercept.
|
|
1512
|
+
*/
|
|
1513
|
+
callback_prefix?: string;
|
|
1514
|
+
/**
|
|
1515
|
+
* OTP challenge identifier.
|
|
1516
|
+
*/
|
|
1517
|
+
challenge_id?: string;
|
|
1518
|
+
/**
|
|
1519
|
+
* Timestamp when this action expires.
|
|
1520
|
+
*/
|
|
1521
|
+
expires_at?: string | null;
|
|
1522
|
+
/**
|
|
1523
|
+
* Sanitized 3DS or provider embedded form HTML.
|
|
1524
|
+
*/
|
|
1525
|
+
html?: string;
|
|
1526
|
+
/**
|
|
1527
|
+
* Masked phone number where OTP was delivered.
|
|
1528
|
+
*/
|
|
1529
|
+
masked_phone?: string;
|
|
1530
|
+
masterpass?: MasterpassAction;
|
|
1531
|
+
/**
|
|
1532
|
+
* Final return URL after completion.
|
|
1533
|
+
*/
|
|
1534
|
+
return_url?: string;
|
|
1535
|
+
/**
|
|
1536
|
+
* Canonical next action required by the SDK.
|
|
1537
|
+
*/
|
|
1538
|
+
type: "none" | "redirect" | "embed" | "otp" | "masterpass";
|
|
1539
|
+
/**
|
|
1540
|
+
* Hosted checkout or 3DS redirect URL.
|
|
1541
|
+
*/
|
|
1542
|
+
url?: string;
|
|
1543
|
+
};
|
|
1544
|
+
/**
|
|
1545
|
+
* Response containing a canonical NextAction.
|
|
1546
|
+
*/
|
|
1547
|
+
export type NextActionResponse = {
|
|
1548
|
+
next_action: NextAction;
|
|
1549
|
+
};
|
|
1550
|
+
/**
|
|
1551
|
+
* Emitted when a PaymentIntent transitions to succeeded, requires_capture, failed, or canceled.
|
|
1552
|
+
*/
|
|
1553
|
+
export type PaymentLifecycleEvent = {
|
|
1554
|
+
/**
|
|
1555
|
+
* Total amount in minor units.
|
|
1556
|
+
*/
|
|
1557
|
+
amount?: number;
|
|
1558
|
+
/**
|
|
1559
|
+
* Winning or latest PaymentAttempt UUID.
|
|
1560
|
+
*/
|
|
1561
|
+
attempt_id?: string;
|
|
1562
|
+
/**
|
|
1563
|
+
* Captured amount in minor units.
|
|
1564
|
+
*/
|
|
1565
|
+
captured_amount?: number;
|
|
1566
|
+
/**
|
|
1567
|
+
* Channel key.
|
|
1568
|
+
*/
|
|
1569
|
+
channel_key?: string;
|
|
1570
|
+
/**
|
|
1571
|
+
* ISO 4217 currency code.
|
|
1572
|
+
*/
|
|
1573
|
+
currency?: string;
|
|
1574
|
+
/**
|
|
1575
|
+
* Customer UID.
|
|
1576
|
+
*/
|
|
1577
|
+
customer_id?: string;
|
|
1578
|
+
/**
|
|
1579
|
+
* Canonical decline code on failure.
|
|
1580
|
+
*/
|
|
1581
|
+
decline_code?: string;
|
|
1582
|
+
/**
|
|
1583
|
+
* Provider fee in minor units.
|
|
1584
|
+
*/
|
|
1585
|
+
fee_amount?: number;
|
|
1586
|
+
/**
|
|
1587
|
+
* Optional IAP metadata when initiated by the iap module.
|
|
1588
|
+
*/
|
|
1589
|
+
iap_context?: {
|
|
1590
|
+
[key: string]: unknown;
|
|
1591
|
+
};
|
|
1592
|
+
/**
|
|
1593
|
+
* PaymentIntent UUID.
|
|
1594
|
+
*/
|
|
1595
|
+
intent_id: string;
|
|
1596
|
+
/**
|
|
1597
|
+
* Intent kind.
|
|
1598
|
+
*/
|
|
1599
|
+
kind?: string;
|
|
1600
|
+
/**
|
|
1601
|
+
* Live mode flag.
|
|
1602
|
+
*/
|
|
1603
|
+
livemode?: boolean;
|
|
1604
|
+
/**
|
|
1605
|
+
* Provider name.
|
|
1606
|
+
*/
|
|
1607
|
+
provider?: string;
|
|
1608
|
+
/**
|
|
1609
|
+
* Provider payment identifier.
|
|
1610
|
+
*/
|
|
1611
|
+
provider_payment_id?: string;
|
|
1612
|
+
/**
|
|
1613
|
+
* Provider subscription identifier if applicable.
|
|
1614
|
+
*/
|
|
1615
|
+
provider_subscription_id?: string;
|
|
1616
|
+
/**
|
|
1617
|
+
* Cancellation reason when canceled.
|
|
1618
|
+
*/
|
|
1619
|
+
reason?: string;
|
|
1620
|
+
/**
|
|
1621
|
+
* Merchant reference.
|
|
1622
|
+
*/
|
|
1623
|
+
reference?: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* Tax amount in minor units.
|
|
1626
|
+
*/
|
|
1627
|
+
tax_amount?: number;
|
|
1628
|
+
};
|
|
1629
|
+
/**
|
|
1630
|
+
* Open a self-service billing portal session.
|
|
1631
|
+
*/
|
|
1632
|
+
export type PortalRequest = {
|
|
1633
|
+
/**
|
|
1634
|
+
* Optional channel key override.
|
|
1635
|
+
*/
|
|
1636
|
+
channel?: string;
|
|
1637
|
+
/**
|
|
1638
|
+
* Allowed return URL.
|
|
1639
|
+
*/
|
|
1640
|
+
return_url: string;
|
|
1641
|
+
};
|
|
1642
|
+
/**
|
|
1643
|
+
* Self-service billing portal session URL.
|
|
1644
|
+
*/
|
|
1645
|
+
export type PortalResponse = {
|
|
1646
|
+
/**
|
|
1647
|
+
* Provider billing portal URL.
|
|
1648
|
+
*/
|
|
1649
|
+
url: string;
|
|
1650
|
+
};
|
|
1651
|
+
/**
|
|
1652
|
+
* Optional typed provider-specific escape-hatch parameters.
|
|
1653
|
+
*/
|
|
1654
|
+
export type ProviderOptions = {
|
|
1655
|
+
iyzico?: IyzicoOptions;
|
|
1656
|
+
stripe?: StripeOptions;
|
|
1657
|
+
};
|
|
1658
|
+
/**
|
|
1659
|
+
* Paginated list of refunds.
|
|
1660
|
+
*/
|
|
1661
|
+
export type RefundListResponse = {
|
|
1662
|
+
/**
|
|
1663
|
+
* Cursor for the next page.
|
|
1664
|
+
*/
|
|
1665
|
+
next_cursor?: string;
|
|
1666
|
+
/**
|
|
1667
|
+
* Refund records.
|
|
1668
|
+
*/
|
|
1669
|
+
refunds: RefundView[];
|
|
1670
|
+
};
|
|
1671
|
+
/**
|
|
1672
|
+
* Emitted when a refund completes (original payment method or instant wallet credit).
|
|
1673
|
+
*/
|
|
1674
|
+
export type RefundSucceededEvent = {
|
|
1675
|
+
/**
|
|
1676
|
+
* Refund amount in minor units.
|
|
1677
|
+
*/
|
|
1678
|
+
amount: number;
|
|
1679
|
+
/**
|
|
1680
|
+
* ISO 4217 currency code.
|
|
1681
|
+
*/
|
|
1682
|
+
currency: string;
|
|
1683
|
+
/**
|
|
1684
|
+
* Customer UID.
|
|
1685
|
+
*/
|
|
1686
|
+
customer_id?: string;
|
|
1687
|
+
/**
|
|
1688
|
+
* original or wallet.
|
|
1689
|
+
*/
|
|
1690
|
+
destination: string;
|
|
1691
|
+
/**
|
|
1692
|
+
* Optional IAP metadata.
|
|
1693
|
+
*/
|
|
1694
|
+
iap_context?: {
|
|
1695
|
+
[key: string]: unknown;
|
|
1696
|
+
};
|
|
1697
|
+
/**
|
|
1698
|
+
* PaymentIntent UUID.
|
|
1699
|
+
*/
|
|
1700
|
+
intent_id: string;
|
|
1701
|
+
/**
|
|
1702
|
+
* Provider operation executed.
|
|
1703
|
+
*/
|
|
1704
|
+
provider_op?: string;
|
|
1705
|
+
/**
|
|
1706
|
+
* Provider refund ID.
|
|
1707
|
+
*/
|
|
1708
|
+
provider_refund_id?: string;
|
|
1709
|
+
/**
|
|
1710
|
+
* Refund UUID.
|
|
1711
|
+
*/
|
|
1712
|
+
refund_id: string;
|
|
1713
|
+
/**
|
|
1714
|
+
* Wallet key when refunded to wallet.
|
|
1715
|
+
*/
|
|
1716
|
+
wallet_key?: string;
|
|
1717
|
+
/**
|
|
1718
|
+
* Ledger transaction UUID when refunded to wallet.
|
|
1719
|
+
*/
|
|
1720
|
+
wallet_tx_id?: string;
|
|
1721
|
+
};
|
|
1722
|
+
/**
|
|
1723
|
+
* Refund record.
|
|
1724
|
+
*/
|
|
1725
|
+
export type RefundView = {
|
|
1726
|
+
/**
|
|
1727
|
+
* Actor who initiated the refund.
|
|
1728
|
+
*/
|
|
1729
|
+
actor: string;
|
|
1730
|
+
/**
|
|
1731
|
+
* Refunded amount in minor units.
|
|
1732
|
+
*/
|
|
1733
|
+
amount: number;
|
|
1734
|
+
/**
|
|
1735
|
+
* Creation timestamp.
|
|
1736
|
+
*/
|
|
1737
|
+
created_at: string;
|
|
1738
|
+
/**
|
|
1739
|
+
* ISO 4217 currency code.
|
|
1740
|
+
*/
|
|
1741
|
+
currency: string;
|
|
1742
|
+
/**
|
|
1743
|
+
* original or wallet.
|
|
1744
|
+
*/
|
|
1745
|
+
destination: string;
|
|
1746
|
+
/**
|
|
1747
|
+
* Refund UUID.
|
|
1748
|
+
*/
|
|
1749
|
+
id: string;
|
|
1750
|
+
/**
|
|
1751
|
+
* PaymentIntent UUID.
|
|
1752
|
+
*/
|
|
1753
|
+
intent_id: string;
|
|
1754
|
+
/**
|
|
1755
|
+
* Provider operation executed (cancel, refund, stripe_refund, wallet_credit).
|
|
1756
|
+
*/
|
|
1757
|
+
provider_op: string;
|
|
1758
|
+
/**
|
|
1759
|
+
* Provider refund identifier.
|
|
1760
|
+
*/
|
|
1761
|
+
provider_refund_id?: string;
|
|
1762
|
+
/**
|
|
1763
|
+
* Reason.
|
|
1764
|
+
*/
|
|
1765
|
+
reason?: string;
|
|
1766
|
+
/**
|
|
1767
|
+
* Settlement timestamp.
|
|
1768
|
+
*/
|
|
1769
|
+
settled_at?: string | null;
|
|
1770
|
+
/**
|
|
1771
|
+
* Refund status (pending, succeeded, failed).
|
|
1772
|
+
*/
|
|
1773
|
+
status: string;
|
|
1774
|
+
/**
|
|
1775
|
+
* Wallet key when destination is wallet.
|
|
1776
|
+
*/
|
|
1777
|
+
wallet_key?: string;
|
|
1778
|
+
/**
|
|
1779
|
+
* Ledger transaction UUID when destination is wallet.
|
|
1780
|
+
*/
|
|
1781
|
+
wallet_tx_id?: string;
|
|
1782
|
+
};
|
|
1783
|
+
/**
|
|
1784
|
+
* Deterministic routing rule mapping currency, country, or payment kind to a channel.
|
|
1785
|
+
*/
|
|
1786
|
+
export type RoutingRule = {
|
|
1787
|
+
/**
|
|
1788
|
+
* Target active channel key.
|
|
1789
|
+
*/
|
|
1790
|
+
channel_key: string;
|
|
1791
|
+
/**
|
|
1792
|
+
* Optional 2-letter ISO 3166 country match.
|
|
1793
|
+
*/
|
|
1794
|
+
country?: string | null;
|
|
1795
|
+
/**
|
|
1796
|
+
* Optional 3-letter ISO 4217 currency match.
|
|
1797
|
+
*/
|
|
1798
|
+
currency?: string | null;
|
|
1799
|
+
/**
|
|
1800
|
+
* Whether this rule is active.
|
|
1801
|
+
*/
|
|
1802
|
+
enabled: boolean;
|
|
1803
|
+
/**
|
|
1804
|
+
* Rule UUID.
|
|
1805
|
+
*/
|
|
1806
|
+
id?: string;
|
|
1807
|
+
/**
|
|
1808
|
+
* Optional payment kind match (payment, top_up, subscription_initial, iap_checkout).
|
|
1809
|
+
*/
|
|
1810
|
+
payment_kind?: string | null;
|
|
1811
|
+
/**
|
|
1812
|
+
* Evaluation priority (lower numbers evaluate first).
|
|
1813
|
+
*/
|
|
1814
|
+
priority: number;
|
|
1815
|
+
};
|
|
1816
|
+
/**
|
|
1817
|
+
* List of deterministic channel routing rules.
|
|
1818
|
+
*/
|
|
1819
|
+
export type RoutingRulesPayload = {
|
|
1820
|
+
/**
|
|
1821
|
+
* Ordered routing rules.
|
|
1822
|
+
*/
|
|
1823
|
+
rules: RoutingRule[];
|
|
1824
|
+
};
|
|
1825
|
+
/**
|
|
1826
|
+
* List of customer's saved payment methods.
|
|
1827
|
+
*/
|
|
1828
|
+
export type SavedMethodListResponse = {
|
|
1829
|
+
/**
|
|
1830
|
+
* Active saved payment methods.
|
|
1831
|
+
*/
|
|
1832
|
+
methods: SavedMethodView[];
|
|
1833
|
+
};
|
|
1834
|
+
/**
|
|
1835
|
+
* PCI-safe metadata of a tokenized saved card.
|
|
1836
|
+
*/
|
|
1837
|
+
export type SavedMethodView = {
|
|
1838
|
+
/**
|
|
1839
|
+
* Issuing bank name.
|
|
1840
|
+
*/
|
|
1841
|
+
bank_name?: string;
|
|
1842
|
+
/**
|
|
1843
|
+
* Card BIN (first 6-8 digits).
|
|
1844
|
+
*/
|
|
1845
|
+
bin?: string;
|
|
1846
|
+
/**
|
|
1847
|
+
* Card brand (visa, mastercard, troy, amex).
|
|
1848
|
+
*/
|
|
1849
|
+
brand?: string;
|
|
1850
|
+
/**
|
|
1851
|
+
* Turkish card family (Bonus, World, etc.).
|
|
1852
|
+
*/
|
|
1853
|
+
card_family?: string;
|
|
1854
|
+
/**
|
|
1855
|
+
* Channel key owning this token.
|
|
1856
|
+
*/
|
|
1857
|
+
channel_key: string;
|
|
1858
|
+
/**
|
|
1859
|
+
* Timestamp when saved.
|
|
1860
|
+
*/
|
|
1861
|
+
created_at: string;
|
|
1862
|
+
/**
|
|
1863
|
+
* Expiration month.
|
|
1864
|
+
*/
|
|
1865
|
+
exp_month?: number | null;
|
|
1866
|
+
/**
|
|
1867
|
+
* Expiration year.
|
|
1868
|
+
*/
|
|
1869
|
+
exp_year?: number | null;
|
|
1870
|
+
/**
|
|
1871
|
+
* Saved payment method UUID.
|
|
1872
|
+
*/
|
|
1873
|
+
id: string;
|
|
1874
|
+
/**
|
|
1875
|
+
* Method kind (card).
|
|
1876
|
+
*/
|
|
1877
|
+
kind: string;
|
|
1878
|
+
/**
|
|
1879
|
+
* Last 4 digits.
|
|
1880
|
+
*/
|
|
1881
|
+
last4?: string;
|
|
1882
|
+
/**
|
|
1883
|
+
* Card vault (stripe, iyzico, masterpass).
|
|
1884
|
+
*/
|
|
1885
|
+
vault: string;
|
|
1886
|
+
};
|
|
1887
|
+
/**
|
|
1888
|
+
* Project-wide payment limits, 3DS thresholds, velocity fraud rules, and defaults.
|
|
1889
|
+
*/
|
|
1890
|
+
export type Settings = {
|
|
1891
|
+
/**
|
|
1892
|
+
* When true, publishable-key clients may create intents directly (opt-in; false by default).
|
|
1893
|
+
*/
|
|
1894
|
+
allow_client_payments: boolean;
|
|
1895
|
+
/**
|
|
1896
|
+
* Cancel active subscriptions when an auth user is deleted.
|
|
1897
|
+
*/
|
|
1898
|
+
cancel_on_delete: boolean;
|
|
1899
|
+
/**
|
|
1900
|
+
* Fallback buyer address line.
|
|
1901
|
+
*/
|
|
1902
|
+
default_buyer_address?: string;
|
|
1903
|
+
/**
|
|
1904
|
+
* Fallback buyer city for provider risk checks.
|
|
1905
|
+
*/
|
|
1906
|
+
default_buyer_city?: string;
|
|
1907
|
+
/**
|
|
1908
|
+
* Fallback buyer country.
|
|
1909
|
+
*/
|
|
1910
|
+
default_buyer_country?: string;
|
|
1911
|
+
/**
|
|
1912
|
+
* Fallback buyer national/tax ID for Turkish providers when buyer omits it.
|
|
1913
|
+
*/
|
|
1914
|
+
default_buyer_tax_id?: string;
|
|
1915
|
+
/**
|
|
1916
|
+
* Default 3-letter ISO 4217 currency code (e.g. TRY, USD).
|
|
1917
|
+
*/
|
|
1918
|
+
default_currency: string;
|
|
1919
|
+
/**
|
|
1920
|
+
* Maximum single payment intent amount in minor units.
|
|
1921
|
+
*/
|
|
1922
|
+
max_payment_amount: number;
|
|
1923
|
+
/**
|
|
1924
|
+
* Amount threshold in minor units at or above which 3DS is enforced (0 = always).
|
|
1925
|
+
*/
|
|
1926
|
+
three_ds_threshold: number;
|
|
1927
|
+
/**
|
|
1928
|
+
* Project reporting IANA time zone.
|
|
1929
|
+
*/
|
|
1930
|
+
time_zone: string;
|
|
1931
|
+
/**
|
|
1932
|
+
* Maximum wallet top-up amount in minor units.
|
|
1933
|
+
*/
|
|
1934
|
+
topup_max: number;
|
|
1935
|
+
/**
|
|
1936
|
+
* Minimum wallet top-up amount in minor units.
|
|
1937
|
+
*/
|
|
1938
|
+
topup_min: number;
|
|
1939
|
+
/**
|
|
1940
|
+
* Maximum failed card attempts per IP/customer within the velocity window.
|
|
1941
|
+
*/
|
|
1942
|
+
velocity_max_failures: number;
|
|
1943
|
+
/**
|
|
1944
|
+
* Sliding velocity window duration in seconds.
|
|
1945
|
+
*/
|
|
1946
|
+
velocity_window_seconds: number;
|
|
1947
|
+
};
|
|
1948
|
+
/**
|
|
1949
|
+
* Single-use wallet spend token.
|
|
1950
|
+
*/
|
|
1951
|
+
export type SpendToken = {
|
|
1952
|
+
/**
|
|
1953
|
+
* Expiration timestamp.
|
|
1954
|
+
*/
|
|
1955
|
+
expires_at: string;
|
|
1956
|
+
/**
|
|
1957
|
+
* Spend token UUID.
|
|
1958
|
+
*/
|
|
1959
|
+
id: string;
|
|
1960
|
+
/**
|
|
1961
|
+
* Optional maximum spend cap in minor units.
|
|
1962
|
+
*/
|
|
1963
|
+
max_amount?: number | null;
|
|
1964
|
+
/**
|
|
1965
|
+
* Opaque single-use spend token (`pst_...`) to encode in a QR code.
|
|
1966
|
+
*/
|
|
1967
|
+
spend_token: string;
|
|
1968
|
+
/**
|
|
1969
|
+
* Wallet key.
|
|
1970
|
+
*/
|
|
1971
|
+
wallet_key: string;
|
|
1972
|
+
};
|
|
1973
|
+
/**
|
|
1974
|
+
* Mint a one-time grant to install the Palbase Stripe App.
|
|
1975
|
+
*/
|
|
1976
|
+
export type StripeAppGrantRequest = {
|
|
1977
|
+
/**
|
|
1978
|
+
* Target channel key (defaults to stripe).
|
|
1979
|
+
*/
|
|
1980
|
+
channel_key?: string;
|
|
1981
|
+
/**
|
|
1982
|
+
* True to open live Stripe App installation; false for test mode.
|
|
1983
|
+
*/
|
|
1984
|
+
livemode?: boolean;
|
|
1985
|
+
};
|
|
1986
|
+
/**
|
|
1987
|
+
* Typed Stripe-specific escape-hatch options.
|
|
1988
|
+
*/
|
|
1989
|
+
export type StripeOptions = {
|
|
1990
|
+
/**
|
|
1991
|
+
* Use Stripe Managed Payments where available.
|
|
1992
|
+
*/
|
|
1993
|
+
managed_payments?: boolean;
|
|
1994
|
+
/**
|
|
1995
|
+
* Optional Stripe tax code.
|
|
1996
|
+
*/
|
|
1997
|
+
tax_code?: string;
|
|
1998
|
+
};
|
|
1999
|
+
/**
|
|
2000
|
+
* Submit an OTP code to complete a Masterpass or bank verification step.
|
|
2001
|
+
*/
|
|
2002
|
+
export type SubmitOTPRequest = {
|
|
2003
|
+
/**
|
|
2004
|
+
* OTP challenge ID from NextAction.
|
|
2005
|
+
*/
|
|
2006
|
+
challenge_id: string;
|
|
2007
|
+
/**
|
|
2008
|
+
* Intent client_secret.
|
|
2009
|
+
*/
|
|
2010
|
+
client_secret?: string;
|
|
2011
|
+
/**
|
|
2012
|
+
* One-time passcode entered by the customer.
|
|
2013
|
+
*/
|
|
2014
|
+
otp: string;
|
|
2015
|
+
/**
|
|
2016
|
+
* Save the verified card for future one-click payments.
|
|
2017
|
+
*/
|
|
2018
|
+
save_method?: boolean;
|
|
2019
|
+
};
|
|
2020
|
+
/**
|
|
2021
|
+
* Emitted when a recurring subscription changes state or is canceled.
|
|
2022
|
+
*/
|
|
2023
|
+
export type SubscriptionEvent = {
|
|
2024
|
+
/**
|
|
2025
|
+
* True when scheduled to cancel at period end.
|
|
2026
|
+
*/
|
|
2027
|
+
cancel_at_period_end?: boolean;
|
|
2028
|
+
/**
|
|
2029
|
+
* Period end timestamp.
|
|
2030
|
+
*/
|
|
2031
|
+
current_period_end?: string | null;
|
|
2032
|
+
/**
|
|
2033
|
+
* Customer UID.
|
|
2034
|
+
*/
|
|
2035
|
+
customer_id?: string;
|
|
2036
|
+
/**
|
|
2037
|
+
* Optional IAP metadata.
|
|
2038
|
+
*/
|
|
2039
|
+
iap_context?: {
|
|
2040
|
+
[key: string]: unknown;
|
|
2041
|
+
};
|
|
2042
|
+
/**
|
|
2043
|
+
* Provider name.
|
|
2044
|
+
*/
|
|
2045
|
+
provider?: string;
|
|
2046
|
+
/**
|
|
2047
|
+
* Provider subscription ID.
|
|
2048
|
+
*/
|
|
2049
|
+
provider_sub_id?: string;
|
|
2050
|
+
/**
|
|
2051
|
+
* Subscription status.
|
|
2052
|
+
*/
|
|
2053
|
+
status: string;
|
|
2054
|
+
/**
|
|
2055
|
+
* Subscription UUID.
|
|
2056
|
+
*/
|
|
2057
|
+
subscription_id: string;
|
|
2058
|
+
};
|
|
2059
|
+
/**
|
|
2060
|
+
* Paginated list of subscriptions.
|
|
2061
|
+
*/
|
|
2062
|
+
export type SubscriptionListResponse = {
|
|
2063
|
+
/**
|
|
2064
|
+
* Cursor for the next page.
|
|
2065
|
+
*/
|
|
2066
|
+
next_cursor?: string;
|
|
2067
|
+
/**
|
|
2068
|
+
* Subscriptions.
|
|
2069
|
+
*/
|
|
2070
|
+
subscriptions: SubscriptionSummary[];
|
|
2071
|
+
};
|
|
2072
|
+
/**
|
|
2073
|
+
* Recurring subscription list item.
|
|
2074
|
+
*/
|
|
2075
|
+
export type SubscriptionSummary = {
|
|
2076
|
+
/**
|
|
2077
|
+
* Recurring amount in minor units.
|
|
2078
|
+
*/
|
|
2079
|
+
amount: number;
|
|
2080
|
+
/**
|
|
2081
|
+
* True when scheduled to cancel at period end.
|
|
2082
|
+
*/
|
|
2083
|
+
cancel_at_period_end: boolean;
|
|
2084
|
+
/**
|
|
2085
|
+
* Channel key.
|
|
2086
|
+
*/
|
|
2087
|
+
channel_key: string;
|
|
2088
|
+
/**
|
|
2089
|
+
* Creation timestamp.
|
|
2090
|
+
*/
|
|
2091
|
+
created_at: string;
|
|
2092
|
+
/**
|
|
2093
|
+
* ISO 4217 currency code.
|
|
2094
|
+
*/
|
|
2095
|
+
currency: string;
|
|
2096
|
+
/**
|
|
2097
|
+
* Current period end.
|
|
2098
|
+
*/
|
|
2099
|
+
current_period_end?: string | null;
|
|
2100
|
+
/**
|
|
2101
|
+
* Current period start.
|
|
2102
|
+
*/
|
|
2103
|
+
current_period_start?: string | null;
|
|
2104
|
+
/**
|
|
2105
|
+
* Customer UID.
|
|
2106
|
+
*/
|
|
2107
|
+
customer_id: string;
|
|
2108
|
+
/**
|
|
2109
|
+
* Subscription UUID.
|
|
2110
|
+
*/
|
|
2111
|
+
id: string;
|
|
2112
|
+
/**
|
|
2113
|
+
* Billing interval.
|
|
2114
|
+
*/
|
|
2115
|
+
interval: string;
|
|
2116
|
+
/**
|
|
2117
|
+
* Intervals per cycle.
|
|
2118
|
+
*/
|
|
2119
|
+
interval_count: number;
|
|
2120
|
+
/**
|
|
2121
|
+
* Arbitrary JSON metadata.
|
|
2122
|
+
*/
|
|
2123
|
+
metadata?: {
|
|
2124
|
+
[key: string]: unknown;
|
|
2125
|
+
};
|
|
2126
|
+
/**
|
|
2127
|
+
* Provider name.
|
|
2128
|
+
*/
|
|
2129
|
+
provider: string;
|
|
2130
|
+
/**
|
|
2131
|
+
* Provider subscription identifier.
|
|
2132
|
+
*/
|
|
2133
|
+
provider_sub_id?: string;
|
|
2134
|
+
/**
|
|
2135
|
+
* Subscription status.
|
|
2136
|
+
*/
|
|
2137
|
+
status: string;
|
|
2138
|
+
/**
|
|
2139
|
+
* Trial end timestamp.
|
|
2140
|
+
*/
|
|
2141
|
+
trial_end?: string | null;
|
|
2142
|
+
};
|
|
2143
|
+
/**
|
|
2144
|
+
* Recurring subscription representation.
|
|
2145
|
+
*/
|
|
2146
|
+
export type SubscriptionView = {
|
|
2147
|
+
/**
|
|
2148
|
+
* Recurring amount in minor units.
|
|
2149
|
+
*/
|
|
2150
|
+
amount: number;
|
|
2151
|
+
/**
|
|
2152
|
+
* True when scheduled to cancel at period end.
|
|
2153
|
+
*/
|
|
2154
|
+
cancel_at_period_end: boolean;
|
|
2155
|
+
/**
|
|
2156
|
+
* Channel key.
|
|
2157
|
+
*/
|
|
2158
|
+
channel_key: string;
|
|
2159
|
+
/**
|
|
2160
|
+
* Creation timestamp.
|
|
2161
|
+
*/
|
|
2162
|
+
created_at: string;
|
|
2163
|
+
/**
|
|
2164
|
+
* ISO 4217 currency code.
|
|
2165
|
+
*/
|
|
2166
|
+
currency: string;
|
|
2167
|
+
/**
|
|
2168
|
+
* Current period end.
|
|
2169
|
+
*/
|
|
2170
|
+
current_period_end?: string | null;
|
|
2171
|
+
/**
|
|
2172
|
+
* Current period start.
|
|
2173
|
+
*/
|
|
2174
|
+
current_period_start?: string | null;
|
|
2175
|
+
/**
|
|
2176
|
+
* Customer UID.
|
|
2177
|
+
*/
|
|
2178
|
+
customer_id: string;
|
|
2179
|
+
/**
|
|
2180
|
+
* Subscription UUID.
|
|
2181
|
+
*/
|
|
2182
|
+
id: string;
|
|
2183
|
+
/**
|
|
2184
|
+
* Billing interval.
|
|
2185
|
+
*/
|
|
2186
|
+
interval: string;
|
|
2187
|
+
/**
|
|
2188
|
+
* Intervals per cycle.
|
|
2189
|
+
*/
|
|
2190
|
+
interval_count: number;
|
|
2191
|
+
/**
|
|
2192
|
+
* Arbitrary JSON metadata.
|
|
2193
|
+
*/
|
|
2194
|
+
metadata?: {
|
|
2195
|
+
[key: string]: unknown;
|
|
2196
|
+
};
|
|
2197
|
+
next_action?: NextAction;
|
|
2198
|
+
/**
|
|
2199
|
+
* Provider name.
|
|
2200
|
+
*/
|
|
2201
|
+
provider: string;
|
|
2202
|
+
/**
|
|
2203
|
+
* Provider subscription identifier.
|
|
2204
|
+
*/
|
|
2205
|
+
provider_sub_id?: string;
|
|
2206
|
+
/**
|
|
2207
|
+
* Subscription status (pending, trialing, active, past_due, canceled, expired).
|
|
2208
|
+
*/
|
|
2209
|
+
status: string;
|
|
2210
|
+
/**
|
|
2211
|
+
* Trial end timestamp.
|
|
2212
|
+
*/
|
|
2213
|
+
trial_end?: string | null;
|
|
2214
|
+
};
|
|
2215
|
+
/**
|
|
2216
|
+
* Initiate a real-money wallet top-up.
|
|
2217
|
+
*/
|
|
2218
|
+
export type TopUpWalletRequest = {
|
|
2219
|
+
/**
|
|
2220
|
+
* Top-up amount in minor units.
|
|
2221
|
+
*/
|
|
2222
|
+
amount: number;
|
|
2223
|
+
/**
|
|
2224
|
+
* Allowed cancel URL.
|
|
2225
|
+
*/
|
|
2226
|
+
cancel_url?: string;
|
|
2227
|
+
/**
|
|
2228
|
+
* Optional channel override.
|
|
2229
|
+
*/
|
|
2230
|
+
channel?: string;
|
|
2231
|
+
/**
|
|
2232
|
+
* Optional saved payment method UUID.
|
|
2233
|
+
*/
|
|
2234
|
+
method_id?: string;
|
|
2235
|
+
/**
|
|
2236
|
+
* Phone number for Masterpass.
|
|
2237
|
+
*/
|
|
2238
|
+
phone?: string;
|
|
2239
|
+
/**
|
|
2240
|
+
* Allowed return URL.
|
|
2241
|
+
*/
|
|
2242
|
+
return_url?: string;
|
|
2243
|
+
/**
|
|
2244
|
+
* Save card after top-up succeeds.
|
|
2245
|
+
*/
|
|
2246
|
+
save_method?: boolean;
|
|
2247
|
+
/**
|
|
2248
|
+
* Pay via Masterpass OTP.
|
|
2249
|
+
*/
|
|
2250
|
+
use_masterpass?: boolean;
|
|
2251
|
+
/**
|
|
2252
|
+
* Target wallet key.
|
|
2253
|
+
*/
|
|
2254
|
+
wallet_key: string;
|
|
2255
|
+
};
|
|
2256
|
+
/**
|
|
2257
|
+
* Atomically transfer closed-loop wallet balance between two customers (backend-only).
|
|
2258
|
+
*/
|
|
2259
|
+
export type TransferWalletRequest = {
|
|
2260
|
+
/**
|
|
2261
|
+
* Transfer amount in minor units.
|
|
2262
|
+
*/
|
|
2263
|
+
amount: number;
|
|
2264
|
+
/**
|
|
2265
|
+
* Sender customer UID.
|
|
2266
|
+
*/
|
|
2267
|
+
from_customer_id: string;
|
|
2268
|
+
/**
|
|
2269
|
+
* Arbitrary JSON metadata.
|
|
2270
|
+
*/
|
|
2271
|
+
metadata?: {
|
|
2272
|
+
[key: string]: unknown;
|
|
2273
|
+
};
|
|
2274
|
+
/**
|
|
2275
|
+
* Transfer reason.
|
|
2276
|
+
*/
|
|
2277
|
+
reason?: string;
|
|
2278
|
+
/**
|
|
2279
|
+
* Transfer reference.
|
|
2280
|
+
*/
|
|
2281
|
+
reference?: string;
|
|
2282
|
+
/**
|
|
2283
|
+
* Recipient customer UID.
|
|
2284
|
+
*/
|
|
2285
|
+
to_customer_id: string;
|
|
2286
|
+
/**
|
|
2287
|
+
* Wallet key.
|
|
2288
|
+
*/
|
|
2289
|
+
wallet_key: string;
|
|
2290
|
+
};
|
|
2291
|
+
/**
|
|
2292
|
+
* Atomic wallet transfer result with both updated balances.
|
|
2293
|
+
*/
|
|
2294
|
+
export type TransferWalletResponse = {
|
|
2295
|
+
from_balance: WalletBalance;
|
|
2296
|
+
to_balance: WalletBalance;
|
|
2297
|
+
transaction: LedgerTxResult;
|
|
2298
|
+
};
|
|
2299
|
+
/**
|
|
2300
|
+
* Customer's live balance in a closed-loop wallet.
|
|
2301
|
+
*/
|
|
2302
|
+
export type WalletBalance = {
|
|
2303
|
+
/**
|
|
2304
|
+
* Spendable balance in minor units.
|
|
2305
|
+
*/
|
|
2306
|
+
available: number;
|
|
2307
|
+
/**
|
|
2308
|
+
* ISO 4217 currency code.
|
|
2309
|
+
*/
|
|
2310
|
+
currency: string;
|
|
2311
|
+
/**
|
|
2312
|
+
* Outstanding chargeback debt in minor units.
|
|
2313
|
+
*/
|
|
2314
|
+
debt: number;
|
|
2315
|
+
/**
|
|
2316
|
+
* True when spending is frozen (e.g. open chargeback debt).
|
|
2317
|
+
*/
|
|
2318
|
+
frozen: boolean;
|
|
2319
|
+
/**
|
|
2320
|
+
* Balance reserved by active two-phase holds in minor units.
|
|
2321
|
+
*/
|
|
2322
|
+
held: number;
|
|
2323
|
+
/**
|
|
2324
|
+
* Wallet kind (fiat or points).
|
|
2325
|
+
*/
|
|
2326
|
+
kind: string;
|
|
2327
|
+
/**
|
|
2328
|
+
* Earliest expiring lot timestamp.
|
|
2329
|
+
*/
|
|
2330
|
+
next_expiry?: string | null;
|
|
2331
|
+
/**
|
|
2332
|
+
* Total posted balance in minor units (available + held - debt).
|
|
2333
|
+
*/
|
|
2334
|
+
posted: number;
|
|
2335
|
+
/**
|
|
2336
|
+
* Monotonic balance version.
|
|
2337
|
+
*/
|
|
2338
|
+
version: number;
|
|
2339
|
+
/**
|
|
2340
|
+
* Wallet key.
|
|
2341
|
+
*/
|
|
2342
|
+
wallet_key: string;
|
|
2343
|
+
};
|
|
2344
|
+
/**
|
|
2345
|
+
* Emitted whenever a customer's wallet balance, hold, or freeze status changes.
|
|
2346
|
+
*/
|
|
2347
|
+
export type WalletBalanceEvent = {
|
|
2348
|
+
/**
|
|
2349
|
+
* Delta amount in minor units.
|
|
2350
|
+
*/
|
|
2351
|
+
amount?: number;
|
|
2352
|
+
/**
|
|
2353
|
+
* Updated available balance.
|
|
2354
|
+
*/
|
|
2355
|
+
available: number;
|
|
2356
|
+
/**
|
|
2357
|
+
* ISO 4217 currency code.
|
|
2358
|
+
*/
|
|
2359
|
+
currency: string;
|
|
2360
|
+
/**
|
|
2361
|
+
* Customer UID.
|
|
2362
|
+
*/
|
|
2363
|
+
customer_id: string;
|
|
2364
|
+
/**
|
|
2365
|
+
* True if wallet is frozen.
|
|
2366
|
+
*/
|
|
2367
|
+
frozen?: boolean;
|
|
2368
|
+
/**
|
|
2369
|
+
* Updated held balance.
|
|
2370
|
+
*/
|
|
2371
|
+
held: number;
|
|
2372
|
+
/**
|
|
2373
|
+
* Ledger transaction kind.
|
|
2374
|
+
*/
|
|
2375
|
+
kind?: string;
|
|
2376
|
+
/**
|
|
2377
|
+
* Ledger transaction UUID.
|
|
2378
|
+
*/
|
|
2379
|
+
tx_id?: string;
|
|
2380
|
+
/**
|
|
2381
|
+
* Monotonic wallet balance version.
|
|
2382
|
+
*/
|
|
2383
|
+
version: number;
|
|
2384
|
+
/**
|
|
2385
|
+
* Wallet key.
|
|
2386
|
+
*/
|
|
2387
|
+
wallet_key: string;
|
|
2388
|
+
};
|
|
2389
|
+
/**
|
|
2390
|
+
* All wallet balances for a customer.
|
|
2391
|
+
*/
|
|
2392
|
+
export type WalletBalancesResponse = {
|
|
2393
|
+
/**
|
|
2394
|
+
* Customer wallet balances.
|
|
2395
|
+
*/
|
|
2396
|
+
balances: WalletBalance[];
|
|
2397
|
+
};
|
|
2398
|
+
/**
|
|
2399
|
+
* Closed-loop wallet definition.
|
|
2400
|
+
*/
|
|
2401
|
+
export type WalletDef = {
|
|
2402
|
+
/**
|
|
2403
|
+
* True when customers can top up and spend from this wallet.
|
|
2404
|
+
*/
|
|
2405
|
+
active: boolean;
|
|
2406
|
+
/**
|
|
2407
|
+
* 3-letter ISO 4217 currency code.
|
|
2408
|
+
*/
|
|
2409
|
+
currency: string;
|
|
2410
|
+
/**
|
|
2411
|
+
* Optional default lot expiry in days.
|
|
2412
|
+
*/
|
|
2413
|
+
expires_days?: number | null;
|
|
2414
|
+
/**
|
|
2415
|
+
* Stable wallet key (e.g. try, usd, store_credit).
|
|
2416
|
+
*/
|
|
2417
|
+
key: string;
|
|
2418
|
+
/**
|
|
2419
|
+
* Wallet kind (fiat or points).
|
|
2420
|
+
*/
|
|
2421
|
+
kind: "fiat" | "points";
|
|
2422
|
+
/**
|
|
2423
|
+
* Human-readable wallet name.
|
|
2424
|
+
*/
|
|
2425
|
+
name: string;
|
|
2426
|
+
/**
|
|
2427
|
+
* Maximum top-up amount in minor units.
|
|
2428
|
+
*/
|
|
2429
|
+
topup_max: number;
|
|
2430
|
+
/**
|
|
2431
|
+
* Minimum top-up amount in minor units.
|
|
2432
|
+
*/
|
|
2433
|
+
topup_min: number;
|
|
2434
|
+
};
|
|
2435
|
+
/**
|
|
2436
|
+
* Two-phase wallet hold state.
|
|
2437
|
+
*/
|
|
2438
|
+
export type WalletHold = {
|
|
2439
|
+
/**
|
|
2440
|
+
* Reserved amount in minor units.
|
|
2441
|
+
*/
|
|
2442
|
+
amount: number;
|
|
2443
|
+
/**
|
|
2444
|
+
* Committed amount in minor units.
|
|
2445
|
+
*/
|
|
2446
|
+
committed_amount: number;
|
|
2447
|
+
/**
|
|
2448
|
+
* Hold creation timestamp.
|
|
2449
|
+
*/
|
|
2450
|
+
created_at: string;
|
|
2451
|
+
/**
|
|
2452
|
+
* ISO 4217 currency code.
|
|
2453
|
+
*/
|
|
2454
|
+
currency: string;
|
|
2455
|
+
/**
|
|
2456
|
+
* Customer UID.
|
|
2457
|
+
*/
|
|
2458
|
+
customer_id: string;
|
|
2459
|
+
/**
|
|
2460
|
+
* Hold expiry timestamp.
|
|
2461
|
+
*/
|
|
2462
|
+
expires_at: string;
|
|
2463
|
+
/**
|
|
2464
|
+
* Hold UUID.
|
|
2465
|
+
*/
|
|
2466
|
+
id: string;
|
|
2467
|
+
/**
|
|
2468
|
+
* Merchant reference.
|
|
2469
|
+
*/
|
|
2470
|
+
reference?: string;
|
|
2471
|
+
/**
|
|
2472
|
+
* True when replayed by Idempotency-Key.
|
|
2473
|
+
*/
|
|
2474
|
+
replayed?: boolean;
|
|
2475
|
+
/**
|
|
2476
|
+
* Settlement timestamp.
|
|
2477
|
+
*/
|
|
2478
|
+
settled_at?: string | null;
|
|
2479
|
+
/**
|
|
2480
|
+
* Hold status (active, committed, released, expired).
|
|
2481
|
+
*/
|
|
2482
|
+
status: string;
|
|
2483
|
+
/**
|
|
2484
|
+
* Wallet key.
|
|
2485
|
+
*/
|
|
2486
|
+
wallet_key: string;
|
|
2487
|
+
};
|
|
2488
|
+
/**
|
|
2489
|
+
* Emitted when a wallet hold is created, committed, released, or expired.
|
|
2490
|
+
*/
|
|
2491
|
+
export type WalletHoldEvent = {
|
|
2492
|
+
/**
|
|
2493
|
+
* Held amount in minor units.
|
|
2494
|
+
*/
|
|
2495
|
+
amount?: number;
|
|
2496
|
+
/**
|
|
2497
|
+
* Committed amount in minor units.
|
|
2498
|
+
*/
|
|
2499
|
+
committed_amount?: number;
|
|
2500
|
+
/**
|
|
2501
|
+
* Customer UID.
|
|
2502
|
+
*/
|
|
2503
|
+
customer_id: string;
|
|
2504
|
+
/**
|
|
2505
|
+
* Hold UUID.
|
|
2506
|
+
*/
|
|
2507
|
+
hold_id: string;
|
|
2508
|
+
/**
|
|
2509
|
+
* Hold status (active, committed, released, expired).
|
|
2510
|
+
*/
|
|
2511
|
+
status: string;
|
|
2512
|
+
/**
|
|
2513
|
+
* Wallet key.
|
|
2514
|
+
*/
|
|
2515
|
+
wallet_key: string;
|
|
2516
|
+
};
|
|
2517
|
+
/**
|
|
2518
|
+
* List of configured wallets.
|
|
2519
|
+
*/
|
|
2520
|
+
export type WalletListResponse = {
|
|
2521
|
+
/**
|
|
2522
|
+
* Project wallet definitions.
|
|
2523
|
+
*/
|
|
2524
|
+
wallets: WalletDef[];
|
|
2525
|
+
};
|
|
2526
|
+
/**
|
|
2527
|
+
* Ledger transaction and updated wallet balance.
|
|
2528
|
+
*/
|
|
2529
|
+
export type WalletTxBalanceResponse = {
|
|
2530
|
+
balance: WalletBalance;
|
|
2531
|
+
transaction: LedgerTxResult;
|
|
2532
|
+
};
|
|
2533
|
+
/** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
|
|
2534
|
+
export interface Events {
|
|
2535
|
+
/**
|
|
2536
|
+
* payments.dispute.closed: a provider dispute closed (won or lost); wallet chargeback debits or reversals are applied.
|
|
2537
|
+
*/
|
|
2538
|
+
"payments.dispute.closed": DisputeEvent;
|
|
2539
|
+
/**
|
|
2540
|
+
* payments.dispute.opened: a provider chargeback/dispute was opened against a payment.
|
|
2541
|
+
*/
|
|
2542
|
+
"payments.dispute.opened": DisputeEvent;
|
|
2543
|
+
/**
|
|
2544
|
+
* payments.payment.canceled: a PaymentIntent was canceled and any split wallet hold released.
|
|
2545
|
+
*/
|
|
2546
|
+
"payments.payment.canceled": PaymentLifecycleEvent;
|
|
2547
|
+
/**
|
|
2548
|
+
* payments.payment.failed: a payment attempt failed with a canonical decline code.
|
|
2549
|
+
*/
|
|
2550
|
+
"payments.payment.failed": PaymentLifecycleEvent;
|
|
2551
|
+
/**
|
|
2552
|
+
* payments.payment.requires_capture: a manual-capture PaymentIntent was authorized and awaits capture or cancel.
|
|
2553
|
+
*/
|
|
2554
|
+
"payments.payment.requires_capture": PaymentLifecycleEvent;
|
|
2555
|
+
/**
|
|
2556
|
+
* payments.payment.succeeded: a PaymentIntent was verified and settled (card, wallet, or split).
|
|
2557
|
+
*/
|
|
2558
|
+
"payments.payment.succeeded": PaymentLifecycleEvent;
|
|
2559
|
+
/**
|
|
2560
|
+
* payments.refund.succeeded: a refund settled to the original card or instantly to the customer's wallet.
|
|
2561
|
+
*/
|
|
2562
|
+
"payments.refund.succeeded": RefundSucceededEvent;
|
|
2563
|
+
/**
|
|
2564
|
+
* payments.subscription.canceled: a recurring subscription was canceled (immediately or at period end).
|
|
2565
|
+
*/
|
|
2566
|
+
"payments.subscription.canceled": SubscriptionEvent;
|
|
2567
|
+
/**
|
|
2568
|
+
* payments.subscription.changed: a recurring subscription started, renewed, entered past_due, or changed status.
|
|
2569
|
+
*/
|
|
2570
|
+
"payments.subscription.changed": SubscriptionEvent;
|
|
2571
|
+
/**
|
|
2572
|
+
* payments.wallet.balance_changed: a customer's closed-loop wallet balance changed; Realtime delivers this on payments:<ref>:<uid>.
|
|
2573
|
+
*/
|
|
2574
|
+
"payments.wallet.balance_changed": WalletBalanceEvent;
|
|
2575
|
+
/**
|
|
2576
|
+
* payments.wallet.hold_changed: a two-phase wallet hold was created, committed, released, or expired.
|
|
2577
|
+
*/
|
|
2578
|
+
"payments.wallet.hold_changed": WalletHoldEvent;
|
|
2579
|
+
}
|
|
2580
|
+
/** Palbase Payments */
|
|
2581
|
+
export declare function client(t: Transport): {
|
|
2582
|
+
/**
|
|
2583
|
+
* Get wallet cash-flow summary
|
|
2584
|
+
*
|
|
2585
|
+
* Aggregates closed-loop wallet inflows, outflows, refunds, chargebacks, and net customer liability grouped by currency.
|
|
2586
|
+
*/
|
|
2587
|
+
auditCashFlow(input?: {
|
|
2588
|
+
query?: {
|
|
2589
|
+
from?: string; /** Exclusive RFC 3339 end timestamp. */
|
|
2590
|
+
to?: string;
|
|
2591
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2592
|
+
signal?: AbortSignal;
|
|
2593
|
+
}): Promise<Reply<200, CashFlowResponse>>;
|
|
2594
|
+
/**
|
|
2595
|
+
* Verify zero-drift accounting integrity
|
|
2596
|
+
*
|
|
2597
|
+
* Audits every double-entry transaction (`SUM(debit)==SUM(credit)`) and reconciles every materialized wallet balance against immutable `ledger_entries`.
|
|
2598
|
+
*/
|
|
2599
|
+
auditDrift(input?: {
|
|
2600
|
+
signal?: AbortSignal;
|
|
2601
|
+
}): Promise<Reply<200, DriftReport>>;
|
|
2602
|
+
/**
|
|
2603
|
+
* List double-entry ledger entries
|
|
2604
|
+
*
|
|
2605
|
+
* Lists immutable double-entry ledger entries with cursor pagination in JSON.
|
|
2606
|
+
*/
|
|
2607
|
+
auditLedger(input?: {
|
|
2608
|
+
query?: {
|
|
2609
|
+
limit?: number; /** Opaque pagination cursor from the previous response's next_cursor. */
|
|
2610
|
+
cursor?: string; /** Filter by customer UID. */
|
|
2611
|
+
customer_id?: string; /** Filter by wallet key. */
|
|
2612
|
+
wallet_key?: string; /** Filter by transaction kind. */
|
|
2613
|
+
kind?: string; /** Inclusive RFC 3339 start timestamp. */
|
|
2614
|
+
from?: string; /** Exclusive RFC 3339 end timestamp. */
|
|
2615
|
+
to?: string;
|
|
2616
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2617
|
+
signal?: AbortSignal;
|
|
2618
|
+
}): Promise<Reply<200, AuditLedgerResponse>>;
|
|
2619
|
+
/**
|
|
2620
|
+
* Export double-entry ledger CSV
|
|
2621
|
+
*
|
|
2622
|
+
* Downloads immutable double-entry ledger entries as a RFC 4180 CSV attachment for accounting reconciliation.
|
|
2623
|
+
*/
|
|
2624
|
+
exportAuditLedgerCsv(input?: {
|
|
2625
|
+
query?: {
|
|
2626
|
+
customer_id?: string; /** Filter by wallet key. */
|
|
2627
|
+
wallet_key?: string; /** Filter by transaction kind. */
|
|
2628
|
+
kind?: string; /** Inclusive RFC 3339 start timestamp. */
|
|
2629
|
+
from?: string; /** Exclusive RFC 3339 end timestamp. */
|
|
2630
|
+
to?: string;
|
|
2631
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2632
|
+
signal?: AbortSignal;
|
|
2633
|
+
}): Promise<Reply<200, Response>>;
|
|
2634
|
+
/**
|
|
2635
|
+
* Handle GET provider callback
|
|
2636
|
+
*
|
|
2637
|
+
* Central 3DS / Checkout callback bridge: queries the provider API to verify the attempt outcome, updates PaymentIntent state atomically, and redirects or posts a message back to the app.
|
|
2638
|
+
*/
|
|
2639
|
+
providerCallbackGet(input: {
|
|
2640
|
+
path: {
|
|
2641
|
+
provider: string; /** PaymentAttempt UUID. */
|
|
2642
|
+
attempt_id: string;
|
|
2643
|
+
};
|
|
2644
|
+
query?: {
|
|
2645
|
+
session_id?: string; /** iyzico checkout/3DS token. */
|
|
2646
|
+
token?: string;
|
|
2647
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2648
|
+
signal?: AbortSignal;
|
|
2649
|
+
}): Promise<Reply<200, Response>>;
|
|
2650
|
+
/**
|
|
2651
|
+
* Handle POST provider callback
|
|
2652
|
+
*
|
|
2653
|
+
* Central POST->GET callback bridge for Turkish bank 3DS / iyzico form callbacks. Reads the provider token, verifies status via the provider API, updates PaymentIntent state, and returns a clean redirect/postMessage bridge page.
|
|
2654
|
+
*/
|
|
2655
|
+
providerCallbackPost(input: {
|
|
2656
|
+
path: {
|
|
2657
|
+
provider: string; /** PaymentAttempt UUID. */
|
|
2658
|
+
attempt_id: string;
|
|
2659
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2660
|
+
signal?: AbortSignal;
|
|
2661
|
+
}): Promise<Reply<200, Response>>;
|
|
2662
|
+
/**
|
|
2663
|
+
* Get payment capabilities
|
|
2664
|
+
*
|
|
2665
|
+
* Returns the resolved active payment channel's feature flags (installments, 3DS, Masterpass, Apple/Google Pay) and configured wallets for the requested currency.
|
|
2666
|
+
*/
|
|
2667
|
+
getCapabilities(input?: {
|
|
2668
|
+
query?: {
|
|
2669
|
+
currency?: string; /** Optional explicit channel key override. */
|
|
2670
|
+
channel?: string;
|
|
2671
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2672
|
+
signal?: AbortSignal;
|
|
2673
|
+
}): Promise<Reply<200, CapabilitiesResponse>>;
|
|
2674
|
+
/**
|
|
2675
|
+
* List payment channels
|
|
2676
|
+
*
|
|
2677
|
+
* Lists all connected Stripe and iyzico payment channels for the project.
|
|
2678
|
+
*/
|
|
2679
|
+
listChannels(input?: {
|
|
2680
|
+
signal?: AbortSignal;
|
|
2681
|
+
}): Promise<Reply<200, ChannelListResponse>>;
|
|
2682
|
+
/**
|
|
2683
|
+
* Connect payment channel
|
|
2684
|
+
*
|
|
2685
|
+
* Directly connects or updates a Stripe (restricted key only) or iyzico channel with optional Masterpass vault credentials. Closed to environment tokens.
|
|
2686
|
+
*/
|
|
2687
|
+
connectChannel(input: {
|
|
2688
|
+
body: ConnectChannelRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2689
|
+
signal?: AbortSignal;
|
|
2690
|
+
}): Promise<Reply<201, ChannelView>>;
|
|
2691
|
+
/**
|
|
2692
|
+
* Create credential connect grant
|
|
2693
|
+
*
|
|
2694
|
+
* Mints a one-time browser URL so a human can connect Stripe, iyzico, or Masterpass credentials without passing secrets through an AI agent or CLI.
|
|
2695
|
+
*/
|
|
2696
|
+
createChannelGrant(input: {
|
|
2697
|
+
body: ChannelGrantRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2698
|
+
signal?: AbortSignal;
|
|
2699
|
+
}): Promise<Reply<201, GrantResponse>>;
|
|
2700
|
+
/**
|
|
2701
|
+
* Get payment channel
|
|
2702
|
+
*
|
|
2703
|
+
* Reads one connected payment channel's status, key hint, and capabilities.
|
|
2704
|
+
*/
|
|
2705
|
+
getChannel(input: {
|
|
2706
|
+
path: {
|
|
2707
|
+
channel_key: string;
|
|
2708
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2709
|
+
signal?: AbortSignal;
|
|
2710
|
+
}): Promise<Reply<200, ChannelView>>;
|
|
2711
|
+
/**
|
|
2712
|
+
* Disconnect payment channel
|
|
2713
|
+
*
|
|
2714
|
+
* Disables a payment channel and removes its managed Stripe webhook endpoint. Closed to environment tokens.
|
|
2715
|
+
*/
|
|
2716
|
+
deleteChannel(input: {
|
|
2717
|
+
path: {
|
|
2718
|
+
channel_key: string;
|
|
2719
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2720
|
+
signal?: AbortSignal;
|
|
2721
|
+
}): Promise<Reply<204, undefined>>;
|
|
2722
|
+
/**
|
|
2723
|
+
* Check channel health
|
|
2724
|
+
*
|
|
2725
|
+
* Probes the connected provider API to verify credentials and permissions are still valid.
|
|
2726
|
+
*/
|
|
2727
|
+
checkChannel(input: {
|
|
2728
|
+
path: {
|
|
2729
|
+
channel_key: string;
|
|
2730
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2731
|
+
signal?: AbortSignal;
|
|
2732
|
+
}): Promise<Reply<200, ChannelView>>;
|
|
2733
|
+
/**
|
|
2734
|
+
* Set default channel
|
|
2735
|
+
*
|
|
2736
|
+
* Marks an active payment channel as the project's default fallback channel.
|
|
2737
|
+
*/
|
|
2738
|
+
setDefaultChannel(input: {
|
|
2739
|
+
path: {
|
|
2740
|
+
channel_key: string;
|
|
2741
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2742
|
+
signal?: AbortSignal;
|
|
2743
|
+
}): Promise<Reply<200, ChannelView>>;
|
|
2744
|
+
/**
|
|
2745
|
+
* Render credential connect page
|
|
2746
|
+
*
|
|
2747
|
+
* Renders the one-time browser form where a human connects Stripe or iyzico keys directly to the payments module.
|
|
2748
|
+
*/
|
|
2749
|
+
connectChannelPage(input?: {
|
|
2750
|
+
query?: {
|
|
2751
|
+
grant?: string;
|
|
2752
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2753
|
+
signal?: AbortSignal;
|
|
2754
|
+
}): Promise<Reply<200, Response>>;
|
|
2755
|
+
/**
|
|
2756
|
+
* Submit credential connect form
|
|
2757
|
+
*
|
|
2758
|
+
* Validates the one-time connect grant, probes provider credentials, seals them with the project's data key, and activates the channel.
|
|
2759
|
+
*/
|
|
2760
|
+
connectChannelSubmit(input?: {
|
|
2761
|
+
signal?: AbortSignal;
|
|
2762
|
+
}): Promise<Reply<200, ChannelView>>;
|
|
2763
|
+
/**
|
|
2764
|
+
* List disputes
|
|
2765
|
+
*
|
|
2766
|
+
* Lists payment chargebacks and disputes across providers with cursor pagination.
|
|
2767
|
+
*/
|
|
2768
|
+
listDisputes(input?: {
|
|
2769
|
+
query?: {
|
|
2770
|
+
limit?: number; /** Opaque pagination cursor from the previous response's next_cursor. */
|
|
2771
|
+
cursor?: string; /** Filter by dispute status. */
|
|
2772
|
+
status?: string;
|
|
2773
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2774
|
+
signal?: AbortSignal;
|
|
2775
|
+
}): Promise<Reply<200, DisputeListResponse>>;
|
|
2776
|
+
/**
|
|
2777
|
+
* Look up BIN and installments
|
|
2778
|
+
*
|
|
2779
|
+
* Queries the active channel provider for card BIN metadata and available installment options for the given amount and currency.
|
|
2780
|
+
*/
|
|
2781
|
+
lookupInstallments(input: {
|
|
2782
|
+
body: InstallmentLookupRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2783
|
+
signal?: AbortSignal;
|
|
2784
|
+
}): Promise<Reply<200, InstallmentTable>>;
|
|
2785
|
+
/**
|
|
2786
|
+
* List payment intents
|
|
2787
|
+
*
|
|
2788
|
+
* Lists PaymentIntents for the project with cursor pagination and optional filters by status, customer_id, or reference.
|
|
2789
|
+
*/
|
|
2790
|
+
listIntents(input?: {
|
|
2791
|
+
query?: {
|
|
2792
|
+
limit?: number; /** Opaque pagination cursor from the previous response's next_cursor. */
|
|
2793
|
+
cursor?: string; /** Filter by canonical intent status. */
|
|
2794
|
+
status?: string; /** Filter by customer UID. */
|
|
2795
|
+
customer_id?: string; /** Filter by merchant reference. */
|
|
2796
|
+
reference?: string;
|
|
2797
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2798
|
+
signal?: AbortSignal;
|
|
2799
|
+
}): Promise<Reply<200, IntentListResponse>>;
|
|
2800
|
+
/**
|
|
2801
|
+
* Create payment intent
|
|
2802
|
+
*
|
|
2803
|
+
* Creates a server-sealed PaymentIntent (card, split wallet+card, full wallet, or guest checkout). Requires the project's secret key unless allow_client_payments is explicitly enabled.
|
|
2804
|
+
*/
|
|
2805
|
+
createIntent(input: {
|
|
2806
|
+
headers?: {
|
|
2807
|
+
"Idempotency-Key"?: string;
|
|
2808
|
+
};
|
|
2809
|
+
body: CreateIntentRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2810
|
+
signal?: AbortSignal;
|
|
2811
|
+
}): Promise<Reply<201, IntentView>>;
|
|
2812
|
+
/**
|
|
2813
|
+
* Get payment intent
|
|
2814
|
+
*
|
|
2815
|
+
* Reads a PaymentIntent's current canonical status. Authorized by secret key, matching customer JWT, or matching client_secret query parameter.
|
|
2816
|
+
*/
|
|
2817
|
+
getIntent(input: {
|
|
2818
|
+
path: {
|
|
2819
|
+
intent_id: string;
|
|
2820
|
+
};
|
|
2821
|
+
query?: {
|
|
2822
|
+
client_secret?: string;
|
|
2823
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2824
|
+
signal?: AbortSignal;
|
|
2825
|
+
}): Promise<Reply<200, IntentView>>;
|
|
2826
|
+
/**
|
|
2827
|
+
* List payment attempts
|
|
2828
|
+
*
|
|
2829
|
+
* Returns the full 1:N attempt audit history for a PaymentIntent, including provider latency, fees, and canonical decline codes.
|
|
2830
|
+
*/
|
|
2831
|
+
listIntentAttempts(input: {
|
|
2832
|
+
path: {
|
|
2833
|
+
intent_id: string;
|
|
2834
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2835
|
+
signal?: AbortSignal;
|
|
2836
|
+
}): Promise<Reply<200, AttemptListResponse>>;
|
|
2837
|
+
/**
|
|
2838
|
+
* Cancel payment intent
|
|
2839
|
+
*
|
|
2840
|
+
* Cancels an unsettled PaymentIntent, voids any provider authorization, and releases any split wallet hold.
|
|
2841
|
+
*/
|
|
2842
|
+
cancelIntent(input: {
|
|
2843
|
+
path: {
|
|
2844
|
+
intent_id: string;
|
|
2845
|
+
};
|
|
2846
|
+
headers?: {
|
|
2847
|
+
"Idempotency-Key"?: string;
|
|
2848
|
+
};
|
|
2849
|
+
body?: CancelIntentRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2850
|
+
signal?: AbortSignal;
|
|
2851
|
+
}): Promise<Reply<200, IntentView>>;
|
|
2852
|
+
/**
|
|
2853
|
+
* Capture authorized payment
|
|
2854
|
+
*
|
|
2855
|
+
* Captures a manual-capture PaymentIntent currently in requires_capture state (full or partial).
|
|
2856
|
+
*/
|
|
2857
|
+
captureIntent(input: {
|
|
2858
|
+
path: {
|
|
2859
|
+
intent_id: string;
|
|
2860
|
+
};
|
|
2861
|
+
headers?: {
|
|
2862
|
+
"Idempotency-Key"?: string;
|
|
2863
|
+
};
|
|
2864
|
+
body?: CaptureIntentRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2865
|
+
signal?: AbortSignal;
|
|
2866
|
+
}): Promise<Reply<200, IntentView>>;
|
|
2867
|
+
/**
|
|
2868
|
+
* Confirm payment intent
|
|
2869
|
+
*
|
|
2870
|
+
* Creates a new PaymentAttempt for the PaymentIntent (saved card, Masterpass OTP, Stripe Elements, or hosted/embedded 3DS form) and returns the canonical NextAction.
|
|
2871
|
+
*/
|
|
2872
|
+
confirmIntent(input: {
|
|
2873
|
+
path: {
|
|
2874
|
+
intent_id: string;
|
|
2875
|
+
};
|
|
2876
|
+
headers?: {
|
|
2877
|
+
"Idempotency-Key"?: string;
|
|
2878
|
+
};
|
|
2879
|
+
body: ConfirmIntentRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2880
|
+
signal?: AbortSignal;
|
|
2881
|
+
}): Promise<Reply<200, IntentView>>;
|
|
2882
|
+
/**
|
|
2883
|
+
* Submit payment OTP
|
|
2884
|
+
*
|
|
2885
|
+
* Verifies a customer's Masterpass or bank OTP challenge and completes the active payment attempt.
|
|
2886
|
+
*/
|
|
2887
|
+
submitIntentOtp(input: {
|
|
2888
|
+
path: {
|
|
2889
|
+
intent_id: string;
|
|
2890
|
+
};
|
|
2891
|
+
body: SubmitOTPRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2892
|
+
signal?: AbortSignal;
|
|
2893
|
+
}): Promise<Reply<200, IntentView>>;
|
|
2894
|
+
/**
|
|
2895
|
+
* List saved payment methods
|
|
2896
|
+
*
|
|
2897
|
+
* Lists the signed-in customer's active tokenized payment methods across Stripe, iyzico, and Masterpass.
|
|
2898
|
+
*/
|
|
2899
|
+
listMyMethods(input?: {
|
|
2900
|
+
signal?: AbortSignal;
|
|
2901
|
+
}): Promise<Reply<200, SavedMethodListResponse>>;
|
|
2902
|
+
/**
|
|
2903
|
+
* Add saved payment method
|
|
2904
|
+
*
|
|
2905
|
+
* Initiates a PCI-safe card tokenization flow (SetupIntent, iyzico card save, or Masterpass OTP link) and returns a NextAction.
|
|
2906
|
+
*/
|
|
2907
|
+
addMyMethod(input?: {
|
|
2908
|
+
body?: AddMethodRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2909
|
+
signal?: AbortSignal;
|
|
2910
|
+
}): Promise<Reply<201, NextActionResponse>>;
|
|
2911
|
+
/**
|
|
2912
|
+
* Delete saved payment method
|
|
2913
|
+
*
|
|
2914
|
+
* Detaches the saved payment method from the provider vault and marks it revoked.
|
|
2915
|
+
*/
|
|
2916
|
+
deleteMyMethod(input: {
|
|
2917
|
+
path: {
|
|
2918
|
+
method_id: string;
|
|
2919
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2920
|
+
signal?: AbortSignal;
|
|
2921
|
+
}): Promise<Reply<204, undefined>>;
|
|
2922
|
+
/**
|
|
2923
|
+
* Create billing portal session
|
|
2924
|
+
*
|
|
2925
|
+
* Opens a provider-hosted self-service billing portal session for the signed-in customer.
|
|
2926
|
+
*/
|
|
2927
|
+
createMyPortal(input: {
|
|
2928
|
+
body: PortalRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2929
|
+
signal?: AbortSignal;
|
|
2930
|
+
}): Promise<Reply<200, PortalResponse>>;
|
|
2931
|
+
/**
|
|
2932
|
+
* Get customer billing profile
|
|
2933
|
+
*
|
|
2934
|
+
* Reads the signed-in customer's saved billing/shipping profile (decrypted on read).
|
|
2935
|
+
*/
|
|
2936
|
+
getMyProfile(input?: {
|
|
2937
|
+
signal?: AbortSignal;
|
|
2938
|
+
}): Promise<Reply<200, Buyer>>;
|
|
2939
|
+
/**
|
|
2940
|
+
* Update customer billing profile
|
|
2941
|
+
*
|
|
2942
|
+
* Saves the signed-in customer's billing/shipping profile sealed with the project's data key.
|
|
2943
|
+
*/
|
|
2944
|
+
updateMyProfile(input: {
|
|
2945
|
+
body: Buyer; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2946
|
+
signal?: AbortSignal;
|
|
2947
|
+
}): Promise<Reply<200, Buyer>>;
|
|
2948
|
+
/**
|
|
2949
|
+
* List my subscriptions
|
|
2950
|
+
*
|
|
2951
|
+
* Lists the signed-in customer's recurring payment subscriptions.
|
|
2952
|
+
*/
|
|
2953
|
+
listMySubscriptions(input?: {
|
|
2954
|
+
query?: {
|
|
2955
|
+
limit?: number; /** Opaque pagination cursor from the previous response's next_cursor. */
|
|
2956
|
+
cursor?: string;
|
|
2957
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2958
|
+
signal?: AbortSignal;
|
|
2959
|
+
}): Promise<Reply<200, SubscriptionListResponse>>;
|
|
2960
|
+
/**
|
|
2961
|
+
* Cancel my subscription
|
|
2962
|
+
*
|
|
2963
|
+
* Schedules cancellation of one of the signed-in customer's subscriptions at period end.
|
|
2964
|
+
*/
|
|
2965
|
+
cancelMySubscription(input: {
|
|
2966
|
+
path: {
|
|
2967
|
+
subscription_id: string;
|
|
2968
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2969
|
+
signal?: AbortSignal;
|
|
2970
|
+
}): Promise<Reply<200, CancelSubscriptionResponse>>;
|
|
2971
|
+
/**
|
|
2972
|
+
* List my wallet balances
|
|
2973
|
+
*
|
|
2974
|
+
* Returns the signed-in customer's live closed-loop wallet balances (available, held, frozen).
|
|
2975
|
+
*/
|
|
2976
|
+
listMyWallets(input?: {
|
|
2977
|
+
signal?: AbortSignal;
|
|
2978
|
+
}): Promise<Reply<200, WalletBalancesResponse>>;
|
|
2979
|
+
/**
|
|
2980
|
+
* Create single-use QR spend token
|
|
2981
|
+
*
|
|
2982
|
+
* Mints a short-lived single-use opaque spend token (`pst_...`) the customer presents as a QR code for POS or merchant wallet charges.
|
|
2983
|
+
*/
|
|
2984
|
+
createMySpendToken(input: {
|
|
2985
|
+
body: CreateSpendTokenRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2986
|
+
signal?: AbortSignal;
|
|
2987
|
+
}): Promise<Reply<201, SpendToken>>;
|
|
2988
|
+
/**
|
|
2989
|
+
* Top up my wallet
|
|
2990
|
+
*
|
|
2991
|
+
* Creates and initiates a real-money PaymentIntent to top up one of the customer's wallets.
|
|
2992
|
+
*/
|
|
2993
|
+
topUpMyWallet(input: {
|
|
2994
|
+
headers?: {
|
|
2995
|
+
"Idempotency-Key"?: string;
|
|
2996
|
+
};
|
|
2997
|
+
body: TopUpWalletRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2998
|
+
signal?: AbortSignal;
|
|
2999
|
+
}): Promise<Reply<201, IntentView>>;
|
|
3000
|
+
/**
|
|
3001
|
+
* List refunds
|
|
3002
|
+
*
|
|
3003
|
+
* Lists refunds with cursor pagination and optional intent_id filter.
|
|
3004
|
+
*/
|
|
3005
|
+
listRefunds(input?: {
|
|
3006
|
+
query?: {
|
|
3007
|
+
limit?: number; /** Opaque pagination cursor from the previous response's next_cursor. */
|
|
3008
|
+
cursor?: string; /** Filter by PaymentIntent UUID. */
|
|
3009
|
+
intent_id?: string;
|
|
3010
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3011
|
+
signal?: AbortSignal;
|
|
3012
|
+
}): Promise<Reply<200, RefundListResponse>>;
|
|
3013
|
+
/**
|
|
3014
|
+
* Create refund
|
|
3015
|
+
*
|
|
3016
|
+
* Issues a full or partial refund to the original card (automatically choosing iyzico cancel vs refund) or instantly to the customer's wallet (`destination: "wallet"`). Requires Idempotency-Key.
|
|
3017
|
+
*/
|
|
3018
|
+
createRefund(input: {
|
|
3019
|
+
headers: {
|
|
3020
|
+
"Idempotency-Key": string;
|
|
3021
|
+
};
|
|
3022
|
+
body: CreateRefundRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3023
|
+
signal?: AbortSignal;
|
|
3024
|
+
}): Promise<Reply<201, RefundView>>;
|
|
3025
|
+
/**
|
|
3026
|
+
* List routing rules
|
|
3027
|
+
*
|
|
3028
|
+
* Lists deterministic channel routing rules ordered by priority.
|
|
3029
|
+
*/
|
|
3030
|
+
listRoutingRules(input?: {
|
|
3031
|
+
signal?: AbortSignal;
|
|
3032
|
+
}): Promise<Reply<200, RoutingRulesPayload>>;
|
|
3033
|
+
/**
|
|
3034
|
+
* Replace routing rules
|
|
3035
|
+
*
|
|
3036
|
+
* Atomically replaces the project's deterministic currency/country/kind channel routing rules.
|
|
3037
|
+
*/
|
|
3038
|
+
replaceRoutingRules(input: {
|
|
3039
|
+
body: RoutingRulesPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3040
|
+
signal?: AbortSignal;
|
|
3041
|
+
}): Promise<Reply<200, RoutingRulesPayload>>;
|
|
3042
|
+
/**
|
|
3043
|
+
* Get payments settings
|
|
3044
|
+
*
|
|
3045
|
+
* Reads the project's payments limits, 3DS threshold, velocity rules, and buyer defaults.
|
|
3046
|
+
*/
|
|
3047
|
+
getSettings(input?: {
|
|
3048
|
+
signal?: AbortSignal;
|
|
3049
|
+
}): Promise<Reply<200, Settings>>;
|
|
3050
|
+
/**
|
|
3051
|
+
* Update payments settings
|
|
3052
|
+
*
|
|
3053
|
+
* Updates the project's payments limits, 3DS threshold, velocity rules, and buyer defaults.
|
|
3054
|
+
*/
|
|
3055
|
+
updateSettings(input: {
|
|
3056
|
+
body: Settings; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3057
|
+
signal?: AbortSignal;
|
|
3058
|
+
}): Promise<Reply<200, Settings>>;
|
|
3059
|
+
/**
|
|
3060
|
+
* Handle Stripe App OAuth callback
|
|
3061
|
+
*
|
|
3062
|
+
* Completes Stripe App OAuth installation after Stripe redirects back with code and state.
|
|
3063
|
+
*/
|
|
3064
|
+
stripeAppCallback(input?: {
|
|
3065
|
+
query?: {
|
|
3066
|
+
code?: string; /** OAuth state grant token. */
|
|
3067
|
+
state?: string;
|
|
3068
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3069
|
+
signal?: AbortSignal;
|
|
3070
|
+
}): Promise<Reply<200, Response>>;
|
|
3071
|
+
/**
|
|
3072
|
+
* Create Stripe App install grant
|
|
3073
|
+
*
|
|
3074
|
+
* Mints a one-time browser link to install the Palbase Stripe App.
|
|
3075
|
+
*/
|
|
3076
|
+
createStripeAppGrant(input?: {
|
|
3077
|
+
body?: StripeAppGrantRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3078
|
+
signal?: AbortSignal;
|
|
3079
|
+
}): Promise<Reply<201, GrantResponse>>;
|
|
3080
|
+
/**
|
|
3081
|
+
* Render Stripe App install page
|
|
3082
|
+
*
|
|
3083
|
+
* Renders the confirmation page to launch one-click Palbase Stripe App OAuth installation.
|
|
3084
|
+
*/
|
|
3085
|
+
stripeAppInstallPage(input?: {
|
|
3086
|
+
query?: {
|
|
3087
|
+
grant?: string; /** Target Stripe mode (test or live). */
|
|
3088
|
+
mode?: string;
|
|
3089
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3090
|
+
signal?: AbortSignal;
|
|
3091
|
+
}): Promise<Reply<200, Response>>;
|
|
3092
|
+
/**
|
|
3093
|
+
* Start Stripe App OAuth flow
|
|
3094
|
+
*
|
|
3095
|
+
* Redirects the browser to Stripe's OAuth authorization endpoint for the Palbase Stripe App.
|
|
3096
|
+
*/
|
|
3097
|
+
stripeAppInstallStart(input?: {
|
|
3098
|
+
signal?: AbortSignal;
|
|
3099
|
+
}): Promise<Reply<303, undefined>>;
|
|
3100
|
+
/**
|
|
3101
|
+
* List subscriptions
|
|
3102
|
+
*
|
|
3103
|
+
* Lists recurring payment subscriptions with cursor pagination.
|
|
3104
|
+
*/
|
|
3105
|
+
listSubscriptions(input?: {
|
|
3106
|
+
query?: {
|
|
3107
|
+
limit?: number; /** Opaque pagination cursor from the previous response's next_cursor. */
|
|
3108
|
+
cursor?: string; /** Filter by customer UID. */
|
|
3109
|
+
customer_id?: string;
|
|
3110
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3111
|
+
signal?: AbortSignal;
|
|
3112
|
+
}): Promise<Reply<200, SubscriptionListResponse>>;
|
|
3113
|
+
/**
|
|
3114
|
+
* Create subscription
|
|
3115
|
+
*
|
|
3116
|
+
* Creates a recurring subscription on the routed Stripe or iyzico channel and returns the initial NextAction.
|
|
3117
|
+
*/
|
|
3118
|
+
createSubscription(input: {
|
|
3119
|
+
headers?: {
|
|
3120
|
+
"Idempotency-Key"?: string;
|
|
3121
|
+
};
|
|
3122
|
+
body: CreateSubscriptionRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3123
|
+
signal?: AbortSignal;
|
|
3124
|
+
}): Promise<Reply<201, SubscriptionView>>;
|
|
3125
|
+
/**
|
|
3126
|
+
* Cancel subscription
|
|
3127
|
+
*
|
|
3128
|
+
* Cancels a customer subscription at period end or immediately.
|
|
3129
|
+
*/
|
|
3130
|
+
cancelSubscription(input: {
|
|
3131
|
+
path: {
|
|
3132
|
+
subscription_id: string;
|
|
3133
|
+
};
|
|
3134
|
+
body?: CancelSubscriptionRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3135
|
+
signal?: AbortSignal;
|
|
3136
|
+
}): Promise<Reply<200, CancelSubscriptionResponse>>;
|
|
3137
|
+
/**
|
|
3138
|
+
* Extend subscription
|
|
3139
|
+
*
|
|
3140
|
+
* Extends a subscription's billing period or trial by 1 to 90 days.
|
|
3141
|
+
*/
|
|
3142
|
+
extendSubscription(input: {
|
|
3143
|
+
path: {
|
|
3144
|
+
subscription_id: string;
|
|
3145
|
+
};
|
|
3146
|
+
body: ExtendSubscriptionRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3147
|
+
signal?: AbortSignal;
|
|
3148
|
+
}): Promise<Reply<200, ExtendSubscriptionResponse>>;
|
|
3149
|
+
/**
|
|
3150
|
+
* List wallet definitions
|
|
3151
|
+
*
|
|
3152
|
+
* Lists configured closed-loop wallets for the project.
|
|
3153
|
+
*/
|
|
3154
|
+
listWallets(input?: {
|
|
3155
|
+
signal?: AbortSignal;
|
|
3156
|
+
}): Promise<Reply<200, WalletListResponse>>;
|
|
3157
|
+
/**
|
|
3158
|
+
* Create or update wallet definition
|
|
3159
|
+
*
|
|
3160
|
+
* Creates or updates a closed-loop wallet definition (currency, top-up bounds, expiry policy).
|
|
3161
|
+
*/
|
|
3162
|
+
upsertWallet(input: {
|
|
3163
|
+
body: WalletDef; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3164
|
+
signal?: AbortSignal;
|
|
3165
|
+
}): Promise<Reply<200, WalletDef>>;
|
|
3166
|
+
/**
|
|
3167
|
+
* Charge customer wallet
|
|
3168
|
+
*
|
|
3169
|
+
* Atomically debits a customer's closed-loop wallet (by customer_id or single-use QR spend_token) with double-entry ledger accounting and FIFO lot expiry. Requires Idempotency-Key.
|
|
3170
|
+
*/
|
|
3171
|
+
chargeWallet(input: {
|
|
3172
|
+
headers: {
|
|
3173
|
+
"Idempotency-Key": string;
|
|
3174
|
+
};
|
|
3175
|
+
body: ChargeWalletRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3176
|
+
signal?: AbortSignal;
|
|
3177
|
+
}): Promise<Reply<200, WalletTxBalanceResponse>>;
|
|
3178
|
+
/**
|
|
3179
|
+
* Credit customer wallet
|
|
3180
|
+
*
|
|
3181
|
+
* Grants promotional rewards, cashback, or administrative adjustments to a customer wallet with optional lot expiry. Requires Idempotency-Key.
|
|
3182
|
+
*/
|
|
3183
|
+
creditWallet(input: {
|
|
3184
|
+
headers: {
|
|
3185
|
+
"Idempotency-Key": string;
|
|
3186
|
+
};
|
|
3187
|
+
body: CreditWalletRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3188
|
+
signal?: AbortSignal;
|
|
3189
|
+
}): Promise<Reply<200, WalletTxBalanceResponse>>;
|
|
3190
|
+
/**
|
|
3191
|
+
* Get customer wallet balances
|
|
3192
|
+
*
|
|
3193
|
+
* Reads all closed-loop wallet balances for a specific customer.
|
|
3194
|
+
*/
|
|
3195
|
+
getCustomerWallets(input: {
|
|
3196
|
+
path: {
|
|
3197
|
+
customer_id: string;
|
|
3198
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3199
|
+
signal?: AbortSignal;
|
|
3200
|
+
}): Promise<Reply<200, WalletBalancesResponse>>;
|
|
3201
|
+
/**
|
|
3202
|
+
* Freeze or unfreeze customer wallet
|
|
3203
|
+
*
|
|
3204
|
+
* Freezes or unfreezes spending on a customer's wallet (e.g. during fraud or chargeback investigation).
|
|
3205
|
+
*/
|
|
3206
|
+
freezeWallet(input: {
|
|
3207
|
+
path: {
|
|
3208
|
+
customer_id: string; /** Wallet key. */
|
|
3209
|
+
wallet_key: string;
|
|
3210
|
+
};
|
|
3211
|
+
body: FreezeWalletRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3212
|
+
signal?: AbortSignal;
|
|
3213
|
+
}): Promise<Reply<200, WalletBalance>>;
|
|
3214
|
+
/**
|
|
3215
|
+
* Create two-phase wallet hold
|
|
3216
|
+
*
|
|
3217
|
+
* Reserves funds in a customer wallet for an in-flight order, ride, or AI job. Must be committed or released before TTL expiry. Requires Idempotency-Key.
|
|
3218
|
+
*/
|
|
3219
|
+
createWalletHold(input: {
|
|
3220
|
+
headers: {
|
|
3221
|
+
"Idempotency-Key": string;
|
|
3222
|
+
};
|
|
3223
|
+
body: HoldWalletRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3224
|
+
signal?: AbortSignal;
|
|
3225
|
+
}): Promise<Reply<200, WalletHold> | Reply<201, WalletHold>>;
|
|
3226
|
+
/**
|
|
3227
|
+
* Commit wallet hold
|
|
3228
|
+
*
|
|
3229
|
+
* Commits an active wallet hold for the full or partial amount, releasing any unused remainder back to available balance.
|
|
3230
|
+
*/
|
|
3231
|
+
commitWalletHold(input: {
|
|
3232
|
+
path: {
|
|
3233
|
+
hold_id: string;
|
|
3234
|
+
};
|
|
3235
|
+
body?: CommitHoldRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3236
|
+
signal?: AbortSignal;
|
|
3237
|
+
}): Promise<Reply<200, WalletHold>>;
|
|
3238
|
+
/**
|
|
3239
|
+
* Release wallet hold
|
|
3240
|
+
*
|
|
3241
|
+
* Releases an active wallet hold and returns the reserved funds to available balance.
|
|
3242
|
+
*/
|
|
3243
|
+
releaseWalletHold(input: {
|
|
3244
|
+
path: {
|
|
3245
|
+
hold_id: string;
|
|
3246
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3247
|
+
signal?: AbortSignal;
|
|
3248
|
+
}): Promise<Reply<200, WalletHold>>;
|
|
3249
|
+
/**
|
|
3250
|
+
* Transfer wallet balance
|
|
3251
|
+
*
|
|
3252
|
+
* Atomically transfers closed-loop wallet balance between two customers with deadlock-free ordered row locking. Backend secret-key only; requires Idempotency-Key.
|
|
3253
|
+
*/
|
|
3254
|
+
transferWallet(input: {
|
|
3255
|
+
headers: {
|
|
3256
|
+
"Idempotency-Key": string;
|
|
3257
|
+
};
|
|
3258
|
+
body: TransferWalletRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3259
|
+
signal?: AbortSignal;
|
|
3260
|
+
}): Promise<Reply<200, TransferWalletResponse>>;
|
|
3261
|
+
/**
|
|
3262
|
+
* Receive iyzico webhook
|
|
3263
|
+
*
|
|
3264
|
+
* Receives iyzico webhook notifications, verifies `X-IYZ-SIGNATURE-V3` when present, and always re-fetches authoritative payment/subscription status via the iyzico Retrieve API.
|
|
3265
|
+
*/
|
|
3266
|
+
iyzicoWebhook(input?: {
|
|
3267
|
+
signal?: AbortSignal;
|
|
3268
|
+
}): Promise<Reply<200, undefined>>;
|
|
3269
|
+
/**
|
|
3270
|
+
* Receive Stripe webhook
|
|
3271
|
+
*
|
|
3272
|
+
* Receives signed Stripe webhook events (`Stripe-Signature`), records them in the encrypted inbox, and re-fetches authoritative state from Stripe before mutating intents, subscriptions, or disputes.
|
|
3273
|
+
*/
|
|
3274
|
+
stripeWebhook(input?: {
|
|
3275
|
+
signal?: AbortSignal;
|
|
3276
|
+
}): Promise<Reply<200, undefined>>;
|
|
3277
|
+
/**
|
|
3278
|
+
* Receive Stripe App webhook
|
|
3279
|
+
*
|
|
3280
|
+
* Receives signed webhook events for the Palbase Stripe App installation.
|
|
3281
|
+
*/
|
|
3282
|
+
stripeAppWebhook(input?: {
|
|
3283
|
+
signal?: AbortSignal;
|
|
3284
|
+
}): Promise<Reply<200, undefined>>;
|
|
3285
|
+
};
|
|
3286
|
+
export type Client = ReturnType<typeof client>;
|