Skip to content

Commit

Permalink
fix: mock data add montly
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed May 14, 2022
1 parent 2672be6 commit c09243f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "capacitor-purchases",
"version": "1.1.7",
"version": "1.1.8",
"description": "In-app Subscriptions Made Easy with RevenueCat sdk",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down
47 changes: 35 additions & 12 deletions src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,38 @@ import { WebPlugin } from '@capacitor/core';
import { PACKAGE_TYPE } from './definitions';
import type { CapacitorPurchasesPlugin, LogInResult, PurchaserInfo, Offerings, Offering, Package } from './definitions';

export const mockPack: Package = {
export const mockPackA: Package = {
identifier: 'com.example.test',
packageType: PACKAGE_TYPE.ANNUAL,
product: {
identifier: 'com.example.test',
identifier: 'com.example.yearly',
description: 'Test',
title: 'Test',
price: 0.99,
priceString: '$0.99',
price: 19.99,
priceString: '$19.99',
currencyCode: 'USD',
currencySymbol: '$',
isFamilyShareable: false,
subscriptionGroupIdentifier: 'com.example.test',
subscriptionPeriod: {
numberOfUnits: 1,
unit: 1,
},
introductoryPrice: null,
discounts: [],
},
offeringIdentifier: 'com.example.test.offering1'
}

export const mockPackM: Package = {
identifier: 'com.example.test',
packageType: PACKAGE_TYPE.MONTHLY,
product: {
identifier: 'com.example.monthly',
description: 'Test',
title: 'Test',
price: 3.99,
priceString: '$3.99',
currencyCode: 'USD',
currencySymbol: '$',
isFamilyShareable: false,
Expand All @@ -29,14 +52,14 @@ export const mockPack: Package = {
export const mockCurrent: Offering = {
identifier: 'com.example.test.offering1',
serverDescription: "Test offering",
availablePackages: [mockPack],
lifetime: mockPack,
annual: mockPack,
sixMonth: mockPack,
threeMonth: mockPack,
twoMonth: mockPack,
monthly: mockPack,
weekly: mockPack,
availablePackages: [mockPackA, mockPackM],
lifetime: null,
annual: mockPackA,
sixMonth: null,
threeMonth: null,
twoMonth: null,
monthly: mockPackM,
weekly: null,
};

export const mockPurchaserInfo: PurchaserInfo = {
Expand Down

0 comments on commit c09243f

Please sign in to comment.