react-native-purchases 5.0.0-beta.1 → 5.0.0-beta.2

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 CHANGED
@@ -23,7 +23,7 @@ React Native Purchases is a client for the [RevenueCat](https://www.revenuecat.c
23
23
 
24
24
  ## Requirements
25
25
 
26
- The minimum React Native version this SDK requires is `0.58`.
26
+ The minimum React Native version this SDK requires is `0.64`.
27
27
 
28
28
  ## Installation
29
29
 
@@ -24,6 +24,6 @@ Pod::Spec.new do |spec|
24
24
  ]
25
25
 
26
26
  spec.dependency "React-Core"
27
- spec.dependency "PurchasesHybridCommon", '3.3.0'
27
+ spec.dependency "PurchasesHybridCommon", '4.0.0'
28
28
  spec.swift_version = '5.0'
29
29
  end
@@ -29,7 +29,7 @@ android {
29
29
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
30
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
31
  versionCode 1
32
- versionName '5.0.0-beta.1'
32
+ versionName '5.0.0-beta.2'
33
33
  }
34
34
 
35
35
  buildTypes {
@@ -121,6 +121,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
121
121
  dependencies {
122
122
  //noinspection GradleDynamicVersion
123
123
  api 'com.facebook.react:react-native:+'
124
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:3.3.0'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:4.0.0'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
@@ -29,7 +29,7 @@ android {
29
29
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
30
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
31
  versionCode 1
32
- versionName '4.6.1'
32
+ versionName '5.0.0-beta.1'
33
33
  }
34
34
 
35
35
  buildTypes {
@@ -121,6 +121,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
121
121
  dependencies {
122
122
  //noinspection GradleDynamicVersion
123
123
  api 'com.facebook.react:react-native:+'
124
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:3.3.0'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:4.0.0'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
package/dist/errors.d.ts CHANGED
@@ -34,6 +34,9 @@ export interface PurchasesError {
34
34
  export interface ErrorInfo {
35
35
  readableErrorCode: string;
36
36
  }
37
+ /**
38
+ * @internal
39
+ */
37
40
  export declare class UninitializedPurchasesError extends Error {
38
41
  constructor();
39
42
  }
package/dist/errors.js CHANGED
@@ -41,6 +41,9 @@ var PURCHASES_ERROR_CODE;
41
41
  PURCHASES_ERROR_CODE["INVALID_SUBSCRIBER_ATTRIBUTES_ERROR"] = "21";
42
42
  PURCHASES_ERROR_CODE["LOG_OUT_ANONYMOUS_USER_ERROR"] = "22";
43
43
  })(PURCHASES_ERROR_CODE = exports.PURCHASES_ERROR_CODE || (exports.PURCHASES_ERROR_CODE = {}));
44
+ /**
45
+ * @internal
46
+ */
44
47
  var UninitializedPurchasesError = /** @class */ (function (_super) {
45
48
  __extends(UninitializedPurchasesError, _super);
46
49
  function UninitializedPurchasesError() {
@@ -74,15 +74,15 @@ export interface PurchasesStoreProduct {
74
74
  /**
75
75
  * Formatted price of the item, including its currency sign.
76
76
  */
77
- readonly price_string: string;
77
+ readonly priceString: string;
78
78
  /**
79
79
  * Currency code for price and original price.
80
80
  */
81
- readonly currency_code: string;
81
+ readonly currencyCode: string;
82
82
  /**
83
83
  * Introductory price.
84
84
  */
85
- readonly intro_price: PurchasesIntroPrice | null;
85
+ readonly introPrice: PurchasesIntroPrice | null;
86
86
  /**
87
87
  * Collection of discount offers for a product. Null for Android.
88
88
  */
@@ -101,6 +101,9 @@ export default class Purchases {
101
101
  * @enum {string}
102
102
  */
103
103
  static PURCHASES_ERROR_CODE: typeof PURCHASES_ERROR_CODE;
104
+ /**
105
+ * @internal
106
+ */
104
107
  static UninitializedPurchasesError: typeof UninitializedPurchasesError;
105
108
  /**
106
109
  * Sets up Purchases with your API key and an app user id.
package/dist/purchases.js CHANGED
@@ -1092,6 +1092,9 @@ var Purchases = /** @class */ (function () {
1092
1092
  * @enum {string}
1093
1093
  */
1094
1094
  Purchases.PURCHASES_ERROR_CODE = errors_1.PURCHASES_ERROR_CODE;
1095
+ /**
1096
+ * @internal
1097
+ */
1095
1098
  Purchases.UninitializedPurchasesError = errors_1.UninitializedPurchasesError;
1096
1099
  return Purchases;
1097
1100
  }());
package/ios/RNPurchases.m CHANGED
@@ -103,8 +103,8 @@ RCT_REMAP_METHOD(purchasePackage,
103
103
  completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
104
104
  }
105
105
 
106
- RCT_REMAP_METHOD(restoreTransactions,
107
- restoreTransactionsWithResolve:(RCTPromiseResolveBlock)resolve
106
+ RCT_REMAP_METHOD(restorePurchases,
107
+ restorePurchasesWithResolve:(RCTPromiseResolveBlock)resolve
108
108
  reject:(RCTPromiseRejectBlock)reject) {
109
109
  [RCCommonFunctionality restorePurchasesWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve
110
110
  reject:reject]];
@@ -336,7 +336,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
336
336
  }
337
337
 
338
338
  - (NSString *)platformFlavorVersion {
339
- return @"5.0.0-beta.1";
339
+ return @"5.0.0-beta.2";
340
340
  }
341
341
 
342
342
  @end
@@ -336,7 +336,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
336
336
  }
337
337
 
338
338
  - (NSString *)platformFlavorVersion {
339
- return @"4.6.1";
339
+ return @"5.0.0-beta.1";
340
340
  }
341
341
 
342
342
  @end
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-purchases",
3
3
  "title": "React Native Purchases",
4
- "version": "5.0.0-beta.1",
4
+ "version": "5.0.0-beta.2",
5
5
  "description": "React Native in-app purchases and subscriptions made easy. Supports iOS and Android. ",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -70,6 +70,7 @@
70
70
  "ts-jest": "^24.1.0",
71
71
  "tslint": "^5.20.0",
72
72
  "tslint-config-prettier": "^1.18.0",
73
+ "typedoc": "^0.20.37",
73
74
  "typescript": "^3.8.3"
74
75
  },
75
76
  "jest": {
@@ -0,0 +1,9 @@
1
+ <!-- This file is used to redirect visitors to the latest version of the docs -->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/5.0.0-beta.2/" />
6
+ </head>
7
+ <body>
8
+ </body>
9
+ </html>
@@ -0,0 +1,9 @@
1
+ <!-- This file is used to redirect visitors to the latest version of the docs -->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/5.0.0-beta.1/" />
6
+ </head>
7
+ <body>
8
+ </body>
9
+ </html>
@@ -67,15 +67,9 @@ global.offeringsStub = {
67
67
  weekly: {
68
68
  offeringIdentifier: 'default',
69
69
  product: {
70
- intro_price_period_number_of_units: 7,
71
- intro_price_period_unit: 'DAY',
72
- intro_price_cycles: 3,
73
- intro_price_period: 'P1W',
74
- intro_price_string: '$4.99',
75
- intro_price: 4.99,
76
70
  description: 'Product with intro price',
77
- currency_code: 'USD',
78
- price_string: '$9.99',
71
+ currencyCode: 'USD',
72
+ priceString: '$9.99',
79
73
  price: 9.99,
80
74
  title: 'Introductory Price (PurchasesSample)',
81
75
  identifier: 'introductory_price'
@@ -87,15 +81,17 @@ global.offeringsStub = {
87
81
  twoMonth: {
88
82
  offeringIdentifier: 'default',
89
83
  product: {
90
- intro_price_period_number_of_units: 16,
91
- intro_price_period_unit: 'DAY',
92
- intro_price_cycles: 1,
93
- intro_price_period: 'P2W2D',
94
- intro_price_string: '$0.00',
95
- intro_price: 0,
84
+ introPrice: {
85
+ periodNumberOfUnits: 16,
86
+ periodUnit: 'DAY',
87
+ cycles: 1,
88
+ period: 'P2W2D',
89
+ priceString: '$0.00',
90
+ price: 0
91
+ },
96
92
  description: 'The best service, annually.',
97
- currency_code: 'USD',
98
- price_string: '$19.99',
93
+ currencyCode: 'USD',
94
+ priceString: '$19.99',
99
95
  price: 19.99,
100
96
  title: 'Annual Free Trial (PurchasesSample)',
101
97
  identifier: 'annual_freetrial'
@@ -106,15 +102,17 @@ global.offeringsStub = {
106
102
  threeMonth: {
107
103
  offeringIdentifier: 'default',
108
104
  product: {
109
- intro_price_period_number_of_units: 16,
110
- intro_price_period_unit: 'DAY',
111
- intro_price_cycles: 1,
112
- intro_price_period: 'P2W2D',
113
- intro_price_string: '$0.00',
114
- intro_price: 0,
105
+ introPrice: {
106
+ periodNumberOfUnits: 16,
107
+ periodUnit: 'DAY',
108
+ cycles: 1,
109
+ period: 'P2W2D',
110
+ priceString: '$0.00',
111
+ price: 0
112
+ },
115
113
  description: 'The best service, annually.',
116
- currency_code: 'USD',
117
- price_string: '$19.99',
114
+ currencyCode: 'USD',
115
+ priceString: '$19.99',
118
116
  price: 19.99,
119
117
  title: 'Annual Free Trial (PurchasesSample)',
120
118
  identifier: 'annual_freetrial'
@@ -125,15 +123,17 @@ global.offeringsStub = {
125
123
  sixMonth: {
126
124
  offeringIdentifier: 'default',
127
125
  product: {
128
- intro_price_period_number_of_units: 16,
129
- intro_price_period_unit: 'DAY',
130
- intro_price_cycles: 1,
131
- intro_price_period: 'P2W2D',
132
- intro_price_string: '$0.00',
133
- intro_price: 0,
126
+ introPrice: {
127
+ periodNumberOfUnits: 16,
128
+ periodUnit: 'DAY',
129
+ cycles: 1,
130
+ period: 'P2W2D',
131
+ priceString: '$0.00',
132
+ price: 0
133
+ },
134
134
  description: 'The best service, annually.',
135
- currency_code: 'USD',
136
- price_string: '$19.99',
135
+ currencyCode: 'USD',
136
+ priceString: '$19.99',
137
137
  price: 19.99,
138
138
  title: 'Annual Free Trial (PurchasesSample)',
139
139
  identifier: 'annual_freetrial'
@@ -144,15 +144,17 @@ global.offeringsStub = {
144
144
  annual: {
145
145
  offeringIdentifier: 'default',
146
146
  product: {
147
- intro_price_period_number_of_units: 16,
148
- intro_price_period_unit: 'DAY',
149
- intro_price_cycles: 1,
150
- intro_price_period: 'P2W2D',
151
- intro_price_string: '$0.00',
152
- intro_price: 0,
147
+ introPrice: {
148
+ periodNumberOfUnits: 16,
149
+ periodUnit: 'DAY',
150
+ cycles: 1,
151
+ period: 'P2W2D',
152
+ priceString: '$0.00',
153
+ price: 0
154
+ },
153
155
  description: 'The best service, annually.',
154
- currency_code: 'USD',
155
- price_string: '$19.99',
156
+ currencyCode: 'USD',
157
+ priceString: '$19.99',
156
158
  price: 19.99,
157
159
  title: 'Annual Free Trial (PurchasesSample)',
158
160
  identifier: 'annual_freetrial'
@@ -163,15 +165,10 @@ global.offeringsStub = {
163
165
  lifetime: {
164
166
  offeringIdentifier: 'default',
165
167
  product: {
166
- intro_price_period_number_of_units: null,
167
- intro_price_period_unit: null,
168
- intro_price_cycles: null,
169
- intro_price_period: null,
170
- intro_price_string: null,
171
- intro_price: null,
168
+ introPrice: null,
172
169
  description: 'you can eat it many times',
173
- currency_code: 'USD',
174
- price_string: '$4.99',
170
+ currencyCode: 'USD',
171
+ priceString: '$4.99',
175
172
  price: 4.99,
176
173
  title: 'Consumable (PurchasesSample)',
177
174
  identifier: 'consumable'
@@ -183,15 +180,17 @@ global.offeringsStub = {
183
180
  {
184
181
  offeringIdentifier: 'default',
185
182
  product: {
186
- intro_price_period_number_of_units: 16,
187
- intro_price_period_unit: 'DAY',
188
- intro_price_cycles: 1,
189
- intro_price_period: 'P2W2D',
190
- intro_price_string: '$0.00',
191
- intro_price: 0,
183
+ introPrice: {
184
+ periodNumberOfUnits: 16,
185
+ periodUnit: 'DAY',
186
+ cycles: 1,
187
+ period: 'P2W2D',
188
+ priceString: '$0.00',
189
+ price: 0
190
+ },
192
191
  description: 'The best service, annually.',
193
- currency_code: 'USD',
194
- price_string: '$19.99',
192
+ currencyCode: 'USD',
193
+ priceString: '$19.99',
195
194
  price: 19.99,
196
195
  title: 'Annual Free Trial (PurchasesSample)',
197
196
  identifier: 'annual_freetrial'
@@ -202,15 +201,17 @@ global.offeringsStub = {
202
201
  {
203
202
  offeringIdentifier: 'default',
204
203
  product: {
205
- intro_price_period_number_of_units: 16,
206
- intro_price_period_unit: 'DAY',
207
- intro_price_cycles: 1,
208
- intro_price_period: 'P2W2D',
209
- intro_price_string: '$0.00',
210
- intro_price: 0,
204
+ introPrice: {
205
+ periodNumberOfUnits: 16,
206
+ periodUnit: 'DAY',
207
+ cycles: 1,
208
+ period: 'P2W2D',
209
+ priceString: '$0.00',
210
+ price: 0
211
+ },
211
212
  description: 'The best service, annually.',
212
- currency_code: 'USD',
213
- price_string: '$19.99',
213
+ currencyCode: 'USD',
214
+ priceString: '$19.99',
214
215
  price: 19.99,
215
216
  title: 'Annual Free Trial (PurchasesSample)',
216
217
  identifier: 'annual_freetrial'
@@ -221,15 +222,17 @@ global.offeringsStub = {
221
222
  {
222
223
  offeringIdentifier: 'default',
223
224
  product: {
224
- intro_price_period_number_of_units: 16,
225
- intro_price_period_unit: 'DAY',
226
- intro_price_cycles: 1,
227
- intro_price_period: 'P2W2D',
228
- intro_price_string: '$0.00',
229
- intro_price: 0,
225
+ introPrice: {
226
+ periodNumberOfUnits: 16,
227
+ periodUnit: 'DAY',
228
+ cycles: 1,
229
+ period: 'P2W2D',
230
+ priceString: '$0.00',
231
+ price: 0
232
+ },
230
233
  description: 'The best service, annually.',
231
- currency_code: 'USD',
232
- price_string: '$19.99',
234
+ currencyCode: 'USD',
235
+ priceString: '$19.99',
233
236
  price: 19.99,
234
237
  title: 'Annual Free Trial (PurchasesSample)',
235
238
  identifier: 'annual_freetrial'
@@ -240,15 +243,17 @@ global.offeringsStub = {
240
243
  {
241
244
  offeringIdentifier: 'default',
242
245
  product: {
243
- intro_price_period_number_of_units: 16,
244
- intro_price_period_unit: 'DAY',
245
- intro_price_cycles: 1,
246
- intro_price_period: 'P2W2D',
247
- intro_price_string: '$0.00',
248
- intro_price: 0,
246
+ introPrice: {
247
+ periodNumberOfUnits: 16,
248
+ periodUnit: 'DAY',
249
+ cycles: 1,
250
+ period: 'P2W2D',
251
+ priceString: '$0.00',
252
+ price: 0
253
+ },
249
254
  description: 'The best service, annually.',
250
- currency_code: 'USD',
251
- price_string: '$19.99',
255
+ currencyCode: 'USD',
256
+ priceString: '$19.99',
252
257
  price: 19.99,
253
258
  title: 'Annual Free Trial (PurchasesSample)',
254
259
  identifier: 'annual_freetrial'
@@ -259,15 +264,17 @@ global.offeringsStub = {
259
264
  {
260
265
  offeringIdentifier: 'default',
261
266
  product: {
262
- intro_price_period_number_of_units: 7,
263
- intro_price_period_unit: 'DAY',
264
- intro_price_cycles: 3,
265
- intro_price_period: 'P1W',
266
- intro_price_string: '$4.99',
267
- intro_price: 4.99,
267
+ introPrice: {
268
+ periodNumberOfUnits: 7,
269
+ periodUnit: 'DAY',
270
+ cycles: 3,
271
+ period: 'P1W',
272
+ priceString: '$4.99',
273
+ price: 4.99
274
+ },
268
275
  description: 'Product with intro price',
269
- currency_code: 'USD',
270
- price_string: '$9.99',
276
+ currencyCode: 'USD',
277
+ priceString: '$9.99',
271
278
  price: 9.99,
272
279
  title: 'Introductory Price (PurchasesSample)',
273
280
  identifier: 'introductory_price'
@@ -278,15 +285,10 @@ global.offeringsStub = {
278
285
  {
279
286
  offeringIdentifier: 'default',
280
287
  product: {
281
- intro_price_period_number_of_units: null,
282
- intro_price_period_unit: null,
283
- intro_price_cycles: null,
284
- intro_price_period: null,
285
- intro_price_string: null,
286
- intro_price: null,
288
+ introPrice: null,
287
289
  description: 'you can eat it many times',
288
- currency_code: 'USD',
289
- price_string: '$4.99',
290
+ currencyCode: 'USD',
291
+ priceString: '$4.99',
290
292
  price: 4.99,
291
293
  title: 'Consumable (PurchasesSample)',
292
294
  identifier: 'consumable'
@@ -297,15 +299,17 @@ global.offeringsStub = {
297
299
  {
298
300
  offeringIdentifier: 'default',
299
301
  product: {
300
- intro_price_period_number_of_units: 16,
301
- intro_price_period_unit: 'DAY',
302
- intro_price_cycles: 1,
303
- intro_price_period: 'P2W2D',
304
- intro_price_string: '$0.00',
305
- intro_price: 0,
302
+ introPrice: {
303
+ periodNumberOfUnits: 16,
304
+ periodUnit: 'DAY',
305
+ cycles: 1,
306
+ period: 'P2W2D',
307
+ priceString: '$0.00',
308
+ price: 0
309
+ },
306
310
  description: 'The best service, annually.',
307
- currency_code: 'USD',
308
- price_string: '$19.99',
311
+ currencyCode: 'USD',
312
+ priceString: '$19.99',
309
313
  price: 19.99,
310
314
  title: 'Annual Free Trial (PurchasesSample)',
311
315
  identifier: 'annual_freetrial'
@@ -323,15 +327,17 @@ global.offeringsStub = {
323
327
  monthly: {
324
328
  offeringIdentifier: 'test',
325
329
  product: {
326
- intro_price_period_number_of_units: 7,
327
- intro_price_period_unit: 'DAY',
328
- intro_price_cycles: 3,
329
- intro_price_period: 'P1W',
330
- intro_price_string: '$4.99',
331
- intro_price: 4.99,
330
+ introPrice: {
331
+ periodNumberOfUnits: 7,
332
+ periodUnit: 'DAY',
333
+ cycles: 3,
334
+ period: 'P1W',
335
+ priceString: '$4.99',
336
+ price: 4.99
337
+ },
332
338
  description: 'Product with intro price',
333
- currency_code: 'USD',
334
- price_string: '$9.99',
339
+ currencyCode: 'USD',
340
+ priceString: '$9.99',
335
341
  price: 9.99,
336
342
  title: 'Introductory Price (PurchasesSample)',
337
343
  identifier: 'introductory_price'
@@ -348,15 +354,17 @@ global.offeringsStub = {
348
354
  {
349
355
  offeringIdentifier: 'test',
350
356
  product: {
351
- intro_price_period_number_of_units: 7,
352
- intro_price_period_unit: 'DAY',
353
- intro_price_cycles: 3,
354
- intro_price_period: 'P1W',
355
- intro_price_string: '$4.99',
356
- intro_price: 4.99,
357
+ introPrice: {
358
+ periodNumberOfUnits: 7,
359
+ periodUnit: 'DAY',
360
+ cycles: 3,
361
+ period: 'P1W',
362
+ priceString: '$4.99',
363
+ price: 4.99
364
+ },
357
365
  description: 'Product with intro price',
358
- currency_code: 'USD',
359
- price_string: '$9.99',
366
+ currencyCode: 'USD',
367
+ priceString: '$9.99',
360
368
  price: 9.99,
361
369
  title: 'Introductory Price (PurchasesSample)',
362
370
  identifier: 'introductory_price'
@@ -372,15 +380,17 @@ global.offeringsStub = {
372
380
  weekly: {
373
381
  offeringIdentifier: 'default',
374
382
  product: {
375
- intro_price_period_number_of_units: 7,
376
- intro_price_period_unit: 'DAY',
377
- intro_price_cycles: 3,
378
- intro_price_period: 'P1W',
379
- intro_price_string: '$4.99',
380
- intro_price: 4.99,
383
+ introPrice: {
384
+ periodNumberOfUnits: 7,
385
+ periodUnit: 'DAY',
386
+ cycles: 3,
387
+ period: 'P1W',
388
+ priceString: '$4.99',
389
+ price: 4.99
390
+ },
381
391
  description: 'Product with intro price',
382
- currency_code: 'USD',
383
- price_string: '$9.99',
392
+ currencyCode: 'USD',
393
+ priceString: '$9.99',
384
394
  price: 9.99,
385
395
  title: 'Introductory Price (PurchasesSample)',
386
396
  identifier: 'introductory_price'
@@ -392,15 +402,17 @@ global.offeringsStub = {
392
402
  twoMonth: {
393
403
  offeringIdentifier: 'default',
394
404
  product: {
395
- intro_price_period_number_of_units: 16,
396
- intro_price_period_unit: 'DAY',
397
- intro_price_cycles: 1,
398
- intro_price_period: 'P2W2D',
399
- intro_price_string: '$0.00',
400
- intro_price: 0,
405
+ introPrice: {
406
+ periodNumberOfUnits: 16,
407
+ periodUnit: 'DAY',
408
+ cycles: 1,
409
+ period: 'P2W2D',
410
+ priceString: '$0.00',
411
+ price: 0
412
+ },
401
413
  description: 'The best service, annually.',
402
- currency_code: 'USD',
403
- price_string: '$19.99',
414
+ currencyCode: 'USD',
415
+ priceString: '$19.99',
404
416
  price: 19.99,
405
417
  title: 'Annual Free Trial (PurchasesSample)',
406
418
  identifier: 'annual_freetrial'
@@ -411,15 +423,17 @@ global.offeringsStub = {
411
423
  threeMonth: {
412
424
  offeringIdentifier: 'default',
413
425
  product: {
414
- intro_price_period_number_of_units: 16,
415
- intro_price_period_unit: 'DAY',
416
- intro_price_cycles: 1,
417
- intro_price_period: 'P2W2D',
418
- intro_price_string: '$0.00',
419
- intro_price: 0,
426
+ introPrice: {
427
+ periodNumberOfUnits: 16,
428
+ periodUnit: 'DAY',
429
+ cycles: 1,
430
+ period: 'P2W2D',
431
+ priceString: '$0.00',
432
+ price: 0
433
+ },
420
434
  description: 'The best service, annually.',
421
- currency_code: 'USD',
422
- price_string: '$19.99',
435
+ currencyCode: 'USD',
436
+ priceString: '$19.99',
423
437
  price: 19.99,
424
438
  title: 'Annual Free Trial (PurchasesSample)',
425
439
  identifier: 'annual_freetrial'
@@ -430,15 +444,17 @@ global.offeringsStub = {
430
444
  sixMonth: {
431
445
  offeringIdentifier: 'default',
432
446
  product: {
433
- intro_price_period_number_of_units: 16,
434
- intro_price_period_unit: 'DAY',
435
- intro_price_cycles: 1,
436
- intro_price_period: 'P2W2D',
437
- intro_price_string: '$0.00',
438
- intro_price: 0,
447
+ introPrice: {
448
+ periodNumberOfUnits: 16,
449
+ periodUnit: 'DAY',
450
+ cycles: 1,
451
+ period: 'P2W2D',
452
+ priceString: '$0.00',
453
+ price: 0
454
+ },
439
455
  description: 'The best service, annually.',
440
- currency_code: 'USD',
441
- price_string: '$19.99',
456
+ currencyCode: 'USD',
457
+ priceString: '$19.99',
442
458
  price: 19.99,
443
459
  title: 'Annual Free Trial (PurchasesSample)',
444
460
  identifier: 'annual_freetrial'
@@ -449,15 +465,17 @@ global.offeringsStub = {
449
465
  annual: {
450
466
  offeringIdentifier: 'default',
451
467
  product: {
452
- intro_price_period_number_of_units: 16,
453
- intro_price_period_unit: 'DAY',
454
- intro_price_cycles: 1,
455
- intro_price_period: 'P2W2D',
456
- intro_price_string: '$0.00',
457
- intro_price: 0,
468
+ introPrice: {
469
+ periodNumberOfUnits: 16,
470
+ periodUnit: 'DAY',
471
+ cycles: 1,
472
+ period: 'P2W2D',
473
+ priceString: '$0.00',
474
+ price: 0
475
+ },
458
476
  description: 'The best service, annually.',
459
- currency_code: 'USD',
460
- price_string: '$19.99',
477
+ currencyCode: 'USD',
478
+ priceString: '$19.99',
461
479
  price: 19.99,
462
480
  title: 'Annual Free Trial (PurchasesSample)',
463
481
  identifier: 'annual_freetrial'
@@ -468,15 +486,10 @@ global.offeringsStub = {
468
486
  lifetime: {
469
487
  offeringIdentifier: 'default',
470
488
  product: {
471
- intro_price_period_number_of_units: null,
472
- intro_price_period_unit: null,
473
- intro_price_cycles: null,
474
- intro_price_period: null,
475
- intro_price_string: null,
476
- intro_price: null,
489
+ introPrice: null,
477
490
  description: 'you can eat it many times',
478
- currency_code: 'USD',
479
- price_string: '$4.99',
491
+ currencyCode: 'USD',
492
+ priceString: '$4.99',
480
493
  price: 4.99,
481
494
  title: 'Consumable (PurchasesSample)',
482
495
  identifier: 'consumable'
@@ -488,15 +501,17 @@ global.offeringsStub = {
488
501
  {
489
502
  offeringIdentifier: 'default',
490
503
  product: {
491
- intro_price_period_number_of_units: 16,
492
- intro_price_period_unit: 'DAY',
493
- intro_price_cycles: 1,
494
- intro_price_period: 'P2W2D',
495
- intro_price_string: '$0.00',
496
- intro_price: 0,
504
+ introPrice: {
505
+ periodNumberOfUnits: 16,
506
+ periodUnit: 'DAY',
507
+ cycles: 1,
508
+ period: 'P2W2D',
509
+ priceString: '$0.00',
510
+ price: 0
511
+ },
497
512
  description: 'The best service, annually.',
498
- currency_code: 'USD',
499
- price_string: '$19.99',
513
+ currencyCode: 'USD',
514
+ priceString: '$19.99',
500
515
  price: 19.99,
501
516
  title: 'Annual Free Trial (PurchasesSample)',
502
517
  identifier: 'annual_freetrial'
@@ -507,15 +522,17 @@ global.offeringsStub = {
507
522
  {
508
523
  offeringIdentifier: 'default',
509
524
  product: {
510
- intro_price_period_number_of_units: 16,
511
- intro_price_period_unit: 'DAY',
512
- intro_price_cycles: 1,
513
- intro_price_period: 'P2W2D',
514
- intro_price_string: '$0.00',
515
- intro_price: 0,
525
+ introPrice: {
526
+ periodNumberOfUnits: 16,
527
+ periodUnit: 'DAY',
528
+ cycles: 1,
529
+ period: 'P2W2D',
530
+ priceString: '$0.00',
531
+ price: 0
532
+ },
516
533
  description: 'The best service, annually.',
517
- currency_code: 'USD',
518
- price_string: '$19.99',
534
+ currencyCode: 'USD',
535
+ priceString: '$19.99',
519
536
  price: 19.99,
520
537
  title: 'Annual Free Trial (PurchasesSample)',
521
538
  identifier: 'annual_freetrial'
@@ -526,15 +543,17 @@ global.offeringsStub = {
526
543
  {
527
544
  offeringIdentifier: 'default',
528
545
  product: {
529
- intro_price_period_number_of_units: 16,
530
- intro_price_period_unit: 'DAY',
531
- intro_price_cycles: 1,
532
- intro_price_period: 'P2W2D',
533
- intro_price_string: '$0.00',
534
- intro_price: 0,
546
+ introPrice: {
547
+ periodNumberOfUnits: 16,
548
+ periodUnit: 'DAY',
549
+ cycles: 1,
550
+ period: 'P2W2D',
551
+ priceString: '$0.00',
552
+ price: 0
553
+ },
535
554
  description: 'The best service, annually.',
536
- currency_code: 'USD',
537
- price_string: '$19.99',
555
+ currencyCode: 'USD',
556
+ priceString: '$19.99',
538
557
  price: 19.99,
539
558
  title: 'Annual Free Trial (PurchasesSample)',
540
559
  identifier: 'annual_freetrial'
@@ -545,15 +564,17 @@ global.offeringsStub = {
545
564
  {
546
565
  offeringIdentifier: 'default',
547
566
  product: {
548
- intro_price_period_number_of_units: 16,
549
- intro_price_period_unit: 'DAY',
550
- intro_price_cycles: 1,
551
- intro_price_period: 'P2W2D',
552
- intro_price_string: '$0.00',
553
- intro_price: 0,
567
+ introPrice: {
568
+ periodNumberOfUnits: 16,
569
+ periodUnit: 'DAY',
570
+ cycles: 1,
571
+ period: 'P2W2D',
572
+ priceString: '$0.00',
573
+ price: 0
574
+ },
554
575
  description: 'The best service, annually.',
555
- currency_code: 'USD',
556
- price_string: '$19.99',
576
+ currencyCode: 'USD',
577
+ priceString: '$19.99',
557
578
  price: 19.99,
558
579
  title: 'Annual Free Trial (PurchasesSample)',
559
580
  identifier: 'annual_freetrial'
@@ -564,15 +585,17 @@ global.offeringsStub = {
564
585
  {
565
586
  offeringIdentifier: 'default',
566
587
  product: {
567
- intro_price_period_number_of_units: 7,
568
- intro_price_period_unit: 'DAY',
569
- intro_price_cycles: 3,
570
- intro_price_period: 'P1W',
571
- intro_price_string: '$4.99',
572
- intro_price: 4.99,
588
+ introPrice: {
589
+ periodNumberOfUnits: 7,
590
+ periodUnit: 'DAY',
591
+ cycles: 3,
592
+ period: 'P1W',
593
+ priceString: '$4.99',
594
+ price: 4.99
595
+ },
573
596
  description: 'Product with intro price',
574
- currency_code: 'USD',
575
- price_string: '$9.99',
597
+ currencyCode: 'USD',
598
+ priceString: '$9.99',
576
599
  price: 9.99,
577
600
  title: 'Introductory Price (PurchasesSample)',
578
601
  identifier: 'introductory_price'
@@ -583,15 +606,10 @@ global.offeringsStub = {
583
606
  {
584
607
  offeringIdentifier: 'default',
585
608
  product: {
586
- intro_price_period_number_of_units: null,
587
- intro_price_period_unit: null,
588
- intro_price_cycles: null,
589
- intro_price_period: null,
590
- intro_price_string: null,
591
- intro_price: null,
609
+ introPrice: null,
592
610
  description: 'you can eat it many times',
593
- currency_code: 'USD',
594
- price_string: '$4.99',
611
+ currencyCode: 'USD',
612
+ priceString: '$4.99',
595
613
  price: 4.99,
596
614
  title: 'Consumable (PurchasesSample)',
597
615
  identifier: 'consumable'
@@ -602,15 +620,17 @@ global.offeringsStub = {
602
620
  {
603
621
  offeringIdentifier: 'default',
604
622
  product: {
605
- intro_price_period_number_of_units: 16,
606
- intro_price_period_unit: 'DAY',
607
- intro_price_cycles: 1,
608
- intro_price_period: 'P2W2D',
609
- intro_price_string: '$0.00',
610
- intro_price: 0,
623
+ introPrice: {
624
+ periodNumberOfUnits: 16,
625
+ periodUnit: 'DAY',
626
+ cycles: 1,
627
+ period: 'P2W2D',
628
+ priceString: '$0.00',
629
+ price: 0
630
+ },
611
631
  description: 'The best service, annually.',
612
- currency_code: 'USD',
613
- price_string: '$19.99',
632
+ currencyCode: 'USD',
633
+ priceString: '$19.99',
614
634
  price: 19.99,
615
635
  title: 'Annual Free Trial (PurchasesSample)',
616
636
  identifier: 'annual_freetrial'
@@ -626,16 +646,10 @@ global.offeringsStub = {
626
646
  };
627
647
 
628
648
  global.productStub = {
629
- currency_code: "USD",
630
- intro_price: null,
631
- intro_price_string: null,
632
- intro_price_period: null,
633
- intro_price_cycles: null,
634
- intro_price_period_unit: null,
635
- intro_price_period_number_of_units: null,
636
- discounts: null,
649
+ currencyCode: "USD",
637
650
  introPrice: null,
638
- price_string: "$0.99",
651
+ discounts: null,
652
+ priceString: "$0.99",
639
653
  price: 0.99,
640
654
  description: "The best service.",
641
655
  title: "One Month Free Trial",
@@ -678,7 +692,7 @@ NativeModules.RNPurchases = {
678
692
  getOfferings: jest.fn(),
679
693
  getProductInfo: jest.fn(),
680
694
  makePurchase: jest.fn(),
681
- restoreTransactions: jest.fn(),
695
+ restorePurchases: jest.fn(),
682
696
  getAppUserID: jest.fn(),
683
697
  setDebugLogsEnabled: jest.fn(),
684
698
  getCustomerInfo: jest.fn(),