@dicty/payment 2.0.2 → 2.0.4
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 +13 -35
- package/dist/docs.json +36 -99
- package/dist/esm/definitions.d.ts +23 -20
- package/dist/esm/definitions.js +16 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/plugin.cjs.js +20 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +20 -0
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,7 +53,6 @@ import { PaymentPluginProvider } from '@dicty/payment/react';
|
|
|
53
53
|
* [`isGooglePayAvailable()`](#isgooglepayavailable)
|
|
54
54
|
* [`handleGooglePay(...)`](#handlegooglepay)
|
|
55
55
|
* [Type Aliases](#type-aliases)
|
|
56
|
-
* [Enums](#enums)
|
|
57
56
|
|
|
58
57
|
</docgen-index>
|
|
59
58
|
|
|
@@ -172,6 +171,11 @@ Handle Google Pay payment flow
|
|
|
172
171
|
<code>{ id: string; title: string; description: string; price: number; localizedPrice: string; subscriptionPeriod?: { value: number; unit: <a href="#applesubscriptionperiodunit">AppleSubscriptionPeriodUnit</a>; }; }</code>
|
|
173
172
|
|
|
174
173
|
|
|
174
|
+
#### AppleSubscriptionPeriodUnit
|
|
175
|
+
|
|
176
|
+
<code>(typeof <a href="#applesubscriptionperiodunit">AppleSubscriptionPeriodUnit</a>)[keyof typeof AppleSubscriptionPeriodUnit]</code>
|
|
177
|
+
|
|
178
|
+
|
|
175
179
|
#### GetAppleInAppPurchaseProductsOptions
|
|
176
180
|
|
|
177
181
|
<code>{ id: string[]; }</code>
|
|
@@ -184,12 +188,12 @@ Handle Google Pay payment flow
|
|
|
184
188
|
|
|
185
189
|
#### CompletedAppleInAppPurchaseResult
|
|
186
190
|
|
|
187
|
-
<code>{ status:
|
|
191
|
+
<code>{ status: typeof AppleInAppPurchaseStatus.Completed; productIdentifier: string; transactionIdentifier: string; }</code>
|
|
188
192
|
|
|
189
193
|
|
|
190
194
|
#### RestoredAppleInAppPurchaseResult
|
|
191
195
|
|
|
192
|
-
<code>{ status:
|
|
196
|
+
<code>{ status: typeof AppleInAppPurchaseStatus.Restored; } & <a href="#omit">Omit</a><<a href="#completedappleinapppurchaseresult">CompletedAppleInAppPurchaseResult</a>, 'status'></code>
|
|
193
197
|
|
|
194
198
|
|
|
195
199
|
#### Omit
|
|
@@ -215,12 +219,12 @@ From T, pick a set of properties whose keys are in the union K
|
|
|
215
219
|
|
|
216
220
|
#### FailedAppleInAppPurchaseResult
|
|
217
221
|
|
|
218
|
-
<code>{ status:
|
|
222
|
+
<code>{ status: typeof AppleInAppPurchaseStatus.Failed; productIdentifier?: string; transactionIdentifier?: string; }</code>
|
|
219
223
|
|
|
220
224
|
|
|
221
225
|
#### CancelledAppleInAppPurchaseResult
|
|
222
226
|
|
|
223
|
-
<code>{ status:
|
|
227
|
+
<code>{ status: typeof AppleInAppPurchaseStatus.Cancelled; } & <a href="#omit">Omit</a><<a href="#failedappleinapppurchaseresult">FailedAppleInAppPurchaseResult</a>, 'status'></code>
|
|
224
228
|
|
|
225
229
|
|
|
226
230
|
#### BuyAppleInAppPurchaseOptions
|
|
@@ -243,39 +247,13 @@ From T, pick a set of properties whose keys are in the union K
|
|
|
243
247
|
<code>{ result: <a href="#googlepayresults">GooglePayResults</a>; }</code>
|
|
244
248
|
|
|
245
249
|
|
|
246
|
-
####
|
|
247
|
-
|
|
248
|
-
<code>{ clientSecret: string; }</code>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
### Enums
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
#### AppleSubscriptionPeriodUnit
|
|
255
|
-
|
|
256
|
-
| Members | Value |
|
|
257
|
-
| ----------- | -------------- |
|
|
258
|
-
| **`Day`** | <code>0</code> |
|
|
259
|
-
| **`Week`** | <code>1</code> |
|
|
260
|
-
| **`Month`** | <code>2</code> |
|
|
261
|
-
| **`Year`** | <code>3</code> |
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
#### AppleInAppPurchaseStatus
|
|
250
|
+
#### GooglePayResults
|
|
265
251
|
|
|
266
|
-
|
|
267
|
-
| --------------- | ------------------------ |
|
|
268
|
-
| **`Completed`** | <code>'completed'</code> |
|
|
269
|
-
| **`Restored`** | <code>'restored'</code> |
|
|
270
|
-
| **`Cancelled`** | <code>'cancelled'</code> |
|
|
271
|
-
| **`Failed`** | <code>'failed'</code> |
|
|
252
|
+
<code>(typeof <a href="#googlepayresults">GooglePayResults</a>)[keyof typeof GooglePayResults]</code>
|
|
272
253
|
|
|
273
254
|
|
|
274
|
-
####
|
|
255
|
+
#### GooglePayOptions
|
|
275
256
|
|
|
276
|
-
|
|
277
|
-
| --------------- | ------------------------ |
|
|
278
|
-
| **`Completed`** | <code>'completed'</code> |
|
|
279
|
-
| **`Failed`** | <code>'failed'</code> |
|
|
257
|
+
<code>{ clientSecret: string; }</code>
|
|
280
258
|
|
|
281
259
|
</docgen-api>
|
package/dist/docs.json
CHANGED
|
@@ -111,86 +111,7 @@
|
|
|
111
111
|
"properties": []
|
|
112
112
|
},
|
|
113
113
|
"interfaces": [],
|
|
114
|
-
"enums": [
|
|
115
|
-
{
|
|
116
|
-
"name": "AppleSubscriptionPeriodUnit",
|
|
117
|
-
"slug": "applesubscriptionperiodunit",
|
|
118
|
-
"members": [
|
|
119
|
-
{
|
|
120
|
-
"name": "Day",
|
|
121
|
-
"value": "0",
|
|
122
|
-
"tags": [],
|
|
123
|
-
"docs": ""
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"name": "Week",
|
|
127
|
-
"value": "1",
|
|
128
|
-
"tags": [],
|
|
129
|
-
"docs": ""
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"name": "Month",
|
|
133
|
-
"value": "2",
|
|
134
|
-
"tags": [],
|
|
135
|
-
"docs": ""
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"name": "Year",
|
|
139
|
-
"value": "3",
|
|
140
|
-
"tags": [],
|
|
141
|
-
"docs": ""
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"name": "AppleInAppPurchaseStatus",
|
|
147
|
-
"slug": "appleinapppurchasestatus",
|
|
148
|
-
"members": [
|
|
149
|
-
{
|
|
150
|
-
"name": "Completed",
|
|
151
|
-
"value": "'completed'",
|
|
152
|
-
"tags": [],
|
|
153
|
-
"docs": ""
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"name": "Restored",
|
|
157
|
-
"value": "'restored'",
|
|
158
|
-
"tags": [],
|
|
159
|
-
"docs": ""
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"name": "Cancelled",
|
|
163
|
-
"value": "'cancelled'",
|
|
164
|
-
"tags": [],
|
|
165
|
-
"docs": ""
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
"name": "Failed",
|
|
169
|
-
"value": "'failed'",
|
|
170
|
-
"tags": [],
|
|
171
|
-
"docs": ""
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"name": "GooglePayResults",
|
|
177
|
-
"slug": "googlepayresults",
|
|
178
|
-
"members": [
|
|
179
|
-
{
|
|
180
|
-
"name": "Completed",
|
|
181
|
-
"value": "'completed'",
|
|
182
|
-
"tags": [],
|
|
183
|
-
"docs": ""
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"name": "Failed",
|
|
187
|
-
"value": "'failed'",
|
|
188
|
-
"tags": [],
|
|
189
|
-
"docs": ""
|
|
190
|
-
}
|
|
191
|
-
]
|
|
192
|
-
}
|
|
193
|
-
],
|
|
114
|
+
"enums": [],
|
|
194
115
|
"typeAliases": [
|
|
195
116
|
{
|
|
196
117
|
"name": "GetAppleInAppPurchaseProductsResult",
|
|
@@ -198,7 +119,7 @@
|
|
|
198
119
|
"docs": "",
|
|
199
120
|
"types": [
|
|
200
121
|
{
|
|
201
|
-
"text": "{\n
|
|
122
|
+
"text": "{\n products: AppleInAppPurchaseProduct[];\n}",
|
|
202
123
|
"complexTypes": [
|
|
203
124
|
"AppleInAppPurchaseProduct"
|
|
204
125
|
]
|
|
@@ -211,20 +132,31 @@
|
|
|
211
132
|
"docs": "",
|
|
212
133
|
"types": [
|
|
213
134
|
{
|
|
214
|
-
"text": "{\n
|
|
135
|
+
"text": "{\n id: string;\n title: string;\n description: string;\n price: number;\n localizedPrice: string;\n subscriptionPeriod?: {\n value: number;\n unit: AppleSubscriptionPeriodUnit;\n };\n}",
|
|
215
136
|
"complexTypes": [
|
|
216
137
|
"AppleSubscriptionPeriodUnit"
|
|
217
138
|
]
|
|
218
139
|
}
|
|
219
140
|
]
|
|
220
141
|
},
|
|
142
|
+
{
|
|
143
|
+
"name": "AppleSubscriptionPeriodUnit",
|
|
144
|
+
"slug": "applesubscriptionperiodunit",
|
|
145
|
+
"docs": "",
|
|
146
|
+
"types": [
|
|
147
|
+
{
|
|
148
|
+
"text": "(typeof AppleSubscriptionPeriodUnit)[keyof typeof AppleSubscriptionPeriodUnit]",
|
|
149
|
+
"complexTypes": []
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
},
|
|
221
153
|
{
|
|
222
154
|
"name": "GetAppleInAppPurchaseProductsOptions",
|
|
223
155
|
"slug": "getappleinapppurchaseproductsoptions",
|
|
224
156
|
"docs": "",
|
|
225
157
|
"types": [
|
|
226
158
|
{
|
|
227
|
-
"text": "{\n
|
|
159
|
+
"text": "{\n id: string[];\n}",
|
|
228
160
|
"complexTypes": []
|
|
229
161
|
}
|
|
230
162
|
]
|
|
@@ -266,10 +198,8 @@
|
|
|
266
198
|
"docs": "",
|
|
267
199
|
"types": [
|
|
268
200
|
{
|
|
269
|
-
"text": "{\n
|
|
270
|
-
"complexTypes": [
|
|
271
|
-
"AppleInAppPurchaseStatus"
|
|
272
|
-
]
|
|
201
|
+
"text": "{\n status: typeof AppleInAppPurchaseStatus.Completed;\n productIdentifier: string;\n transactionIdentifier: string;\n}",
|
|
202
|
+
"complexTypes": []
|
|
273
203
|
}
|
|
274
204
|
]
|
|
275
205
|
},
|
|
@@ -279,9 +209,8 @@
|
|
|
279
209
|
"docs": "",
|
|
280
210
|
"types": [
|
|
281
211
|
{
|
|
282
|
-
"text": "{\n
|
|
212
|
+
"text": "{\n status: typeof AppleInAppPurchaseStatus.Restored;\n} & Omit<CompletedAppleInAppPurchaseResult, 'status'>",
|
|
283
213
|
"complexTypes": [
|
|
284
|
-
"AppleInAppPurchaseStatus",
|
|
285
214
|
"Omit",
|
|
286
215
|
"CompletedAppleInAppPurchaseResult"
|
|
287
216
|
]
|
|
@@ -339,10 +268,8 @@
|
|
|
339
268
|
"docs": "",
|
|
340
269
|
"types": [
|
|
341
270
|
{
|
|
342
|
-
"text": "{\n
|
|
343
|
-
"complexTypes": [
|
|
344
|
-
"AppleInAppPurchaseStatus"
|
|
345
|
-
]
|
|
271
|
+
"text": "{\n status: typeof AppleInAppPurchaseStatus.Failed;\n productIdentifier?: string;\n transactionIdentifier?: string;\n}",
|
|
272
|
+
"complexTypes": []
|
|
346
273
|
}
|
|
347
274
|
]
|
|
348
275
|
},
|
|
@@ -352,9 +279,8 @@
|
|
|
352
279
|
"docs": "",
|
|
353
280
|
"types": [
|
|
354
281
|
{
|
|
355
|
-
"text": "{\n
|
|
282
|
+
"text": "{\n status: typeof AppleInAppPurchaseStatus.Cancelled;\n} & Omit<FailedAppleInAppPurchaseResult, 'status'>",
|
|
356
283
|
"complexTypes": [
|
|
357
|
-
"AppleInAppPurchaseStatus",
|
|
358
284
|
"Omit",
|
|
359
285
|
"FailedAppleInAppPurchaseResult"
|
|
360
286
|
]
|
|
@@ -367,7 +293,7 @@
|
|
|
367
293
|
"docs": "",
|
|
368
294
|
"types": [
|
|
369
295
|
{
|
|
370
|
-
"text": "{\n
|
|
296
|
+
"text": "{\n id: string;\n}",
|
|
371
297
|
"complexTypes": []
|
|
372
298
|
}
|
|
373
299
|
]
|
|
@@ -391,7 +317,7 @@
|
|
|
391
317
|
"docs": "",
|
|
392
318
|
"types": [
|
|
393
319
|
{
|
|
394
|
-
"text": "{\n
|
|
320
|
+
"text": "{\n receiptData: string;\n}",
|
|
395
321
|
"complexTypes": []
|
|
396
322
|
}
|
|
397
323
|
]
|
|
@@ -402,20 +328,31 @@
|
|
|
402
328
|
"docs": "",
|
|
403
329
|
"types": [
|
|
404
330
|
{
|
|
405
|
-
"text": "{\n
|
|
331
|
+
"text": "{\n result: GooglePayResults;\n}",
|
|
406
332
|
"complexTypes": [
|
|
407
333
|
"GooglePayResults"
|
|
408
334
|
]
|
|
409
335
|
}
|
|
410
336
|
]
|
|
411
337
|
},
|
|
338
|
+
{
|
|
339
|
+
"name": "GooglePayResults",
|
|
340
|
+
"slug": "googlepayresults",
|
|
341
|
+
"docs": "",
|
|
342
|
+
"types": [
|
|
343
|
+
{
|
|
344
|
+
"text": "(typeof GooglePayResults)[keyof typeof GooglePayResults]",
|
|
345
|
+
"complexTypes": []
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
},
|
|
412
349
|
{
|
|
413
350
|
"name": "GooglePayOptions",
|
|
414
351
|
"slug": "googlepayoptions",
|
|
415
352
|
"docs": "",
|
|
416
353
|
"types": [
|
|
417
354
|
{
|
|
418
|
-
"text": "{\n
|
|
355
|
+
"text": "{\n clientSecret: string;\n}",
|
|
419
356
|
"complexTypes": []
|
|
420
357
|
}
|
|
421
358
|
]
|
|
@@ -28,18 +28,20 @@ export interface PaymentPlugin {
|
|
|
28
28
|
*/
|
|
29
29
|
handleGooglePay(opts: GooglePayOptions): Promise<GooglePayResult>;
|
|
30
30
|
}
|
|
31
|
-
export declare
|
|
32
|
-
Completed
|
|
33
|
-
Restored
|
|
34
|
-
Cancelled
|
|
35
|
-
Failed
|
|
36
|
-
}
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
export declare const AppleInAppPurchaseStatus: {
|
|
32
|
+
readonly Completed: "completed";
|
|
33
|
+
readonly Restored: "restored";
|
|
34
|
+
readonly Cancelled: "cancelled";
|
|
35
|
+
readonly Failed: "failed";
|
|
36
|
+
};
|
|
37
|
+
export type AppleInAppPurchaseStatus = (typeof AppleInAppPurchaseStatus)[keyof typeof AppleInAppPurchaseStatus];
|
|
38
|
+
export declare const AppleSubscriptionPeriodUnit: {
|
|
39
|
+
readonly Day: 0;
|
|
40
|
+
readonly Week: 1;
|
|
41
|
+
readonly Month: 2;
|
|
42
|
+
readonly Year: 3;
|
|
43
|
+
};
|
|
44
|
+
export type AppleSubscriptionPeriodUnit = (typeof AppleSubscriptionPeriodUnit)[keyof typeof AppleSubscriptionPeriodUnit];
|
|
43
45
|
export declare type GetAppleInAppPurchaseProductsOptions = {
|
|
44
46
|
id: string[];
|
|
45
47
|
};
|
|
@@ -62,29 +64,30 @@ export declare type BuyAppleInAppPurchaseOptions = {
|
|
|
62
64
|
};
|
|
63
65
|
export declare type BuyAppleInAppPurchaseResult = CompletedAppleInAppPurchaseResult | RestoredAppleInAppPurchaseResult | FailedAppleInAppPurchaseResult | CancelledAppleInAppPurchaseResult;
|
|
64
66
|
export declare type CompletedAppleInAppPurchaseResult = {
|
|
65
|
-
status: AppleInAppPurchaseStatus.Completed;
|
|
67
|
+
status: typeof AppleInAppPurchaseStatus.Completed;
|
|
66
68
|
productIdentifier: string;
|
|
67
69
|
transactionIdentifier: string;
|
|
68
70
|
};
|
|
69
71
|
export declare type RestoredAppleInAppPurchaseResult = {
|
|
70
|
-
status: AppleInAppPurchaseStatus.Restored;
|
|
72
|
+
status: typeof AppleInAppPurchaseStatus.Restored;
|
|
71
73
|
} & Omit<CompletedAppleInAppPurchaseResult, 'status'>;
|
|
72
74
|
export declare type FailedAppleInAppPurchaseResult = {
|
|
73
|
-
status: AppleInAppPurchaseStatus.Failed;
|
|
75
|
+
status: typeof AppleInAppPurchaseStatus.Failed;
|
|
74
76
|
productIdentifier?: string;
|
|
75
77
|
transactionIdentifier?: string;
|
|
76
78
|
};
|
|
77
79
|
export declare type CancelledAppleInAppPurchaseResult = {
|
|
78
|
-
status: AppleInAppPurchaseStatus.Cancelled;
|
|
80
|
+
status: typeof AppleInAppPurchaseStatus.Cancelled;
|
|
79
81
|
} & Omit<FailedAppleInAppPurchaseResult, 'status'>;
|
|
80
82
|
export declare type RestoreAppleInAppPurchaseResult = BuyAppleInAppPurchaseResult;
|
|
81
83
|
export declare type GetAppleInAppPurchaseReceiptResult = {
|
|
82
84
|
receiptData: string;
|
|
83
85
|
};
|
|
84
|
-
export declare
|
|
85
|
-
Completed
|
|
86
|
-
Failed
|
|
87
|
-
}
|
|
86
|
+
export declare const GooglePayResults: {
|
|
87
|
+
readonly Completed: "completed";
|
|
88
|
+
readonly Failed: "failed";
|
|
89
|
+
};
|
|
90
|
+
export type GooglePayResults = (typeof GooglePayResults)[keyof typeof GooglePayResults];
|
|
88
91
|
export declare type GooglePayOptions = {
|
|
89
92
|
clientSecret: string;
|
|
90
93
|
};
|
package/dist/esm/definitions.js
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export const AppleInAppPurchaseStatus = {
|
|
2
|
+
Completed: 'completed',
|
|
3
|
+
Restored: 'restored',
|
|
4
|
+
Cancelled: 'cancelled',
|
|
5
|
+
Failed: 'failed',
|
|
6
|
+
};
|
|
7
|
+
export const AppleSubscriptionPeriodUnit = {
|
|
8
|
+
Day: 0,
|
|
9
|
+
Week: 1,
|
|
10
|
+
Month: 2,
|
|
11
|
+
Year: 3,
|
|
12
|
+
};
|
|
13
|
+
export const GooglePayResults = {
|
|
14
|
+
Completed: 'completed',
|
|
15
|
+
Failed: 'failed',
|
|
16
|
+
};
|
|
2
17
|
//# sourceMappingURL=definitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface PaymentPlugin {\n
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAsCA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;CACR,CAAC;AAGX,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;CACC,CAAC;AA4DX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;CACR,CAAC","sourcesContent":["export interface PaymentPlugin {\n /**\n * Check if Apple In-App Purchases are available on this device\n */\n isAppleInAppPurchaseAvailable(): Promise<void>;\n\n /**\n * Get Apple In-App Purchase products by their identifiers\n */\n getAppleInAppPurchaseProducts(\n opts: GetAppleInAppPurchaseProductsOptions,\n ): Promise<GetAppleInAppPurchaseProductsResult>;\n\n /**\n * Purchase an Apple In-App Purchase product\n */\n buyAppleInAppPurchase(opts: BuyAppleInAppPurchaseOptions): Promise<BuyAppleInAppPurchaseResult>;\n\n /**\n * Restore Apple In-App Purchase transactions\n */\n restoreAppleInAppPurchase(): Promise<RestoreAppleInAppPurchaseResult>;\n\n /**\n * Get Apple In-App Purchase receipt data\n */\n getAppleInAppPurchaseReceipt(): Promise<GetAppleInAppPurchaseReceiptResult>;\n\n /**\n * Check if Google Pay is available on this device\n */\n isGooglePayAvailable(): Promise<void>;\n\n /**\n * Handle Google Pay payment flow\n */\n handleGooglePay(opts: GooglePayOptions): Promise<GooglePayResult>;\n}\nexport const AppleInAppPurchaseStatus = {\n Completed: 'completed',\n Restored: 'restored',\n Cancelled: 'cancelled',\n Failed: 'failed',\n} as const;\n\nexport type AppleInAppPurchaseStatus = (typeof AppleInAppPurchaseStatus)[keyof typeof AppleInAppPurchaseStatus];\nexport const AppleSubscriptionPeriodUnit = {\n Day: 0,\n Week: 1,\n Month: 2,\n Year: 3,\n} as const;\n\nexport type AppleSubscriptionPeriodUnit = (typeof AppleSubscriptionPeriodUnit)[keyof typeof AppleSubscriptionPeriodUnit];\n\n\nexport declare type GetAppleInAppPurchaseProductsOptions = {\n id: string[];\n};\n\nexport declare type AppleInAppPurchaseProduct = {\n id: string;\n title: string;\n description: string;\n price: number;\n localizedPrice: string;\n subscriptionPeriod?: {\n value: number;\n unit: AppleSubscriptionPeriodUnit;\n };\n};\n\nexport declare type GetAppleInAppPurchaseProductsResult = {\n products: AppleInAppPurchaseProduct[];\n};\n\nexport declare type BuyAppleInAppPurchaseOptions = {\n id: string;\n};\n\nexport declare type BuyAppleInAppPurchaseResult =\n | CompletedAppleInAppPurchaseResult\n | RestoredAppleInAppPurchaseResult\n | FailedAppleInAppPurchaseResult\n | CancelledAppleInAppPurchaseResult;\n\nexport declare type CompletedAppleInAppPurchaseResult = {\n status: typeof AppleInAppPurchaseStatus.Completed;\n productIdentifier: string;\n transactionIdentifier: string;\n};\n\nexport declare type RestoredAppleInAppPurchaseResult = {\n status: typeof AppleInAppPurchaseStatus.Restored;\n} & Omit<CompletedAppleInAppPurchaseResult, 'status'>;\n\nexport declare type FailedAppleInAppPurchaseResult = {\n status: typeof AppleInAppPurchaseStatus.Failed;\n productIdentifier?: string;\n transactionIdentifier?: string;\n};\n\nexport declare type CancelledAppleInAppPurchaseResult = {\n status: typeof AppleInAppPurchaseStatus.Cancelled;\n} & Omit<FailedAppleInAppPurchaseResult, 'status'>;\n\nexport declare type RestoreAppleInAppPurchaseResult = BuyAppleInAppPurchaseResult;\n\nexport declare type GetAppleInAppPurchaseReceiptResult = {\n receiptData: string;\n};\nexport const GooglePayResults = {\n Completed: 'completed',\n Failed: 'failed',\n} as const;\n\nexport type GooglePayResults = (typeof GooglePayResults)[keyof typeof GooglePayResults];\nexport declare type GooglePayOptions = {\n clientSecret: string;\n};\nexport declare type GooglePayResult = {\n result: GooglePayResults;\n};\nexport declare type PaymentPluginContext = {\n plugin: PaymentPlugin;\n isAppleInAppPurchaseAvailable: boolean;\n isGooglePayAvailable: boolean;\n};\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@capacitor/core');
|
|
4
4
|
|
|
5
|
+
const AppleInAppPurchaseStatus = {
|
|
6
|
+
Completed: 'completed',
|
|
7
|
+
Restored: 'restored',
|
|
8
|
+
Cancelled: 'cancelled',
|
|
9
|
+
Failed: 'failed',
|
|
10
|
+
};
|
|
11
|
+
const AppleSubscriptionPeriodUnit = {
|
|
12
|
+
Day: 0,
|
|
13
|
+
Week: 1,
|
|
14
|
+
Month: 2,
|
|
15
|
+
Year: 3,
|
|
16
|
+
};
|
|
17
|
+
const GooglePayResults = {
|
|
18
|
+
Completed: 'completed',
|
|
19
|
+
Failed: 'failed',
|
|
20
|
+
};
|
|
21
|
+
|
|
5
22
|
const Payment = core.registerPlugin('Payment', {
|
|
6
23
|
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.PaymentWeb()),
|
|
7
24
|
});
|
|
@@ -41,5 +58,8 @@ var web = /*#__PURE__*/Object.freeze({
|
|
|
41
58
|
PaymentWeb: PaymentWeb
|
|
42
59
|
});
|
|
43
60
|
|
|
61
|
+
exports.AppleInAppPurchaseStatus = AppleInAppPurchaseStatus;
|
|
62
|
+
exports.AppleSubscriptionPeriodUnit = AppleSubscriptionPeriodUnit;
|
|
63
|
+
exports.GooglePayResults = GooglePayResults;
|
|
44
64
|
exports.Payment = Payment;
|
|
45
65
|
//# sourceMappingURL=plugin.cjs.js.map
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Payment = registerPlugin('Payment', {\n web: () => import('./web').then((m) => new m.PaymentWeb()),\n});\nexport * from './definitions';\nexport { Payment };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class PaymentWeb extends WebPlugin {\n /**\n * Apple\n */\n isAppleInAppPurchaseAvailable() {\n return Promise.reject('Not supported');\n }\n getAppleInAppPurchaseProducts(_opts) {\n return Promise.reject('Not supported');\n }\n buyAppleInAppPurchase(_opts) {\n return Promise.reject('Not supported');\n }\n restoreAppleInAppPurchase() {\n return Promise.reject('Not supported');\n }\n getAppleInAppPurchaseReceipt() {\n return Promise.reject('Not supported');\n }\n /**\n * Google\n */\n isGooglePayAvailable() {\n return Promise.reject('Not supported');\n }\n handleGooglePay(_opts) {\n return Promise.reject('Not supported');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export const AppleInAppPurchaseStatus = {\n Completed: 'completed',\n Restored: 'restored',\n Cancelled: 'cancelled',\n Failed: 'failed',\n};\nexport const AppleSubscriptionPeriodUnit = {\n Day: 0,\n Week: 1,\n Month: 2,\n Year: 3,\n};\nexport const GooglePayResults = {\n Completed: 'completed',\n Failed: 'failed',\n};\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst Payment = registerPlugin('Payment', {\n web: () => import('./web').then((m) => new m.PaymentWeb()),\n});\nexport * from './definitions';\nexport { Payment };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class PaymentWeb extends WebPlugin {\n /**\n * Apple\n */\n isAppleInAppPurchaseAvailable() {\n return Promise.reject('Not supported');\n }\n getAppleInAppPurchaseProducts(_opts) {\n return Promise.reject('Not supported');\n }\n buyAppleInAppPurchase(_opts) {\n return Promise.reject('Not supported');\n }\n restoreAppleInAppPurchase() {\n return Promise.reject('Not supported');\n }\n getAppleInAppPurchaseReceipt() {\n return Promise.reject('Not supported');\n }\n /**\n * Google\n */\n isGooglePayAvailable() {\n return Promise.reject('Not supported');\n }\n handleGooglePay(_opts) {\n return Promise.reject('Not supported');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAAY,MAAC,wBAAwB,GAAG;AACxC,IAAI,SAAS,EAAE,WAAW;AAC1B,IAAI,QAAQ,EAAE,UAAU;AACxB,IAAI,SAAS,EAAE,WAAW;AAC1B,IAAI,MAAM,EAAE,QAAQ;AACpB;AACY,MAAC,2BAA2B,GAAG;AAC3C,IAAI,GAAG,EAAE,CAAC;AACV,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,EAAE,CAAC;AACX;AACY,MAAC,gBAAgB,GAAG;AAChC,IAAI,SAAS,EAAE,WAAW;AAC1B,IAAI,MAAM,EAAE,QAAQ;AACpB;;ACdK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AAC9D,CAAC;;ACFM,MAAM,UAAU,SAASC,cAAS,CAAC;AAC1C;AACA;AACA;AACA,IAAI,6BAA6B,GAAG;AACpC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;AAC9C,IAAI;AACJ,IAAI,6BAA6B,CAAC,KAAK,EAAE;AACzC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;AAC9C,IAAI;AACJ,IAAI,qBAAqB,CAAC,KAAK,EAAE;AACjC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;AAC9C,IAAI;AACJ,IAAI,yBAAyB,GAAG;AAChC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;AAC9C,IAAI;AACJ,IAAI,4BAA4B,GAAG;AACnC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;AAC9C,IAAI;AACJ;AACA;AACA;AACA,IAAI,oBAAoB,GAAG;AAC3B,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;AAC9C,IAAI;AACJ,IAAI,eAAe,CAAC,KAAK,EAAE;AAC3B,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;AAC9C,IAAI;AACJ;;;;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
var capacitorPayment = (function (exports, core) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
const AppleInAppPurchaseStatus = {
|
|
5
|
+
Completed: 'completed',
|
|
6
|
+
Restored: 'restored',
|
|
7
|
+
Cancelled: 'cancelled',
|
|
8
|
+
Failed: 'failed',
|
|
9
|
+
};
|
|
10
|
+
const AppleSubscriptionPeriodUnit = {
|
|
11
|
+
Day: 0,
|
|
12
|
+
Week: 1,
|
|
13
|
+
Month: 2,
|
|
14
|
+
Year: 3,
|
|
15
|
+
};
|
|
16
|
+
const GooglePayResults = {
|
|
17
|
+
Completed: 'completed',
|
|
18
|
+
Failed: 'failed',
|
|
19
|
+
};
|
|
20
|
+
|
|
4
21
|
const Payment = core.registerPlugin('Payment', {
|
|
5
22
|
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.PaymentWeb()),
|
|
6
23
|
});
|
|
@@ -40,6 +57,9 @@ var capacitorPayment = (function (exports, core) {
|
|
|
40
57
|
PaymentWeb: PaymentWeb
|
|
41
58
|
});
|
|
42
59
|
|
|
60
|
+
exports.AppleInAppPurchaseStatus = AppleInAppPurchaseStatus;
|
|
61
|
+
exports.AppleSubscriptionPeriodUnit = AppleSubscriptionPeriodUnit;
|
|
62
|
+
exports.GooglePayResults = GooglePayResults;
|
|
43
63
|
exports.Payment = Payment;
|
|
44
64
|
|
|
45
65
|
return exports;
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Payment = registerPlugin('Payment', {\n web: () => import('./web').then((m) => new m.PaymentWeb()),\n});\nexport * from './definitions';\nexport { Payment };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class PaymentWeb extends WebPlugin {\n /**\n * Apple\n */\n isAppleInAppPurchaseAvailable() {\n return Promise.reject('Not supported');\n }\n getAppleInAppPurchaseProducts(_opts) {\n return Promise.reject('Not supported');\n }\n buyAppleInAppPurchase(_opts) {\n return Promise.reject('Not supported');\n }\n restoreAppleInAppPurchase() {\n return Promise.reject('Not supported');\n }\n getAppleInAppPurchaseReceipt() {\n return Promise.reject('Not supported');\n }\n /**\n * Google\n */\n isGooglePayAvailable() {\n return Promise.reject('Not supported');\n }\n handleGooglePay(_opts) {\n return Promise.reject('Not supported');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export const AppleInAppPurchaseStatus = {\n Completed: 'completed',\n Restored: 'restored',\n Cancelled: 'cancelled',\n Failed: 'failed',\n};\nexport const AppleSubscriptionPeriodUnit = {\n Day: 0,\n Week: 1,\n Month: 2,\n Year: 3,\n};\nexport const GooglePayResults = {\n Completed: 'completed',\n Failed: 'failed',\n};\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst Payment = registerPlugin('Payment', {\n web: () => import('./web').then((m) => new m.PaymentWeb()),\n});\nexport * from './definitions';\nexport { Payment };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class PaymentWeb extends WebPlugin {\n /**\n * Apple\n */\n isAppleInAppPurchaseAvailable() {\n return Promise.reject('Not supported');\n }\n getAppleInAppPurchaseProducts(_opts) {\n return Promise.reject('Not supported');\n }\n buyAppleInAppPurchase(_opts) {\n return Promise.reject('Not supported');\n }\n restoreAppleInAppPurchase() {\n return Promise.reject('Not supported');\n }\n getAppleInAppPurchaseReceipt() {\n return Promise.reject('Not supported');\n }\n /**\n * Google\n */\n isGooglePayAvailable() {\n return Promise.reject('Not supported');\n }\n handleGooglePay(_opts) {\n return Promise.reject('Not supported');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AAAY,UAAC,wBAAwB,GAAG;IACxC,IAAI,SAAS,EAAE,WAAW;IAC1B,IAAI,QAAQ,EAAE,UAAU;IACxB,IAAI,SAAS,EAAE,WAAW;IAC1B,IAAI,MAAM,EAAE,QAAQ;IACpB;AACY,UAAC,2BAA2B,GAAG;IAC3C,IAAI,GAAG,EAAE,CAAC;IACV,IAAI,IAAI,EAAE,CAAC;IACX,IAAI,KAAK,EAAE,CAAC;IACZ,IAAI,IAAI,EAAE,CAAC;IACX;AACY,UAAC,gBAAgB,GAAG;IAChC,IAAI,SAAS,EAAE,WAAW;IAC1B,IAAI,MAAM,EAAE,QAAQ;IACpB;;ACdK,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9D,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C;IACA;IACA;IACA,IAAI,6BAA6B,GAAG;IACpC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAC9C,IAAI;IACJ,IAAI,6BAA6B,CAAC,KAAK,EAAE;IACzC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAC9C,IAAI;IACJ,IAAI,qBAAqB,CAAC,KAAK,EAAE;IACjC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAC9C,IAAI;IACJ,IAAI,yBAAyB,GAAG;IAChC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAC9C,IAAI;IACJ,IAAI,4BAA4B,GAAG;IACnC,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAC9C,IAAI;IACJ;IACA;IACA;IACA,IAAI,oBAAoB,GAAG;IAC3B,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAC9C,IAAI;IACJ,IAAI,eAAe,CAAC,KAAK,EAAE;IAC3B,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAC9C,IAAI;IACJ;;;;;;;;;;;;;;;;;;"}
|