@mpgd/platform 0.17.0 → 0.18.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/dist/index.d.ts +15 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,15 @@ export declare class PlatformOperationError extends Error implements PlatformOpe
|
|
|
47
47
|
}>);
|
|
48
48
|
}
|
|
49
49
|
export declare function readPlatformOperationFailure(error: unknown): PlatformOperationFailure | null;
|
|
50
|
+
/**
|
|
51
|
+
* Stable, non-sensitive reason attached to a commerce outcome that did not
|
|
52
|
+
* fully complete. It is diagnostic only: it never grants or revokes anything.
|
|
53
|
+
* Games may use it for UI copy, retry decisions and support logs.
|
|
54
|
+
*/
|
|
55
|
+
export interface CommerceDiagnostic extends PlatformOperationFailure {
|
|
56
|
+
/** Provider SDK error code, passed through only when it is a safe identifier. */
|
|
57
|
+
readonly providerCode?: string;
|
|
58
|
+
}
|
|
50
59
|
export interface PurchaseResult {
|
|
51
60
|
readonly status: 'completed' | 'cancelled' | 'pending' | 'failed';
|
|
52
61
|
readonly transactionId?: string;
|
|
@@ -57,11 +66,15 @@ export interface PurchaseResult {
|
|
|
57
66
|
readonly ledgerEntryId: string;
|
|
58
67
|
readonly alreadyProcessed?: boolean;
|
|
59
68
|
}>;
|
|
69
|
+
/** Optional reason for a cancelled, pending or failed result. */
|
|
70
|
+
readonly diagnostic?: CommerceDiagnostic;
|
|
60
71
|
}
|
|
61
72
|
export interface PurchaseRestoreResult {
|
|
62
73
|
readonly restoredEntitlements: readonly Entitlement[];
|
|
63
74
|
/** Server-confirmed consumable outcomes; native order visibility alone is not a grant. */
|
|
64
75
|
readonly settledPurchases?: readonly PurchaseSettlement[];
|
|
76
|
+
/** Present when restore finished only partially, for example with orders still unresolved. */
|
|
77
|
+
readonly diagnostic?: CommerceDiagnostic;
|
|
65
78
|
}
|
|
66
79
|
export interface PurchaseSettlement {
|
|
67
80
|
readonly transactionId: string;
|
|
@@ -69,6 +82,8 @@ export interface PurchaseSettlement {
|
|
|
69
82
|
readonly status: 'granted' | 'refunded';
|
|
70
83
|
readonly ledgerEntryId?: string;
|
|
71
84
|
readonly alreadyProcessed?: boolean;
|
|
85
|
+
/** Client purchase idempotency key the order was started with, when the adapter can link it. */
|
|
86
|
+
readonly idempotencyKey?: string;
|
|
72
87
|
}
|
|
73
88
|
/**
|
|
74
89
|
* Resolve a specific purchase from authoritative checkout or restore evidence.
|
package/package.json
CHANGED