Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: migrate ProrationMode to ReplacementMode #2801

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/iap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ export const requestSubscription = (
const {
subscriptionOffers,
purchaseTokenAndroid,
prorationModeAndroid = -1,
replacementModeAndroid = -1,
obfuscatedAccountIdAndroid,
obfuscatedProfileIdAndroid,
isOfferPersonalized,
Expand All @@ -807,7 +807,7 @@ export const requestSubscription = (
ANDROID_ITEM_TYPE_SUBSCRIPTION,
subscriptionOffers?.map((so) => so.sku),
purchaseTokenAndroid,
prorationModeAndroid,
replacementModeAndroid,
obfuscatedAccountIdAndroid,
obfuscatedProfileIdAndroid,
subscriptionOffers?.map((so) => so.offerToken),
Expand Down
4 changes: 2 additions & 2 deletions src/modules/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
InstallSourceAndroid,
Product,
ProductType,
ProrationModesAndroid,
Purchase,
PurchaseResult,
ReplacementModesAndroid,
Sku,
} from '../types';
import type * as Android from '../types/android';
Expand Down Expand Up @@ -39,7 +39,7 @@ export type BuyItemByType = (
type: string,
skus: Sku[],
purchaseToken: string | undefined,
prorationMode: ProrationModesAndroid | -1,
replacementModeAndroid: ReplacementModesAndroid | -1,
obfuscatedAccountId: string | undefined,
obfuscatedProfileId: string | undefined,
subscriptionOffers: string[],
Expand Down
16 changes: 8 additions & 8 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import type * as Apple from './apple';

export type Sku = string;

export enum ProrationModesAndroid {
IMMEDIATE_WITH_TIME_PRORATION = 1,
IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,
IMMEDIATE_WITHOUT_PRORATION = 3,
DEFERRED = 4,
IMMEDIATE_AND_CHARGE_FULL_PRICE = 5,
UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,
export enum ReplacementModesAndroid {
UNKNOWN_REPLACEMENT_MODE = 0,
WITH_TIME_PRORATION = 1,
CHARGE_PRORATED_PRICE = 2,
WITHOUT_PRORATION = 3,
CHARGE_FULL_PRICE = 5,
DEFERRED = 6,
}

export enum PurchaseStateAndroid {
Expand Down Expand Up @@ -254,7 +254,7 @@ export interface SubscriptionOffer {

export interface RequestSubscriptionAndroid extends RequestPurchaseBaseAndroid {
purchaseTokenAndroid?: string;
prorationModeAndroid?: ProrationModesAndroid;
replacementModeAndroid?: ReplacementModesAndroid;
subscriptionOffers: SubscriptionOffer[];
}

Expand Down
Loading