glitch-javascript-sdk 3.15.0 → 4.0.1
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 +10 -0
- package/dist/browser/hosting-runtime.js +1 -1
- package/dist/browser/hosting-runtime.js.map +1 -1
- package/dist/cjs/index.js +7602 -52
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Microtransactions.d.ts +286 -39
- package/dist/esm/index.js +7643 -52
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/util/Requests.d.ts +3 -1
- package/dist/index.d.ts +290 -41
- package/guides/commerce-delivery-receiver.mjs +117 -0
- package/guides/microtransactions.md +258 -32
- package/package.json +3 -2
- package/src/api/Microtransactions.ts +252 -38
- package/src/routes/MicrotransactionsRoute.ts +11 -0
- package/src/util/MicrotransactionOverlay.ts +92 -27
- package/src/util/Requests.ts +2 -2
- package/src/util/Session.ts +3 -2
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { AxiosProgressEvent, AxiosPromise, AxiosRequestConfig } from 'axios';
|
|
2
2
|
export type MicrotransactionEnvironment = 'sandbox' | 'live';
|
|
3
|
+
export type MicrotransactionProviderName = 'stripe' | 'xsolla';
|
|
3
4
|
export type MicrotransactionProductType = 'durable' | 'consumable' | 'currency' | 'bundle' | 'pass';
|
|
4
5
|
export type MicrotransactionCurrency = 'USD' | 'EUR' | 'GBP' | 'CAD' | 'AUD' | 'JPY' | 'BRL' | 'INR' | 'KRW';
|
|
5
6
|
export type MicrotransactionProductStatus = 'draft' | 'active' | 'archived';
|
|
6
|
-
export type MicrotransactionPaymentStatus = 'created' | 'action_required' | 'pending' | 'unknown' | 'paid' | 'failed' | 'canceled' | 'refund_pending' | 'partially_refunded' | 'refunded' | 'disputed' | 'quarantined';
|
|
7
|
+
export type MicrotransactionPaymentStatus = 'created' | 'action_required' | 'pending' | 'unknown' | 'paid' | 'failed' | 'canceled' | 'refund_pending' | 'partially_refunded' | 'refunded' | 'disputed' | 'quarantined' | 'refund_review';
|
|
8
|
+
export type MicrotransactionRefundStatus = 'requested' | 'linked' | 'unknown' | 'pending' | 'submitted' | 'succeeded' | 'failed' | 'canceled';
|
|
9
|
+
export type MicrotransactionDeliveryStatus = 'pending' | 'retrying' | 'processing' | 'acknowledged' | 'failed' | 'superseded';
|
|
10
|
+
export type MicrotransactionPayoutStatus = 'pending' | 'transferred' | 'bank_paid' | 'bank_pending' | 'bank_failed' | 'transfer_reversed';
|
|
7
11
|
export type MicrotransactionFulfillmentStatus = 'not_ready' | 'pending' | 'delivered' | 'retrying' | 'failed' | 'revoked' | 'partially_recovered';
|
|
8
12
|
export type MicrotransactionAbility = 'commerce:read' | 'commerce:write' | 'commerce:finance' | 'commerce:fulfill';
|
|
9
|
-
export type MicrotransactionErrorCode = 'authentication_required' | 'permission_denied' | '
|
|
13
|
+
export type MicrotransactionErrorCode = 'authentication_required' | 'permission_denied' | 'not_found' | 'not_eligible' | 'quote_expired' | 'already_owned' | 'idempotency_conflict' | 'payment_unknown' | 'rate_limited' | 'invalid_revenue_configuration' | 'fulfillment_pending' | 'provider_unavailable';
|
|
10
14
|
/** The backend's JSON envelope; Axios returns this envelope in response.data. */
|
|
11
15
|
export interface MicrotransactionResponse<T> {
|
|
12
16
|
data: T;
|
|
@@ -29,6 +33,41 @@ export interface MicrotransactionSessionOptions extends MicrotransactionRequestO
|
|
|
29
33
|
export interface MicrotransactionEnvironmentFilter {
|
|
30
34
|
environment?: MicrotransactionEnvironment;
|
|
31
35
|
}
|
|
36
|
+
/** Catalog discovery defaults to 200 records per page; absence on page one is not proof a SKU is unused. */
|
|
37
|
+
export interface MicrotransactionProductListFilters {
|
|
38
|
+
page?: number;
|
|
39
|
+
per_page?: number;
|
|
40
|
+
status?: MicrotransactionProductStatus;
|
|
41
|
+
/** Exact SKU, not a substring search. */
|
|
42
|
+
sku?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Administrative lists default to page 1 / 25 records and are scoped to the authorized title. */
|
|
45
|
+
export interface MicrotransactionManagementListFilters extends MicrotransactionEnvironmentFilter {
|
|
46
|
+
page?: number;
|
|
47
|
+
per_page?: number;
|
|
48
|
+
status?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface MicrotransactionOrderListFilters extends MicrotransactionManagementListFilters {
|
|
51
|
+
product_id?: string;
|
|
52
|
+
status?: MicrotransactionPaymentStatus;
|
|
53
|
+
payment_status?: MicrotransactionPaymentStatus;
|
|
54
|
+
}
|
|
55
|
+
export interface MicrotransactionRelatedListFilters extends MicrotransactionManagementListFilters {
|
|
56
|
+
order_id?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface MicrotransactionRefundListFilters extends MicrotransactionRelatedListFilters {
|
|
59
|
+
status?: MicrotransactionRefundStatus;
|
|
60
|
+
}
|
|
61
|
+
export interface MicrotransactionDeliveryListFilters extends MicrotransactionRelatedListFilters {
|
|
62
|
+
status?: MicrotransactionDeliveryStatus;
|
|
63
|
+
}
|
|
64
|
+
export interface MicrotransactionPayoutListFilters extends MicrotransactionRelatedListFilters {
|
|
65
|
+
status?: MicrotransactionPayoutStatus;
|
|
66
|
+
}
|
|
67
|
+
/** @deprecated Optional compatibility field only; no confirmation or human-approval gate is enforced. */
|
|
68
|
+
export interface MicrotransactionLegacyConfirmation {
|
|
69
|
+
confirm?: boolean;
|
|
70
|
+
}
|
|
32
71
|
/** Self-only purchase-history filters. Identity comes from authentication, never a user_id argument. */
|
|
33
72
|
export interface MicrotransactionMyPurchasesFilters extends MicrotransactionEnvironmentFilter {
|
|
34
73
|
/** Page number, integer 1–10000. Defaults to 1; ordering is created_at DESC, id DESC. */
|
|
@@ -88,7 +127,7 @@ export interface MicrotransactionProductInput {
|
|
|
88
127
|
starts_at?: string | null;
|
|
89
128
|
ends_at?: string | null;
|
|
90
129
|
max_per_order?: number;
|
|
91
|
-
/**
|
|
130
|
+
/** @deprecated Ignored compatibility field. Title authorization and immutable-data validation remain required. */
|
|
92
131
|
confirm?: boolean;
|
|
93
132
|
}
|
|
94
133
|
export interface MicrotransactionProduct extends Omit<MicrotransactionProductInput, 'confirm' | 'status' | 'media_ids'> {
|
|
@@ -101,19 +140,176 @@ export interface MicrotransactionProduct extends Omit<MicrotransactionProductInp
|
|
|
101
140
|
created_at: string;
|
|
102
141
|
updated_at: string;
|
|
103
142
|
}
|
|
143
|
+
/** Read-only collection facts, not tax exemption or a determination of tax owed. */
|
|
144
|
+
export interface MicrotransactionTaxCollection {
|
|
145
|
+
/** Configured intent stays automatic during a known pending-setup fallback. */
|
|
146
|
+
requested_mode: 'automatic' | 'disabled';
|
|
147
|
+
/** Pending setup may disable collection for a NEW order; unknown facts are null and block new automatic checkout. */
|
|
148
|
+
effective_mode: 'automatic' | 'disabled' | null;
|
|
149
|
+
status: string;
|
|
150
|
+
missing_fields: string[];
|
|
151
|
+
fallback_reason: 'stripe_tax_setup_incomplete' | null;
|
|
152
|
+
warnings: string[];
|
|
153
|
+
}
|
|
104
154
|
export interface MicrotransactionProvider {
|
|
105
|
-
provider:
|
|
155
|
+
provider: MicrotransactionProviderName;
|
|
106
156
|
environment: MicrotransactionEnvironment;
|
|
107
157
|
configured: boolean;
|
|
108
|
-
|
|
158
|
+
/** Actual external provider/account capability, not a manual approval flag. */
|
|
159
|
+
available: boolean;
|
|
160
|
+
enabled: boolean;
|
|
161
|
+
priority: number;
|
|
109
162
|
countries: string[];
|
|
110
163
|
currencies: string[];
|
|
164
|
+
minimum_amounts: Record<string, number>;
|
|
111
165
|
channels: string[];
|
|
112
|
-
|
|
166
|
+
payment_methods: string[];
|
|
167
|
+
configuration: MicrotransactionProviderConfiguration;
|
|
168
|
+
account: {
|
|
169
|
+
id: string;
|
|
170
|
+
country: string | null;
|
|
171
|
+
charges_enabled: boolean;
|
|
172
|
+
payouts_enabled: boolean;
|
|
173
|
+
requirements_due: string[];
|
|
174
|
+
merchant_name?: string | null;
|
|
175
|
+
} | null;
|
|
176
|
+
/** The game's payout target. Do not substitute the platform processing account's payouts_enabled. */
|
|
177
|
+
payout_account: {
|
|
178
|
+
source: 'platform' | 'user' | 'community' | 'managed';
|
|
179
|
+
id: string | null;
|
|
180
|
+
available: boolean;
|
|
181
|
+
country: string | null;
|
|
182
|
+
transfers_active: boolean;
|
|
183
|
+
payouts_enabled: boolean;
|
|
184
|
+
requirements_due: string[];
|
|
185
|
+
reasons: string[];
|
|
186
|
+
};
|
|
187
|
+
tax: {
|
|
188
|
+
status: string;
|
|
189
|
+
missing_fields: string[];
|
|
190
|
+
};
|
|
191
|
+
/** Current route facts only. Never use these to reinterpret an existing order's frozen decision. */
|
|
192
|
+
tax_collection?: MicrotransactionTaxCollection | null;
|
|
193
|
+
/** Non-blocking collection warnings, separate from reasons and payout_account availability. */
|
|
194
|
+
warnings?: string[];
|
|
195
|
+
reasons: string[];
|
|
196
|
+
checked_at: string | null;
|
|
197
|
+
revision?: number;
|
|
198
|
+
}
|
|
199
|
+
export interface MicrotransactionProviderSku {
|
|
200
|
+
/** Provider SKU, 1–100 characters. */
|
|
201
|
+
sku: string;
|
|
202
|
+
currency: MicrotransactionCurrency;
|
|
203
|
+
amount_minor: number;
|
|
204
|
+
}
|
|
205
|
+
export interface MicrotransactionProviderConfiguration {
|
|
206
|
+
/** Requested configuration. Explicit disabled is sandbox-only; pending-setup fallback does not change live configuration to disabled. */
|
|
207
|
+
tax_mode: 'automatic' | 'disabled';
|
|
208
|
+
/** Stripe tax code txcd_ followed by exactly eight digits. */
|
|
209
|
+
tax_code: string | null;
|
|
210
|
+
payout_source: 'platform' | 'user' | 'community' | 'managed';
|
|
211
|
+
/** Xsolla public project ID, 1–20 decimal digits. */
|
|
212
|
+
project_id: string | null;
|
|
213
|
+
/** Maximum 200 mappings. */
|
|
214
|
+
sku_map: Record<string, MicrotransactionProviderSku>;
|
|
215
|
+
}
|
|
216
|
+
/** Developer preferences and an optional new owned Xsolla webhook secret only; never platform credentials, arbitrary payees, or availability facts. */
|
|
217
|
+
export interface MicrotransactionProviderInput extends Partial<MicrotransactionProviderConfiguration>, MicrotransactionLegacyConfirmation {
|
|
218
|
+
environment: MicrotransactionEnvironment;
|
|
219
|
+
enabled?: boolean;
|
|
220
|
+
priority?: number;
|
|
221
|
+
countries?: string[];
|
|
222
|
+
currencies?: MicrotransactionCurrency[];
|
|
223
|
+
minimum_amounts?: Record<string, number>;
|
|
224
|
+
/** Write-only NEW owned Xsolla project secret, 16–512 chars, finance scope. Never a platform API key or MCP token; never returned/logged or put in game code. Existing platform/historical bindings cannot be overwritten. */
|
|
225
|
+
webhook_secret?: string;
|
|
226
|
+
}
|
|
227
|
+
export interface MicrotransactionProviderOnboardingInput extends MicrotransactionLegacyConfirmation {
|
|
228
|
+
environment: MicrotransactionEnvironment;
|
|
229
|
+
country: string;
|
|
230
|
+
/** Stable caller-created key. Reuse with identical input after uncertain retries; never generate inside a retry. */
|
|
231
|
+
idempotency_key: string;
|
|
232
|
+
}
|
|
233
|
+
export interface MicrotransactionProviderOnboarding {
|
|
234
|
+
title_id: string;
|
|
235
|
+
provider: 'stripe';
|
|
236
|
+
environment: MicrotransactionEnvironment;
|
|
237
|
+
account_id: string;
|
|
238
|
+
/** Single-use provider onboarding URL on connect.stripe.com; do not log or persist it. */
|
|
239
|
+
onboarding_url: string;
|
|
240
|
+
expires_at: string;
|
|
241
|
+
status: 'requires_provider_onboarding';
|
|
242
|
+
reused: boolean;
|
|
243
|
+
}
|
|
244
|
+
export interface MicrotransactionDeliverySettings {
|
|
245
|
+
title_id: string;
|
|
246
|
+
environment: MicrotransactionEnvironment;
|
|
247
|
+
enabled: boolean;
|
|
248
|
+
url: string | null;
|
|
249
|
+
signature_algorithm: 'ed25519' | 'hmac-sha256';
|
|
250
|
+
/** Public verification material only. The private signing key never leaves the server. */
|
|
251
|
+
verification_public_key: string | null;
|
|
252
|
+
key_id: string | null;
|
|
253
|
+
revision: number;
|
|
254
|
+
configured: boolean;
|
|
255
|
+
}
|
|
256
|
+
export interface MicrotransactionDeliverySettingsInput extends MicrotransactionLegacyConfirmation {
|
|
257
|
+
environment: MicrotransactionEnvironment;
|
|
258
|
+
enabled?: boolean;
|
|
259
|
+
url?: string | null;
|
|
260
|
+
}
|
|
261
|
+
export interface MicrotransactionDelivery {
|
|
262
|
+
id: string;
|
|
263
|
+
order_id: string;
|
|
264
|
+
event_type: string;
|
|
265
|
+
status: MicrotransactionDeliveryStatus;
|
|
266
|
+
attempts: number;
|
|
267
|
+
next_attempt_at: string | null;
|
|
268
|
+
acknowledged_at: string | null;
|
|
269
|
+
created_at: string;
|
|
270
|
+
updated_at: string;
|
|
271
|
+
}
|
|
272
|
+
/** Replay/acknowledgement return only this safe subset, not the list's timestamps. */
|
|
273
|
+
export type MicrotransactionDeliveryResult = Pick<MicrotransactionDelivery, 'id' | 'order_id' | 'status' | 'event_type' | 'attempts' | 'acknowledged_at'>;
|
|
274
|
+
export interface MicrotransactionRefundRecord {
|
|
275
|
+
id: string;
|
|
276
|
+
order_id: string;
|
|
277
|
+
status: MicrotransactionRefundStatus;
|
|
278
|
+
amount_minor: number;
|
|
279
|
+
reason: string;
|
|
280
|
+
idempotency_key: string | null;
|
|
281
|
+
record_type: 'request' | 'execution';
|
|
282
|
+
execution_refund_id: string | null;
|
|
283
|
+
execution_status: MicrotransactionRefundStatus | null;
|
|
284
|
+
request_resolution: 'linked_to_execution' | 'not_executed' | null;
|
|
285
|
+
order_refunded_minor: number | null;
|
|
286
|
+
failure_code: string | null;
|
|
287
|
+
created_at: string;
|
|
288
|
+
updated_at: string;
|
|
289
|
+
}
|
|
290
|
+
export interface MicrotransactionPayout {
|
|
291
|
+
id: string;
|
|
292
|
+
order_id: string;
|
|
293
|
+
status: MicrotransactionPayoutStatus;
|
|
294
|
+
amount_minor: number;
|
|
295
|
+
provider_reference: string | null;
|
|
296
|
+
created_at: string;
|
|
297
|
+
updated_at: string;
|
|
298
|
+
}
|
|
299
|
+
export interface MicrotransactionRefundInput extends MicrotransactionLegacyConfirmation {
|
|
300
|
+
reason: string;
|
|
301
|
+
amount_minor?: number;
|
|
302
|
+
/** REQUIRED stable operation key, scoped to title/order. Reuse identical input on retry; changes conflict. */
|
|
303
|
+
idempotency_key: string;
|
|
113
304
|
}
|
|
114
305
|
export interface MicrotransactionReadiness {
|
|
115
306
|
status: 'disabled' | 'draft' | 'sandbox' | 'ready' | 'live' | 'degraded' | 'suspended';
|
|
307
|
+
/** Configuration readiness only; not proof of payment, delivery, claim or browser 3DS. */
|
|
116
308
|
ready: boolean;
|
|
309
|
+
/** Optional on older backends; retains the same configuration meaning as ready. */
|
|
310
|
+
configuration_ready?: boolean;
|
|
311
|
+
/** Stored sandbox paid + fulfilled + claimed evidence. Absent means unknown; not browser/3DS certification. */
|
|
312
|
+
integration_verified?: boolean;
|
|
117
313
|
blockers: string[];
|
|
118
314
|
providers: MicrotransactionProvider[];
|
|
119
315
|
commission_basis_points: 1200;
|
|
@@ -133,8 +329,9 @@ export interface MicrotransactionSettingsInput {
|
|
|
133
329
|
currencies?: MicrotransactionCurrency[];
|
|
134
330
|
branding?: Omit<MicrotransactionBranding, 'logo_media'>;
|
|
135
331
|
support_email?: string | null;
|
|
332
|
+
/** @deprecated Legacy delivery alias requiring BOTH commerce:write and commerce:fulfill; prefer updateDeliverySettings/getDeliverySettings. */
|
|
136
333
|
webhook_url?: string | null;
|
|
137
|
-
/**
|
|
334
|
+
/** @deprecated Ignored compatibility field. Authorized title editors save directly; actual provider/sales restrictions remain. */
|
|
138
335
|
confirm?: boolean;
|
|
139
336
|
}
|
|
140
337
|
export interface MicrotransactionSettings extends Omit<Required<MicrotransactionSettingsInput>, 'confirm'> {
|
|
@@ -213,8 +410,17 @@ export interface MicrotransactionOrder {
|
|
|
213
410
|
paid_at: string | null;
|
|
214
411
|
refunded_minor: number;
|
|
215
412
|
items: MicrotransactionGrant[];
|
|
413
|
+
/** Frozen decision, also returned inside checkout/session.order. Null/absent for legacy orders; never infer from current provider facts. Warnings do not imply zero tax owed. */
|
|
414
|
+
tax_collection?: MicrotransactionTaxCollection | null;
|
|
216
415
|
entitlements?: MicrotransactionEntitlement[];
|
|
217
416
|
}
|
|
417
|
+
export interface MicrotransactionOrderDetail extends MicrotransactionOrder {
|
|
418
|
+
/** Optional, permission-scoped management relationships. Omission is not proof no records exist. */
|
|
419
|
+
refunds?: Array<Pick<MicrotransactionRefundRecord, 'id' | 'order_id' | 'status'> & Partial<MicrotransactionRefundRecord>>;
|
|
420
|
+
deliveries?: MicrotransactionDelivery[];
|
|
421
|
+
payouts?: Array<Pick<MicrotransactionPayout, 'id' | 'order_id' | 'status'> & Partial<MicrotransactionPayout>>;
|
|
422
|
+
financial_details_included?: boolean;
|
|
423
|
+
}
|
|
218
424
|
export type MicrotransactionGrantUsageStatus = 'unused' | 'partially_used' | 'used_up' | 'owned' | 'expired' | 'revoked' | 'not_delivered' | 'unavailable';
|
|
219
425
|
/** One purchase's server-calculated grant lot, not the player's aggregate inventory balance. */
|
|
220
426
|
export interface MicrotransactionGrantUsage {
|
|
@@ -365,8 +571,10 @@ export interface MicrotransactionConsumeInput {
|
|
|
365
571
|
}
|
|
366
572
|
export interface MicrotransactionRefund {
|
|
367
573
|
refund_id: string;
|
|
368
|
-
status:
|
|
574
|
+
status: MicrotransactionRefundStatus;
|
|
369
575
|
order_id: string;
|
|
576
|
+
idempotency_key: string;
|
|
577
|
+
failure_code: string | null;
|
|
370
578
|
refund_allocation?: 'pro_rata_all_grants';
|
|
371
579
|
}
|
|
372
580
|
export interface MicrotransactionRefundRequest {
|
|
@@ -389,14 +597,16 @@ export interface MicrotransactionEarnings {
|
|
|
389
597
|
payouts_enabled: boolean;
|
|
390
598
|
reserve_days?: number;
|
|
391
599
|
}
|
|
392
|
-
export type MicrotransactionOperation = 'settings.get' | 'settings.update' | 'products.list' | 'products.create' | 'products.update' | 'products.archive' | 'providers.list' | 'readiness.get' | 'orders.list' | 'orders.get' | 'earnings.get' | 'refunds.request' | 'deliveries.replay' | 'integration.get' | 'integration.verify';
|
|
600
|
+
export type MicrotransactionOperation = 'settings.get' | 'settings.update' | 'products.list' | 'products.create' | 'products.update' | 'products.archive' | 'providers.list' | 'providers.update' | 'providers.refresh' | 'providers.onboarding' | 'readiness.get' | 'orders.list' | 'orders.get' | 'orders.reconcile' | 'earnings.get' | 'refunds.list' | 'refunds.get' | 'refunds.create' | 'refunds.request' | 'refunds.reconcile' | 'delivery.settings.get' | 'delivery.settings.update' | 'deliveries.list' | 'deliveries.replay' | 'deliveries.acknowledge' | 'payouts.list' | 'integration.get' | 'integration.verify';
|
|
393
601
|
export interface MicrotransactionOperationCapability {
|
|
394
602
|
operation: MicrotransactionOperation;
|
|
395
603
|
description: string;
|
|
396
604
|
ability: MicrotransactionAbility;
|
|
397
605
|
input_schema: Record<string, unknown>;
|
|
398
|
-
|
|
399
|
-
|
|
606
|
+
http_method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
607
|
+
mutates: boolean;
|
|
608
|
+
requires_confirmation: false;
|
|
609
|
+
requires_human_approval: false;
|
|
400
610
|
examples: Array<Record<string, unknown>>;
|
|
401
611
|
output_description: string;
|
|
402
612
|
}
|
|
@@ -407,8 +617,9 @@ export interface MicrotransactionCapabilities {
|
|
|
407
617
|
[key: string]: unknown;
|
|
408
618
|
}
|
|
409
619
|
/**
|
|
410
|
-
* Provider-neutral, title-scoped commerce.
|
|
411
|
-
*
|
|
620
|
+
* Provider-neutral, title-scoped commerce. Guest games configure only the API
|
|
621
|
+
* base URL, never global account/admin auth. Hosted account pages use their own
|
|
622
|
+
* user JWT and limited checkout capability; playerToken overrides auth per request. Install/title
|
|
412
623
|
* tokens cannot authorize money, ownership, refunds, or catalog changes.
|
|
413
624
|
*
|
|
414
625
|
* Each result preserves payment versus fulfillment versus settlement. Redirects
|
|
@@ -428,49 +639,85 @@ declare class Microtransactions {
|
|
|
428
639
|
static settings(title_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionSettings>>;
|
|
429
640
|
/** Atomic policy update. Sandbox/off by default. Cannot disable the final working revenue model. */
|
|
430
641
|
static updateSettings(title_id: string, data: MicrotransactionSettingsInput, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionSettings>>;
|
|
431
|
-
/** Read-only country/provider
|
|
642
|
+
/** Read-only current country/provider capability and revenue readiness; never fabricates availability. */
|
|
432
643
|
static readiness(title_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionReadiness>>;
|
|
433
|
-
/**
|
|
644
|
+
/** Paginated admin catalog including drafts/archives. Default 200, per_page 1–200/page 1–10000. Use exact sku to resolve uncertain creates. */
|
|
645
|
+
static listProducts(title_id: string, params?: MicrotransactionProductListFilters, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<{
|
|
646
|
+
products: MicrotransactionProduct[];
|
|
647
|
+
pagination: MicrotransactionPurchasePagination;
|
|
648
|
+
}>>;
|
|
649
|
+
/** @deprecated Compatibility overload for the earlier second-argument request options. */
|
|
434
650
|
static listProducts(title_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<{
|
|
435
651
|
products: MicrotransactionProduct[];
|
|
652
|
+
pagination: MicrotransactionPurchasePagination;
|
|
436
653
|
}>>;
|
|
437
654
|
/** Save a catalog product. Prices use integer minor units and attached media must belong to the title. */
|
|
438
655
|
static createProduct(title_id: string, data: MicrotransactionProductInput, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionProduct>>;
|
|
439
656
|
/** Update a product version. Existing order snapshots remain unchanged. */
|
|
440
657
|
static updateProduct(title_id: string, product_id: string, data: Partial<MicrotransactionProductInput>, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionProduct>>;
|
|
441
|
-
/**
|
|
442
|
-
static archiveProduct(title_id: string, product_id: string, data:
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
658
|
+
/** Direct authorized archive. Never deletes financial history or bypasses the last-revenue-model rule. */
|
|
659
|
+
static archiveProduct(title_id: string, product_id: string, data?: MicrotransactionLegacyConfirmation, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionProduct>>;
|
|
660
|
+
/** Actual provider configuration/capability facts; no credentials or manual approval flag. */
|
|
661
|
+
static providers(title_id: string, params?: MicrotransactionEnvironmentFilter, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<{
|
|
662
|
+
providers: MicrotransactionProvider[];
|
|
663
|
+
}>>;
|
|
664
|
+
/** @deprecated Compatibility overload for the earlier second-argument request options. */
|
|
446
665
|
static providers(title_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<{
|
|
447
666
|
providers: MicrotransactionProvider[];
|
|
448
667
|
}>>;
|
|
668
|
+
/** Direct commerce:finance configuration. Saving preferences does not fabricate external capability; inspect available/reasons. */
|
|
669
|
+
static updateProvider(title_id: string, provider: MicrotransactionProviderName, data: MicrotransactionProviderInput, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionProvider>>;
|
|
670
|
+
/** Refresh authenticated external provider facts. May update cached state; never creates a payment or invents eligibility. */
|
|
671
|
+
static refreshProvider(title_id: string, provider: MicrotransactionProviderName, data: {
|
|
672
|
+
environment: MicrotransactionEnvironment;
|
|
673
|
+
}, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionProvider>>;
|
|
674
|
+
/** Start/reuse owned Stripe Connect onboarding with one stable key. Provider KYC is factual setup, not a Glitch approval workflow. */
|
|
675
|
+
static createProviderOnboarding(title_id: string, data: MicrotransactionProviderOnboardingInput, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionProviderOnboarding>>;
|
|
676
|
+
/** Read title/environment delivery settings and the Ed25519 PUBLIC verification key. */
|
|
677
|
+
static getDeliverySettings(title_id: string, params?: MicrotransactionEnvironmentFilter, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionDeliverySettings>>;
|
|
678
|
+
/** Direct commerce:fulfill setup. Private/metadata network targets and private-key inputs remain forbidden. */
|
|
679
|
+
static updateDeliverySettings(title_id: string, data: MicrotransactionDeliverySettingsInput, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionDeliverySettings>>;
|
|
680
|
+
/** Discover safe event IDs/statuses before replay or acknowledge. Page 1–10000, per_page 1–100, default 25. */
|
|
681
|
+
static listDeliveries(title_id: string, params?: MicrotransactionDeliveryListFilters, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<{
|
|
682
|
+
deliveries: MicrotransactionDelivery[];
|
|
683
|
+
pagination: MicrotransactionPurchasePagination;
|
|
684
|
+
}>>;
|
|
685
|
+
/** Financially scoped refund operation discovery; pending/unknown is not completed. */
|
|
686
|
+
static listRefunds(title_id: string, params?: MicrotransactionRefundListFilters, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<{
|
|
687
|
+
refunds: MicrotransactionRefundRecord[];
|
|
688
|
+
pagination: MicrotransactionPurchasePagination;
|
|
689
|
+
}>>;
|
|
690
|
+
/** Inspect one same-title refund operation. */
|
|
691
|
+
static getRefund(title_id: string, refund_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionRefundRecord>>;
|
|
692
|
+
/** Query/retry the original persisted refund with its existing identity, never generate a new refund key. */
|
|
693
|
+
static reconcileRefund(title_id: string, refund_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionRefundRecord>>;
|
|
694
|
+
/** Discover provider transfer/payout records; transferred funds are not automatically a verified bank payout. */
|
|
695
|
+
static listPayouts(title_id: string, params?: MicrotransactionPayoutListFilters, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<{
|
|
696
|
+
payouts: MicrotransactionPayout[];
|
|
697
|
+
pagination: MicrotransactionPurchasePagination;
|
|
698
|
+
}>>;
|
|
449
699
|
/** Admin read of separate-currency balances; pending is not withdrawable revenue. */
|
|
450
700
|
static earnings(title_id: string, params?: MicrotransactionEnvironmentFilter, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionEarnings>>;
|
|
451
|
-
/** Admin
|
|
452
|
-
static listOrders(title_id: string, params?:
|
|
701
|
+
/** Admin paginated redacted orders. Page 1–10000/per_page 1–100 (default 25); own-player history is separate. */
|
|
702
|
+
static listOrders(title_id: string, params?: MicrotransactionOrderListFilters, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<{
|
|
453
703
|
orders: MicrotransactionOrder[];
|
|
704
|
+
pagination: MicrotransactionPurchasePagination;
|
|
454
705
|
}>>;
|
|
455
706
|
/** Owner JWT/scoped player token or title admin. An arbitrary order UUID grants no access. */
|
|
456
|
-
static getOrder(title_id: string, order_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<
|
|
457
|
-
/**
|
|
458
|
-
static
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
amount_minor?: number;
|
|
462
|
-
}, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionRefund>>;
|
|
707
|
+
static getOrder(title_id: string, order_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionOrderDetail>>;
|
|
708
|
+
/** Financially scoped original-provider reconciliation. Does not reroute or start a different purchase. */
|
|
709
|
+
static reconcileOrder(title_id: string, order_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionOrderDetail>>;
|
|
710
|
+
/** Direct commerce:finance refund. REQUIRED stable idempotency_key; omission is an error, never auto-filled. Same-key changed input conflicts. */
|
|
711
|
+
static refundOrder(title_id: string, order_id: string, data: MicrotransactionRefundInput, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionRefund>>;
|
|
463
712
|
/** Replay the same immutable event. Receiver must deduplicate event_id. This cannot mint goods. */
|
|
464
|
-
static replayDelivery(title_id: string, delivery_id: string, data:
|
|
465
|
-
|
|
466
|
-
}, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<Record<string, unknown>>>;
|
|
467
|
-
/** Public eligible catalog. Sandbox is restricted by backend environment/admin policy. */
|
|
713
|
+
static replayDelivery(title_id: string, delivery_id: string, data?: MicrotransactionLegacyConfirmation, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionDeliveryResult>>;
|
|
714
|
+
/** Guest catalog on the exact approved game Origin. Sandbox requires enabled sandbox settings; the backend enforces environment policy. */
|
|
468
715
|
static catalog(title_id: string, params?: MicrotransactionCatalogFilter, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionCatalog>>;
|
|
469
716
|
/** User-authenticated quote. Clients select product/quantity, never monetary values or seller accounts. */
|
|
470
717
|
static createQuote(title_id: string, data: MicrotransactionPurchaseInput, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionQuote>>;
|
|
471
|
-
/**
|
|
718
|
+
/** Guest opening only: browser Origin must equal approved return_origin. Inherits configured global auth; use an isolated credential-free game context. Hosted UI authenticates before payment. */
|
|
472
719
|
static createCheckoutSession(title_id: string, data: MicrotransactionCheckoutSessionInput, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionCreatedCheckoutSession>>;
|
|
473
|
-
/**
|
|
720
|
+
/** Guest entry to hosted recovery, not inventory access. Exact approved Origin/return_origin required. Owning-account bind remains mandatory, including when commerce is off. Never install an account JWT in the game. */
|
|
474
721
|
static createRestoreSession(title_id: string, data: {
|
|
475
722
|
return_origin: string;
|
|
476
723
|
nonce: string;
|
|
@@ -506,7 +753,7 @@ declare class Microtransactions {
|
|
|
506
753
|
/** Record integration proof from a genuinely paid, fulfilled sandbox order with a claimed game handoff. */
|
|
507
754
|
static verifyIntegration(title_id: string, data: {
|
|
508
755
|
order_id: string;
|
|
509
|
-
confirm
|
|
756
|
+
confirm?: boolean;
|
|
510
757
|
}, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionReadiness>>;
|
|
511
758
|
/** Restore authoritative durable ownership/current consumable balances, never mutable cloud-save balances. */
|
|
512
759
|
static listEntitlements(title_id: string, params?: MicrotransactionEnvironmentFilter, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<{
|
|
@@ -538,10 +785,10 @@ declare class Microtransactions {
|
|
|
538
785
|
/** Trusted title server with commerce:fulfill or admin JWT acknowledges the immutable event. */
|
|
539
786
|
static acknowledgeDelivery(title_id: string, delivery_id: string, data: {
|
|
540
787
|
event_id: string;
|
|
541
|
-
}, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<
|
|
542
|
-
/** Title MCP token, never a runtime install token. Describes
|
|
788
|
+
}, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionDeliveryResult>>;
|
|
789
|
+
/** Title MCP token, never a runtime install token. Describes arguments, abilities, mutation semantics and provider facts. */
|
|
543
790
|
static mcpCapabilities(title_id: string, options?: MicrotransactionRequestOptions): AxiosPromise<MicrotransactionResponse<MicrotransactionCapabilities>>;
|
|
544
|
-
/** Execute
|
|
791
|
+
/** Execute a discovered authorized operation directly. Legacy confirm is ignored and not forwarded. */
|
|
545
792
|
static mcpOperation<T = Record<string, unknown>>(title_id: string, operation: MicrotransactionOperation, data: {
|
|
546
793
|
arguments: Record<string, unknown>;
|
|
547
794
|
confirm?: boolean;
|