capacitor-plugin-cdv-purchase 13.14.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.
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Native plugin interface for Capacitor.
3
+ * Defines the methods exposed by the Android and iOS native plugins.
4
+ */
5
+ export interface PurchasePluginPlugin {
6
+ /** Initialize the billing client */
7
+ init(options?: Record<string, unknown>): Promise<void>;
8
+ /** Query available products */
9
+ getAvailableProducts(options: {
10
+ inAppSkus: string[];
11
+ subsSkus: string[];
12
+ }): Promise<{
13
+ products: unknown[];
14
+ }>;
15
+ /** Query existing purchases */
16
+ getPurchases(): Promise<{
17
+ purchases: unknown[];
18
+ }>;
19
+ /** Initiate a purchase flow */
20
+ buy(options: {
21
+ productId: string;
22
+ additionalData?: Record<string, unknown>;
23
+ }): Promise<void>;
24
+ /** Initiate a subscription flow (Android) or purchase (iOS) */
25
+ subscribe(options: {
26
+ productId: string;
27
+ additionalData?: Record<string, unknown>;
28
+ }): Promise<void>;
29
+ /** Finish/acknowledge a transaction */
30
+ finish(options: {
31
+ transactionId: string;
32
+ }): Promise<void>;
33
+ /** Open subscription management UI */
34
+ manageSubscriptions(): Promise<void>;
35
+ /** Open billing management UI */
36
+ manageBilling(): Promise<void>;
37
+ /** Consume a purchase (Android) */
38
+ consumePurchase(options: {
39
+ purchaseToken: string;
40
+ }): Promise<void>;
41
+ /** Acknowledge a purchase (Android) */
42
+ acknowledgePurchase(options: {
43
+ purchaseToken: string;
44
+ }): Promise<void>;
45
+ /** Launch price change confirmation flow (Android) */
46
+ launchPriceChangeConfirmationFlow(options: {
47
+ productId: string;
48
+ }): Promise<void>;
49
+ /** Load product details (iOS) */
50
+ load(options: {
51
+ productIds: string[];
52
+ }): Promise<{
53
+ validProducts: unknown[];
54
+ invalidProductIds: string[];
55
+ }>;
56
+ /** Purchase a product (iOS) */
57
+ purchase(options: {
58
+ productId: string;
59
+ quantity?: number;
60
+ applicationUsername?: string;
61
+ discount?: Record<string, unknown>;
62
+ }): Promise<void>;
63
+ /** Check if the device can make payments (iOS) */
64
+ canMakePayments(): Promise<{
65
+ canMakePayments: boolean;
66
+ }>;
67
+ /** Restore completed transactions (iOS) */
68
+ restore(): Promise<void>;
69
+ /** Present the code redemption sheet (iOS) */
70
+ presentCodeRedemptionSheet(): Promise<void>;
71
+ /** Refresh App Store receipts (iOS) */
72
+ refreshReceipts(): Promise<{
73
+ receipt: unknown;
74
+ }>;
75
+ /** Load App Store receipts (iOS) */
76
+ loadReceipts(): Promise<{
77
+ receipt: unknown;
78
+ }>;
79
+ addListener(eventName: string, listenerFunc: (data: any) => void): Promise<{
80
+ remove: () => Promise<void>;
81
+ }>;
82
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Native plugin interface for Capacitor.
3
+ * Defines the methods exposed by the Android and iOS native plugins.
4
+ */
5
+ export interface PurchasePluginPlugin {
6
+ /** Initialize the billing client */
7
+ init(options?: Record<string, unknown>): Promise<void>;
8
+ /** Query available products */
9
+ getAvailableProducts(options: {
10
+ inAppSkus: string[];
11
+ subsSkus: string[];
12
+ }): Promise<{
13
+ products: unknown[];
14
+ }>;
15
+ /** Query existing purchases */
16
+ getPurchases(): Promise<{
17
+ purchases: unknown[];
18
+ }>;
19
+ /** Initiate a purchase flow */
20
+ buy(options: {
21
+ productId: string;
22
+ additionalData?: Record<string, unknown>;
23
+ }): Promise<void>;
24
+ /** Initiate a subscription flow (Android) or purchase (iOS) */
25
+ subscribe(options: {
26
+ productId: string;
27
+ additionalData?: Record<string, unknown>;
28
+ }): Promise<void>;
29
+ /** Finish/acknowledge a transaction */
30
+ finish(options: {
31
+ transactionId: string;
32
+ }): Promise<void>;
33
+ /** Open subscription management UI */
34
+ manageSubscriptions(): Promise<void>;
35
+ /** Open billing management UI */
36
+ manageBilling(): Promise<void>;
37
+ /** Consume a purchase (Android) */
38
+ consumePurchase(options: {
39
+ purchaseToken: string;
40
+ }): Promise<void>;
41
+ /** Acknowledge a purchase (Android) */
42
+ acknowledgePurchase(options: {
43
+ purchaseToken: string;
44
+ }): Promise<void>;
45
+ /** Launch price change confirmation flow (Android) */
46
+ launchPriceChangeConfirmationFlow(options: {
47
+ productId: string;
48
+ }): Promise<void>;
49
+ /** Load product details (iOS) */
50
+ load(options: {
51
+ productIds: string[];
52
+ }): Promise<{
53
+ validProducts: unknown[];
54
+ invalidProductIds: string[];
55
+ }>;
56
+ /** Purchase a product (iOS) */
57
+ purchase(options: {
58
+ productId: string;
59
+ quantity?: number;
60
+ applicationUsername?: string;
61
+ discount?: Record<string, unknown>;
62
+ }): Promise<void>;
63
+ /** Check if the device can make payments (iOS) */
64
+ canMakePayments(): Promise<{
65
+ canMakePayments: boolean;
66
+ }>;
67
+ /** Restore completed transactions (iOS) */
68
+ restore(): Promise<void>;
69
+ /** Present the code redemption sheet (iOS) */
70
+ presentCodeRedemptionSheet(): Promise<void>;
71
+ /** Refresh App Store receipts (iOS) */
72
+ refreshReceipts(): Promise<{
73
+ receipt: unknown;
74
+ }>;
75
+ /** Load App Store receipts (iOS) */
76
+ loadReceipts(): Promise<{
77
+ receipt: unknown;
78
+ }>;
79
+ addListener(eventName: string, listenerFunc: (data: any) => void): Promise<{
80
+ remove: () => Promise<void>;
81
+ }>;
82
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { PurchasePluginPlugin } from './definitions';
2
+ declare const PurchasePlugin: PurchasePluginPlugin;
3
+ export { PurchasePlugin };
4
+ export type { PurchasePluginPlugin };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ // Set the marker so the shared store.js knows Capacitor native bridges are available
3
+ if (typeof window !== 'undefined') {
4
+ window.CdvPurchaseCapacitor = { installed: true };
5
+ }
6
+ const PurchasePlugin = registerPlugin('PurchasePlugin');
7
+ export { PurchasePlugin };
@@ -0,0 +1,4 @@
1
+ import type { PurchasePluginPlugin } from './definitions';
2
+ declare const PurchasePlugin: PurchasePluginPlugin;
3
+ export { PurchasePlugin };
4
+ export type { PurchasePluginPlugin };