diff --git a/@types/jsb.d.ts b/@types/jsb.d.ts index 7ead95783e7..0da3a0a673d 100644 --- a/@types/jsb.d.ts +++ b/@types/jsb.d.ts @@ -1105,28 +1105,28 @@ declare namespace jsb { SUBS = 'subs' } - export namespace BillingFlowParams { - export interface ProductDetailsParamsBuilder { - setOfferToken: (purchaseToken: string) => ProductDetailsParamsBuilder; - setProductDetails: (productDetails: ProductDetails) => ProductDetailsParamsBuilder; - build: () => ProductDetailsParams; - } - export class ProductDetailsParams { - public static newBuilder(): ProductDetailsParamsBuilder; - } + export interface ProductDetailsParamsBuilder { + setOfferToken: (purchaseToken: string) => ProductDetailsParamsBuilder; + setProductDetails: (productDetails: ProductDetails) => ProductDetailsParamsBuilder; + build: () => ProductDetailsParams; + } + export class ProductDetailsParams { + newBuilder: () => ProductDetailsParamsBuilder; + } - export interface SubscriptionUpdateParamsBuilder { - setOldPurcchaseToken: (purchaseToken: string) => SubscriptionUpdateParamsBuilder; - setOriginalExternalTransactionId: (externalTransactionId: string) => SubscriptionUpdateParamsBuilder; - setSubscriptionReplacementMode: (subscriptionReplacementMode: number) => SubscriptionUpdateParamsBuilder; - build: () => SubscriptionUpdateParams; - } - export class SubscriptionUpdateParams { - public static newBuilder(): SubscriptionUpdateParamsBuilder; - } + export interface SubscriptionUpdateParamsBuilder { + setOldPurcchaseToken: (purchaseToken: string) => SubscriptionUpdateParamsBuilder; + setOriginalExternalTransactionId: (externalTransactionId: string) => SubscriptionUpdateParamsBuilder; + setSubscriptionReplacementMode: (subscriptionReplacementMode: number) => SubscriptionUpdateParamsBuilder; + build: () => SubscriptionUpdateParams; + } + export class SubscriptionUpdateParams { + newBuilder(): () => SubscriptionUpdateParamsBuilder; } export class BillingFlowParams { + static ProductDetailsParams: jsb.ProductDetailsParams; + static SubscriptionUpdateParams: jsb.SubscriptionUpdateParams; static Builder: BillingFlowParamsBuilder; public static newBuilder(): BillingFlowParamsBuilder; } @@ -1135,8 +1135,8 @@ declare namespace jsb { setIsOfferPersonalized: (isOfferPersonalized: boolean) => BillingFlowParamsBuilder; setObfuscatedAccountId: (obfuscatedAccountid: string) => BillingFlowParamsBuilder; setObfuscatedProfileId: (obfuscatedProfileId: string) => BillingFlowParamsBuilder; - setProductDetailsParamsList: (userChoiceBillingListener: BillingFlowParams.ProductDetailsParams[]) => BillingFlowParamsBuilder; - setSubscriptionUpdateParams: (userChoiceBillingListener: BillingFlowParams.SubscriptionUpdateParams) => BillingFlowParamsBuilder; + setProductDetailsParamsList: (userChoiceBillingListener: ProductDetailsParams[]) => BillingFlowParamsBuilder; + setSubscriptionUpdateParams: (userChoiceBillingListener: SubscriptionUpdateParams) => BillingFlowParamsBuilder; build: () => BillingFlowParams; } diff --git a/vendor/google/billing/billing.ts b/vendor/google/billing/billing.ts index 3f280caf354..f4e0cc7acff 100644 --- a/vendor/google/billing/billing.ts +++ b/vendor/google/billing/billing.ts @@ -26,70 +26,58 @@ import { EventTarget } from '../../../cocos/core/event'; export namespace google { export namespace billing { - export type UserChoiceDetails = jsb.UserChoiceDetails; - export type OneTimePurchaseOfferDetails = jsb.OneTimePurchaseOfferDetails; - export type InstallmentPlanDetails = jsb.InstallmentPlanDetails; - export type PricingPhase = jsb.PricingPhase; - export type SubscriptionOfferDetails = jsb.SubscriptionOfferDetails; - export type ProductDetails = jsb.ProductDetails; - export type AccountIdentifiers = jsb.AccountIdentifiers; - export type PendingPurchaseUpdate = jsb.PendingPurchaseUpdate; - export type Purchase = jsb.Purchase; - export type BillingConfig = jsb.BillingConfig; - export type AlternativeBillingOnlyReportingDetails = jsb.AlternativeBillingOnlyReportingDetails; - export type ExternalOfferReportingDetails = jsb.ExternalOfferReportingDetails; - export type InAppMessageResult = jsb.InAppMessageResult; - /** - * @en Params containing the response code and the debug message from In-app Billing API response. - * @zh 包含应用内结算 API 响应代码和调试信息的参数 - */ - - // export namespace BillingClient { - // export type Builder = jsb.BillingClientBuilder; - // } - export type BillingClient = jsb.BillingClient; export const BillingClient = jsb.BillingClient; - // export namespace BillingResult { - // export type Builder = jsb.BillingResultBuilder; - // } - export type BillingResult = jsb.BillingResult; export const BillingResult = jsb.BillingResult; - export type PendingPurchasesParams = jsb.PendingPurchasesParams; export const PendingPurchasesParams = jsb.PendingPurchasesParams; - export type QueryProductDetailsParams = jsb.QueryProductDetailsParams; + export const ProductDetailsParams = jsb.ProductDetailsParams; export const QueryProductDetailsParams = jsb.QueryProductDetailsParams; - export type Product = jsb.Product; export const Product = jsb.Product; - - // export namespace BillingFlowParams { - // export type Builder = jsb.BillingFlowParamsBuilder; - // export type SubscriptionUpdateParams = jsb.BillingFlowParams.SubscriptionUpdateParams; - // export type ProductDetailsParams = jsb.BillingFlowParams.ProductDetailsParams; - // } - export type BillingFlowParams = jsb.BillingFlowParams; - //export type IBillingFlowParams = jsb.IBillingFlowParams; - //export const BillingFlowParams: typeof jsb.IBillingFlowParams = jsb.BillingFlowParams; export const BillingFlowParams: typeof jsb.BillingFlowParams = jsb.BillingFlowParams; - export type ConsumeParams = jsb.ConsumeParams; export const ConsumeParams = jsb.ConsumeParams; - - export type AcknowledgePurchaseParams = jsb.AcknowledgePurchaseParams; export const AcknowledgePurchaseParams = jsb.AcknowledgePurchaseParams; - - export type QueryPurchasesParams = jsb.QueryPurchasesParams; export const QueryPurchasesParams = jsb.QueryPurchasesParams; - - export type InAppMessageParams = jsb.InAppMessageParams; export const InAppMessageParams = jsb.InAppMessageParams; - - export type GetBillingConfigParams = jsb.GetBillingConfigParams; export const GetBillingConfigParams = jsb.GetBillingConfigParams; } } + +export declare namespace google { + export namespace billing { + export type UserChoiceDetails = jsb.UserChoiceDetails; + export type OneTimePurchaseOfferDetails = jsb.OneTimePurchaseOfferDetails; + export type InstallmentPlanDetails = jsb.InstallmentPlanDetails; + export type PricingPhase = jsb.PricingPhase; + export type SubscriptionOfferDetails = jsb.SubscriptionOfferDetails; + export type ProductDetails = jsb.ProductDetails; + export type AccountIdentifiers = jsb.AccountIdentifiers; + export type PendingPurchaseUpdate = jsb.PendingPurchaseUpdate; + export type Purchase = jsb.Purchase; + export type BillingConfig = jsb.BillingConfig; + export type AlternativeBillingOnlyReportingDetails = jsb.AlternativeBillingOnlyReportingDetails; + export type ExternalOfferReportingDetails = jsb.ExternalOfferReportingDetails; + export type InAppMessageResult = jsb.InAppMessageResult; + export type BillingClient = jsb.BillingClient; + export type BillingResult = jsb.BillingResult; + export type PendingPurchasesParams = jsb.PendingPurchasesParams; + export type QueryProductDetailsParams = jsb.QueryProductDetailsParams; + export type Product = jsb.Product; + export namespace BillingFlowParams { + //export type Builder = typeof jsb.BillingFlowParamsBuilder; + export type SubscriptionUpdateParams = typeof jsb.SubscriptionUpdateParams; + export type ProductDetailsParams = typeof jsb.ProductDetailsParams; + } + export type BillingFlowParams = typeof jsb.BillingFlowParams; + export type ConsumeParams = jsb.ConsumeParams; + export type AcknowledgePurchaseParams = jsb.AcknowledgePurchaseParams; + export type QueryPurchasesParams = jsb.QueryPurchasesParams; + export type InAppMessageParams = jsb.InAppMessageParams; + export type GetBillingConfigParams = jsb.GetBillingConfigParams; + } +} // export declare namespace BillingFlowParams { // export type Builder = jsb.BillingFlowParamsBuilder; // export type SubscriptionUpdateParams = jsb.SubscriptionUpdateParams;