capacitor-plugin-cdv-purchase 13.14.0 → 13.15.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.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["esm/index.js","../build/entry.mjs"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n// Set the marker so the shared store.js knows Capacitor native bridges are available\nif (typeof window !== 'undefined') {\n window.CdvPurchaseCapacitor = { installed: true };\n}\nconst PurchasePlugin = registerPlugin('PurchasePlugin');\nexport { PurchasePlugin };\n","// Capacitor bridge — sets CdvPurchaseCapacitor marker and registers native plugin\nexport { PurchasePlugin } from '../dist/esm/index.js';\n\n// Store runtime — executes the IIFE, creates window.CdvPurchase\nimport { CdvPurchase } from 'virtual:store-js';\n\n// Re-export the full namespace\nexport { CdvPurchase };\n\n// Convenience named exports\nexport const store = CdvPurchase.store;\nexport const Store = CdvPurchase.Store;\nexport const ProductType = CdvPurchase.ProductType;\nexport const Platform = CdvPurchase.Platform;\nexport const LogLevel = CdvPurchase.LogLevel;\nexport const ErrorCode = CdvPurchase.ErrorCode;\nexport const Logger = CdvPurchase.Logger;\nexport const Iaptic = CdvPurchase.Iaptic;\n"],"names":[],"mappings":";;AACA;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACnC,IAAI,MAAM,CAAC,oBAAoB,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE;AACrD;AACK,MAAC,cAAc,GAAG,cAAc,CAAC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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LtD;;AASA;AACY,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,WAAW,GAAG,WAAW,CAAC;AAC3B,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,SAAS,GAAG,WAAW,CAAC;AACzB,MAAC,MAAM,GAAG,WAAW,CAAC;AACtB,MAAC,MAAM,GAAG,WAAW,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["esm/index.js","../build/entry.mjs"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n// Set the marker so the shared store.js knows Capacitor native bridges are available\nif (typeof window !== 'undefined') {\n window.CdvPurchaseCapacitor = { installed: true };\n}\nconst PurchasePlugin = registerPlugin('PurchasePlugin');\nexport { PurchasePlugin };\n","// Capacitor bridge — sets CdvPurchaseCapacitor marker and registers native plugin\nexport { PurchasePlugin } from '../dist/esm/index.js';\n\n// Store runtime — executes the IIFE, creates window.CdvPurchase\nimport { CdvPurchase } from 'virtual:store-js';\n\n// Re-export the full namespace\nexport { CdvPurchase };\n\n// Convenience named exports\nexport const store = CdvPurchase.store;\nexport const Store = CdvPurchase.Store;\nexport const ProductType = CdvPurchase.ProductType;\nexport const Platform = CdvPurchase.Platform;\nexport const LogLevel = CdvPurchase.LogLevel;\nexport const ErrorCode = CdvPurchase.ErrorCode;\nexport const Logger = CdvPurchase.Logger;\nexport const Iaptic = CdvPurchase.Iaptic;\n"],"names":[],"mappings":";;AACA;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACnC,IAAI,MAAM,CAAC,oBAAoB,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE;AACrD;AACK,MAAC,cAAc,GAAG,cAAc,CAAC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLtD;;AASA;AACY,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,WAAW,GAAG,WAAW,CAAC;AAC3B,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,SAAS,GAAG,WAAW,CAAC;AACzB,MAAC,MAAM,GAAG,WAAW,CAAC;AACtB,MAAC,MAAM,GAAG,WAAW,CAAC;;;;"}
@@ -26,6 +26,7 @@ public class PurchasePlugin: CAPPlugin, CAPBridgedPlugin {
26
26
  CAPPluginMethod(name: "presentCodeRedemptionSheet", returnType: CAPPluginReturnPromise),
27
27
  CAPPluginMethod(name: "refreshReceipts", returnType: CAPPluginReturnPromise),
28
28
  CAPPluginMethod(name: "loadReceipts", returnType: CAPPluginReturnPromise),
29
+ CAPPluginMethod(name: "getStorefront", returnType: CAPPluginReturnPromise),
29
30
  ]
30
31
 
31
32
  private var _sk2State: AnyObject?
@@ -142,7 +143,8 @@ public class PurchasePlugin: CAPPlugin, CAPBridgedPlugin {
142
143
  call.reject("productId is required")
143
144
  return
144
145
  }
145
- debugLog("purchase: \(productId)")
146
+ let quantity = call.getInt("quantity") ?? 1
147
+ debugLog("purchase: \(productId) quantity:\(quantity)")
146
148
 
147
149
  guard let product = sk2.products[productId] else {
148
150
  call.reject("Product not loaded: \(productId)")
@@ -156,6 +158,9 @@ public class PurchasePlugin: CAPPlugin, CAPBridgedPlugin {
156
158
  options.insert(.appAccountToken(
157
159
  UUID(uuidString: username) ?? UUID()))
158
160
  }
161
+ if quantity > 1 {
162
+ options.insert(.quantity(quantity))
163
+ }
159
164
 
160
165
  let result = try await product.purchase(options: options)
161
166
  switch result {
@@ -217,6 +222,7 @@ public class PurchasePlugin: CAPPlugin, CAPBridgedPlugin {
217
222
  "state": "PaymentTransactionStateFinished",
218
223
  "transactionIdentifier": transactionId,
219
224
  "productId": transaction.productID,
225
+ "quantity": transaction.purchasedQuantity,
220
226
  ])
221
227
  }
222
228
  call.resolve()
@@ -313,6 +319,18 @@ public class PurchasePlugin: CAPPlugin, CAPBridgedPlugin {
313
319
  refreshReceipts(call)
314
320
  }
315
321
 
322
+ @objc func getStorefront(_ call: CAPPluginCall) {
323
+ // SKPaymentQueue.storefront is a StoreKit 1 API available from iOS 13,
324
+ // which matches the plugin's minimum deployment target.
325
+ if let storefront = SKPaymentQueue.default().storefront {
326
+ debugLog("getStorefront: \(storefront.countryCode)")
327
+ call.resolve(["countryCode": storefront.countryCode])
328
+ } else {
329
+ debugLog("getStorefront: storefront not available")
330
+ call.reject("Storefront not available")
331
+ }
332
+ }
333
+
316
334
  // MARK: - Helpers
317
335
 
318
336
  @available(iOS 15.0, *)
@@ -326,6 +344,7 @@ public class PurchasePlugin: CAPPlugin, CAPBridgedPlugin {
326
344
  "state": state,
327
345
  "transactionIdentifier": transactionId,
328
346
  "productId": transaction.productID,
347
+ "quantity": transaction.purchasedQuantity,
329
348
  ]
330
349
 
331
350
  if let errorCode = errorCode { data["errorCode"] = errorCode }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-plugin-cdv-purchase",
3
- "version": "13.14.0",
3
+ "version": "13.15.0",
4
4
  "description": "In-App Purchases for Capacitor — iOS (StoreKit 2) and Android (Google Play Billing)",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/www/store.d.ts CHANGED
@@ -442,6 +442,8 @@ declare namespace CdvPurchase {
442
442
  getApplicationUsername: () => string | undefined;
443
443
  /** Functions used to decorate the API */
444
444
  apiDecorators: ProductDecorator & TransactionDecorator & OfferDecorator & ReceiptDecorator;
445
+ /** Collection of per-platform storefront values. */
446
+ readonly storefronts: Storefronts;
445
447
  }
446
448
  /**
447
449
  * The list of active platform adapters
@@ -507,6 +509,51 @@ declare namespace CdvPurchase {
507
509
  }
508
510
  }
509
511
  }
512
+ declare namespace CdvPurchase {
513
+ namespace Internal {
514
+ /**
515
+ * Collection of per-platform storefront country codes.
516
+ *
517
+ * Maintains the cached value for each platform that exposes one and
518
+ * notifies listeners when a value changes. Adapter-agnostic — callers
519
+ * are responsible for validating that a platform has a ready adapter.
520
+ */
521
+ class Storefronts {
522
+ /** Cached country code per platform. */
523
+ private values;
524
+ /** Registered change listeners. */
525
+ private callbacks;
526
+ constructor(logger: Logger);
527
+ /**
528
+ * Refresh the cached value for a given adapter.
529
+ *
530
+ * The returned promise:
531
+ * - resolves when the adapter responds within `timeoutMs`
532
+ * - rejects with a timeout error otherwise
533
+ *
534
+ * Regardless of timeout, if the adapter eventually yields a value,
535
+ * the cache is silently updated and listeners are notified.
536
+ * A failed or empty response never overwrites the cache.
537
+ */
538
+ refreshWith(adapter: Adapter, timeoutMs?: number): Promise<void>;
539
+ /**
540
+ * Retrieve a storefront value.
541
+ *
542
+ * - With a platform: always returns `{ platform, countryCode }`,
543
+ * where `countryCode` may be undefined if nothing is cached.
544
+ * - Without a platform: returns the first cached non-empty
545
+ * storefront, or `undefined` if nothing is cached.
546
+ */
547
+ getValueFor(platform?: Platform): Storefront | undefined;
548
+ /** Register a change listener. */
549
+ listen(cb: Callback<Storefront>, callbackName?: string): void;
550
+ /** Remove a previously registered listener. */
551
+ off(cb: Callback<Storefront>): void;
552
+ /** Update the cache and notify listeners on change. */
553
+ private setValue;
554
+ }
555
+ }
556
+ }
510
557
  declare namespace CdvPurchase {
511
558
  namespace Internal {
512
559
  interface StoreAdapterDelegate {
@@ -817,7 +864,7 @@ declare namespace CdvPurchase {
817
864
  /**
818
865
  * Current release number of the plugin.
819
866
  */
820
- const PLUGIN_VERSION = "13.14.0";
867
+ const PLUGIN_VERSION = "13.15.0";
821
868
  /**
822
869
  * Entry class of the plugin.
823
870
  */
@@ -935,6 +982,8 @@ declare namespace CdvPurchase {
935
982
  private receiptsVerifiedCallbacks;
936
983
  /** Callbacks for errors */
937
984
  private errorCallbacks;
985
+ /** Per-platform storefront cache and change notifications. */
986
+ private _storefronts;
938
987
  /** Internal implementation of the receipt validation service integration */
939
988
  private _validator;
940
989
  /** Monitor state changes for transactions */
@@ -1168,6 +1217,29 @@ declare namespace CdvPurchase {
1168
1217
  * store.manageBilling(purchase.platform);
1169
1218
  */
1170
1219
  manageBilling(platform?: Platform): Promise<IError | undefined>;
1220
+ /**
1221
+ * Retrieve the billing country code from the platform's storefront.
1222
+ *
1223
+ * Returns a `Storefront` object with the platform and its ISO 3166-1
1224
+ * alpha-2 country code (e.g., "US", "FR"). The country code may be
1225
+ * undefined if the underlying fetch has not yet completed or failed —
1226
+ * the platform is still reported. Returns `undefined` only when no
1227
+ * matching adapter is ready.
1228
+ *
1229
+ * The cache is populated before the `storeReady` event fires (with a
1230
+ * best-effort timeout), and refreshed after orders and `restorePurchases()`.
1231
+ *
1232
+ * @param platform - Optional platform. If omitted, returns the first
1233
+ * cached non-empty storefront, or a `{ platform, countryCode: undefined }`
1234
+ * object for the first ready adapter.
1235
+ *
1236
+ * @example
1237
+ * const storefront = store.getStorefront();
1238
+ * if (storefront?.countryCode) {
1239
+ * console.log(`Billing country: ${storefront.countryCode}`);
1240
+ * }
1241
+ */
1242
+ getStorefront(platform?: Platform): Storefront | undefined;
1171
1243
  /**
1172
1244
  * The default payment platform to use depending on the OS.
1173
1245
  *
@@ -1385,6 +1457,31 @@ declare namespace CdvPurchase {
1385
1457
  * Might ask the user to login.
1386
1458
  */
1387
1459
  restorePurchases(): Promise<IError | undefined>;
1460
+ /**
1461
+ * Retrieve the billing country code from the platform's storefront.
1462
+ *
1463
+ * Returns an ISO 3166-1 alpha-2 country code (e.g., "US", "FR"),
1464
+ * or undefined if the storefront information is not available.
1465
+ */
1466
+ getStorefront?(): Promise<string | undefined>;
1467
+ }
1468
+ /**
1469
+ * A storefront country code, scoped to a specific payment platform.
1470
+ *
1471
+ * Returned from {@link Store.getStorefront} and passed to
1472
+ * `when().storefrontUpdated()` listeners.
1473
+ */
1474
+ interface Storefront {
1475
+ /** The platform this storefront belongs to. */
1476
+ readonly platform: Platform;
1477
+ /**
1478
+ * ISO 3166-1 alpha-2 country code (e.g., "US", "FR").
1479
+ *
1480
+ * Undefined if the value has not been fetched yet, or if the fetch
1481
+ * failed. Never set to a falsy value once populated — a later failed
1482
+ * refresh will preserve the previously-known country code.
1483
+ */
1484
+ readonly countryCode?: string;
1388
1485
  }
1389
1486
  /**
1390
1487
  * Data to attach to a transaction.
@@ -1395,6 +1492,15 @@ declare namespace CdvPurchase {
1395
1492
  interface AdditionalData {
1396
1493
  /** The application's user identifier, will be obfuscated with md5 to fill `accountId` if necessary */
1397
1494
  applicationUsername?: string;
1495
+ /**
1496
+ * Quantity of items to purchase.
1497
+ *
1498
+ * Only supported on platforms that report the `'orderQuantity'` capability.
1499
+ * Platforms without support will ignore this field.
1500
+ *
1501
+ * @see {@link Store.checkSupport}
1502
+ */
1503
+ quantity?: number;
1398
1504
  /** GooglePlay specific additional data */
1399
1505
  googlePlay?: GooglePlay.AdditionalData;
1400
1506
  /** Braintree specific additional data */
@@ -1424,7 +1530,7 @@ declare namespace CdvPurchase {
1424
1530
  *
1425
1531
  * @see {@link Store.checkSupport}
1426
1532
  */
1427
- type PlatformFunctionality = 'requestPayment' | 'order' | 'manageSubscriptions' | 'manageBilling';
1533
+ type PlatformFunctionality = 'requestPayment' | 'order' | 'orderQuantity' | 'manageSubscriptions' | 'manageBilling' | 'getStorefront';
1428
1534
  /**
1429
1535
  * Possible states of a transaction.
1430
1536
  *
@@ -1482,6 +1588,16 @@ declare namespace CdvPurchase {
1482
1588
  * If no platforms have any receipts (user made no purchase), this will also get called.
1483
1589
  */
1484
1590
  receiptsVerified(cb: Callback<void>, callbackName?: string): When;
1591
+ /**
1592
+ * Register a function called when a platform's storefront country code changes.
1593
+ *
1594
+ * Fires when a platform's cached value transitions to a different non-empty
1595
+ * string. Does not fire for no-op refreshes, failed refreshes, or transitions
1596
+ * to undefined (the cache preserves the last-known value).
1597
+ *
1598
+ * @param cb - Callback invoked with the updated {@link Storefront}
1599
+ */
1600
+ storefrontUpdated(cb: Callback<Storefront>, callbackName?: string): When;
1485
1601
  }
1486
1602
  /** Whether or not the user intends to let the subscription auto-renew. */
1487
1603
  enum RenewalIntent {
@@ -1834,8 +1950,9 @@ declare namespace CdvPurchase {
1834
1950
  * For consumable products, this value represents the number of items purchased.
1835
1951
  * For non-consumable products and subscriptions, this value is always 1.
1836
1952
  *
1837
- * This is only supported on Android (Google Play) platform when using the multi-quantity purchase feature.
1838
- * On other platforms, the quantity is always 1.
1953
+ * Supported on Android (Google Play) and iOS (Apple AppStore).
1954
+ * Use `additionalData.quantity` when placing an order
1955
+ * to purchase multiple units in a single transaction.
1839
1956
  */
1840
1957
  quantity?: number;
1841
1958
  /** Purchased products */
@@ -2628,6 +2745,7 @@ declare namespace CdvPurchase {
2628
2745
  checkSupport(functionality: PlatformFunctionality): boolean;
2629
2746
  restorePurchases(): Promise<IError | undefined>;
2630
2747
  presentCodeRedemptionSheet(): Promise<void>;
2748
+ getStorefront(): Promise<string | undefined>;
2631
2749
  }
2632
2750
  }
2633
2751
  }
@@ -2636,8 +2754,8 @@ declare namespace CdvPurchase {
2636
2754
  namespace CapacitorBridge {
2637
2755
  /** Extended callbacks with SK2 fields (same as SK2BridgeCallbacks) */
2638
2756
  interface CapacitorBridgeCallbacks extends Bridge.BridgeCallbacks {
2639
- purchased: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string) => void;
2640
- restored: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string) => void;
2757
+ purchased: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string, quantity?: number) => void;
2758
+ restored: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string, quantity?: number) => void;
2641
2759
  }
2642
2760
  class CapacitorNativeBridge implements Bridge.BridgeInterface {
2643
2761
  appStoreReceipt: ApplicationReceipt | null;
@@ -2667,6 +2785,8 @@ declare namespace CdvPurchase {
2667
2785
  private transactionUpdated;
2668
2786
  private restoreCompletedTransactionsFinished;
2669
2787
  private restoreCompletedTransactionsFailed;
2788
+ /** Retrieve the storefront country code from StoreKit */
2789
+ getStorefront(): Promise<string | undefined>;
2670
2790
  }
2671
2791
  }
2672
2792
  }
@@ -2703,6 +2823,8 @@ declare namespace CdvPurchase {
2703
2823
  presentCodeRedemptionSheet(callback?: Callback<any>): void;
2704
2824
  refreshReceipts(successCb: (receipt: ApplicationReceipt) => void, errorCb: (code: ErrorCode, message: string) => void): void;
2705
2825
  loadReceipts(callback: (receipt: ApplicationReceipt) => void, errorCb: (code: ErrorCode, message: string) => void): void;
2826
+ /** Retrieve the storefront country code (alpha-3 on iOS) */
2827
+ getStorefront?(): Promise<string | undefined>;
2706
2828
  }
2707
2829
  }
2708
2830
  }
@@ -2712,8 +2834,8 @@ declare namespace CdvPurchase {
2712
2834
  namespace SK2Bridge {
2713
2835
  /** Extended callbacks with SK2 fields */
2714
2836
  interface SK2BridgeCallbacks extends Bridge.BridgeCallbacks {
2715
- purchased: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string) => void;
2716
- restored: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string) => void;
2837
+ purchased: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string, quantity?: number) => void;
2838
+ restored: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string, quantity?: number) => void;
2717
2839
  }
2718
2840
  class SK2NativeBridge implements Bridge.BridgeInterface {
2719
2841
  options: SK2BridgeCallbacks;
@@ -2743,11 +2865,13 @@ declare namespace CdvPurchase {
2743
2865
  finalizeTransactionUpdates(): void;
2744
2866
  lastTransactionUpdated(): void;
2745
2867
  /** Called from native. Same as SK1 but with extra SK2 fields. */
2746
- transactionUpdated(state: Bridge.TransactionState, errorCode: ErrorCode | undefined, errorText: string | undefined, transactionIdentifier: string, productId: string, transactionReceipt: never, originalTransactionIdentifier: string | undefined, transactionDate: string | undefined, discountId: string | undefined, expirationDate?: string | undefined, jwsRepresentation?: string | undefined): void;
2868
+ transactionUpdated(state: Bridge.TransactionState, errorCode: ErrorCode | undefined, errorText: string | undefined, transactionIdentifier: string, productId: string, transactionReceipt: never, originalTransactionIdentifier: string | undefined, transactionDate: string | undefined, discountId: string | undefined, expirationDate?: string | undefined, jwsRepresentation?: string | undefined, quantity?: number | undefined): void;
2747
2869
  restoreCompletedTransactionsFinished(): void;
2748
2870
  restoreCompletedTransactionsFailed(errorCode: ErrorCode): void;
2749
2871
  parseReceiptArgs(args: [string, string, string, number, string]): ApplicationReceipt;
2750
2872
  refreshReceipts(successCb: (receipt: ApplicationReceipt) => void, errorCb: (code: ErrorCode, message: string) => void): void;
2873
+ /** Retrieve the storefront country code from StoreKit */
2874
+ getStorefront(): Promise<string | undefined>;
2751
2875
  loadReceipts(callback: (receipt: ApplicationReceipt) => void, errorCb: (code: ErrorCode, message: string) => void): void;
2752
2876
  }
2753
2877
  }
@@ -2865,7 +2989,7 @@ declare namespace CdvPurchase {
2865
2989
  /** Called when the bridge is ready (after setup) */
2866
2990
  ready: () => void;
2867
2991
  /** Called when a transaction is in "Purchased" state */
2868
- purchased: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string) => void;
2992
+ purchased: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string, quantity?: number) => void;
2869
2993
  /** Called when a transaction has been enqueued */
2870
2994
  purchaseEnqueued: (productId: string, quantity: number) => void;
2871
2995
  /**
@@ -2883,7 +3007,7 @@ declare namespace CdvPurchase {
2883
3007
  /** Called when a transaction is in "finished" state */
2884
3008
  finished: (transactionIdentifier: string, productId: string) => void;
2885
3009
  /** Called when a transaction is in "restored" state */
2886
- restored: (transactionIdentifier: string, productId: string) => void;
3010
+ restored: (transactionIdentifier: string, productId: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDate?: string, jwsRepresentation?: string, quantity?: number) => void;
2887
3011
  /** Called when the application receipt is refreshed */
2888
3012
  receiptsRefreshed: (receipt: ApplicationReceipt) => void;
2889
3013
  /** Called when a call to "restore" failed */
@@ -2976,11 +3100,13 @@ declare namespace CdvPurchase {
2976
3100
  finish(transactionId: string, success: () => void, error: (msg: string) => void): void;
2977
3101
  finalizeTransactionUpdates(): void;
2978
3102
  lastTransactionUpdated(): void;
2979
- transactionUpdated(state: TransactionState, errorCode: ErrorCode | undefined, errorText: string | undefined, transactionIdentifier: string, productId: string, transactionReceipt: never, originalTransactionIdentifier: string | undefined, transactionDate: string | undefined, discountId: string | undefined): void;
3103
+ transactionUpdated(state: TransactionState, errorCode: ErrorCode | undefined, errorText: string | undefined, transactionIdentifier: string, productId: string, transactionReceipt: never, originalTransactionIdentifier: string | undefined, transactionDate: string | undefined, discountId: string | undefined, quantity: number | undefined): void;
2980
3104
  restoreCompletedTransactionsFinished(): void;
2981
3105
  restoreCompletedTransactionsFailed(errorCode: ErrorCode): void;
2982
3106
  parseReceiptArgs(args: RawReceiptArgs): ApplicationReceipt;
2983
3107
  refreshReceipts(successCb: (receipt: ApplicationReceipt) => void, errorCb: (code: ErrorCode, message: string) => void): void;
3108
+ /** Retrieve the storefront country code from StoreKit */
3109
+ getStorefront(): Promise<string | undefined>;
2984
3110
  loadReceipts(callback: (receipt: ApplicationReceipt) => void, errorCb: (code: ErrorCode, message: string) => void): void;
2985
3111
  /** @deprecated */
2986
3112
  onPurchased: boolean;
@@ -3064,7 +3190,7 @@ declare namespace CdvPurchase {
3064
3190
  originalTransactionId?: string;
3065
3191
  /** JWS representation of the transaction (StoreKit 2 only) */
3066
3192
  jwsRepresentation?: string;
3067
- refresh(productId?: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDateMs?: string, jwsRepresentation?: string): void;
3193
+ refresh(productId?: string, originalTransactionIdentifier?: string, transactionDate?: string, discountId?: string, expirationDateMs?: string, jwsRepresentation?: string, quantity?: number): void;
3068
3194
  }
3069
3195
  }
3070
3196
  }
@@ -4518,6 +4644,7 @@ declare namespace CdvPurchase {
4518
4644
  requestPayment(payment: PaymentRequest, additionalData?: CdvPurchase.AdditionalData): Promise<IError | Transaction | undefined>;
4519
4645
  manageSubscriptions(): Promise<IError | undefined>;
4520
4646
  manageBilling(): Promise<IError | undefined>;
4647
+ getStorefront(): Promise<string | undefined>;
4521
4648
  checkSupport(functionality: PlatformFunctionality): boolean;
4522
4649
  restorePurchases(): Promise<IError | undefined>;
4523
4650
  }
@@ -4546,6 +4673,7 @@ declare namespace CdvPurchase {
4546
4673
  manageSubscriptions(): void;
4547
4674
  manageBilling(): void;
4548
4675
  launchPriceChangeConfirmationFlow(productId: string): void;
4676
+ getStorefront(success: (countryCode: string) => void, fail: ErrorCallback): void;
4549
4677
  }
4550
4678
  }
4551
4679
  }
@@ -4571,6 +4699,7 @@ declare namespace CdvPurchase {
4571
4699
  manageSubscriptions(): void;
4572
4700
  manageBilling(): void;
4573
4701
  launchPriceChangeConfirmationFlow(productId: string): void;
4702
+ getStorefront(success: (countryCode: string) => void, fail: ErrorCallback): void;
4574
4703
  }
4575
4704
  }
4576
4705
  }
@@ -4808,6 +4937,7 @@ declare namespace CdvPurchase {
4808
4937
  getAvailableProducts(inAppSkus: string[], subsSkus: string[], success: (validProducts: (InAppProduct | Subscription)[]) => void, fail: ErrorCallback): void;
4809
4938
  manageSubscriptions(): void;
4810
4939
  manageBilling(): void;
4940
+ getStorefront(success: (countryCode: string) => void, fail: ErrorCallback): void;
4811
4941
  launchPriceChangeConfirmationFlow(productId: string): void;
4812
4942
  }
4813
4943
  }
@@ -5493,6 +5623,7 @@ declare namespace CdvPurchase {
5493
5623
  static verify(receipt: Receipt, callback: Callback<Internal.ReceiptResponse>): void;
5494
5624
  checkSupport(functionality: PlatformFunctionality): boolean;
5495
5625
  restorePurchases(): Promise<IError | undefined>;
5626
+ getStorefront(): Promise<string | undefined>;
5496
5627
  }
5497
5628
  }
5498
5629
  }
@@ -6366,5 +6497,12 @@ declare namespace CdvPurchase {
6366
6497
  priceConsentStatus?: PriceConsentStatus;
6367
6498
  /** Last time a subscription was renewed. */
6368
6499
  lastRenewalDate?: number;
6500
+ /**
6501
+ * Quantity of items purchased in a single transaction.
6502
+ *
6503
+ * For consumable products, this value represents the number of items purchased.
6504
+ * For non-consumable products and subscriptions, this value is always 1.
6505
+ */
6506
+ quantity?: number;
6369
6507
  }
6370
6508
  }