mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-05-21 03:34:11 +08:00
feat(in-app-purchase-2): feat(in-app-purchase-2): update types and add getApplicationUsername function (#3320)
* Fixing interface types. * Adding applicationUsername.
This commit is contained in:
parent
2d1e2db9cd
commit
664e257442
@ -39,7 +39,7 @@ export interface IAPProduct {
|
||||
|
||||
description: string;
|
||||
|
||||
priceMicros: string;
|
||||
priceMicros: number;
|
||||
|
||||
price: string;
|
||||
|
||||
@ -57,9 +57,9 @@ export interface IAPProduct {
|
||||
|
||||
downloaded?: boolean;
|
||||
|
||||
lastRenewalDate?: Date;
|
||||
lastRenewalDate?: string;
|
||||
|
||||
expiryDate?: Date;
|
||||
expiryDate?: string;
|
||||
|
||||
introPrice?: string;
|
||||
|
||||
@ -156,41 +156,41 @@ export interface IAPProduct {
|
||||
|
||||
export interface IAPProductEvents {
|
||||
/** Called when product data is loaded from the store. */
|
||||
loaded: (callback: IAPQueryCallback) => void;
|
||||
loaded: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when any change occured to a product. */
|
||||
updated: (callback: IAPQueryCallback) => void;
|
||||
updated: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when an order failed. The `err` parameter is an IAPError object. */
|
||||
error: (callback: IAPQueryCallback) => void;
|
||||
error: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when a product order is approved. */
|
||||
approved: (callback: IAPQueryCallback) => void;
|
||||
approved: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when a non-consumable product or subscription is owned. */
|
||||
owned: (callback: IAPQueryCallback) => void;
|
||||
owned: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when a product order is cancelled by the user. */
|
||||
cancelled: (callback: IAPQueryCallback) => void;
|
||||
cancelled: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when an order is refunded by the user. */
|
||||
refunded: (callback: IAPQueryCallback) => void;
|
||||
refunded: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when product has just been registered. */
|
||||
registered: (callback: IAPQueryCallback) => void;
|
||||
registered: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when the product details have been successfully loaded. */
|
||||
valid: (callback: IAPQueryCallback) => void;
|
||||
valid: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when the product cannot be loaded from the store. */
|
||||
invalid: (callback: IAPQueryCallback) => void;
|
||||
invalid: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when an order has just been requested. */
|
||||
requested: (callback: IAPQueryCallback) => void;
|
||||
requested: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when the purchase process has been initiated. */
|
||||
initiated: (callback: IAPQueryCallback) => void;
|
||||
initiated: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when the purchase process has completed. */
|
||||
finished: (callback: IAPQueryCallback) => void;
|
||||
finished: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when receipt validation successful. */
|
||||
verified: (callback: IAPQueryCallback) => void;
|
||||
verified: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when receipt verification failed. */
|
||||
unverified: (callback: IAPQueryCallback) => void;
|
||||
unverified: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when validation find a subscription to be expired. */
|
||||
expired: (callback: IAPQueryCallback) => void;
|
||||
expired: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
/** Called when content download is started. */
|
||||
downloading: (product: IAPProduct, progress: any, time_remaining: any) => void;
|
||||
downloading: (product: IAPProduct, progress: any, time_remaining: any) => IAPProductEvents;
|
||||
/** Called when content download has successfully completed. */
|
||||
downloaded: (callback: IAPQueryCallback) => void;
|
||||
downloaded: (callback: IAPQueryCallback) => IAPProductEvents;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -731,6 +731,14 @@ export class InAppPurchase2 extends IonicNativePlugin {
|
||||
@CordovaProperty()
|
||||
validator: string | ((url: string | IAPProduct, callback: Function) => void);
|
||||
|
||||
@CordovaProperty()
|
||||
applicationUsername: string | (() => string);
|
||||
|
||||
@Cordova({ sync: true })
|
||||
getApplicationUsername(): string {
|
||||
return;
|
||||
}
|
||||
|
||||
@CordovaProperty()
|
||||
log: {
|
||||
error: (message: string) => void;
|
||||
|
Loading…
x
Reference in New Issue
Block a user