/** * The wix-pricing-plans module contains functionality for working with * pricing plans from client-side code. * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.html#) */ declare module 'wix-pricing-plans' { import wixPricingPlansBackend from 'wix-pricing-plans-backend'; /** * The Pricing Plans Checkout API contains functionality for ordering, checking out, and purchasing * your site's pricing plan [orders](https://support.wix.com/en/article/pricing-plans-an-overview). * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.html#checkout) */ const checkout: Checkout; /** * The Pricing Plan Orders API provides functionality for managing pricing plan orders created in the Wix Pricing Plans app or using the Wix Pricing Plans API. * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.html#orders) */ const orders: Orders; /** * Contains functionality for ordering your site's pricing plans. * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.Checkout.html#) */ interface Checkout { /** * Orders a pricing plan. * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.Checkout.html#createOnlineOrder) */ createOnlineOrder(planId: string, options?: wixPricingPlansBackend.Checkout.CreateOnlineOrderOptions): Promise; /** * Orders and purchases a pricing plan. * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.Checkout.html#startOnlinePurchase) */ startOnlinePurchase(planId: string, options?: Checkout.StartOnlinePurchaseOptions): Promise; } /** * The Pricing Plans Orders API contains functionality for managing * your site's pricing plan [orders](https://support.wix.com/en/article/pricing-plans-an-overview). * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.Orders.html#) */ interface Orders { /** * Lists the orders for the currently logged-in member. * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.Orders.html#listCurrentMemberOrders) */ listCurrentMemberOrders(filters?: wixPricingPlansBackend.Orders.CurrentMemberFilterOptions, sorting?: wixPricingPlansBackend.Orders.SortingOptions, paging?: wixPricingPlansBackend.Orders.PaginationOptions): Promise; /** * Requests the cancellation of a specific order of a plan for the currently logged-in member. * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.Orders.html#requestCurrentMemberOrderCancellation) */ requestCurrentMemberOrderCancellation(orderId: string, effectiveAt: string): Promise; } /** * Contains functionality for ordering your site's pricing plans. * [Read more](https://www.wix.com/corvid/reference/wix-pricing-plans.Checkout.html#) */ namespace Checkout { type CreateOnlineOrderOptions = { /** * Start date and time for the ordered plan. * * Default: Current date and time */ startDate?: Date; /** * Coupon code to apply. * * To learn more about coupons, see [applyCoupon()](wix-pricing-plans-backend/checkout/applycoupon). */ couponCode?: string; }; /** * An object representing the period for which a plan is valid. */ type Period = { /** * The number of units until the plan expires. */ amount: number; /** * Time period for billing the plan, such as `"MONTH"`. */ unit: string; }; /** * An object representing the price of a purchased plan. */ type Price = { /** * Payment currency. A three-letter * [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. */ currency: string; /** * The cost of the plan. */ amount: number; }; /** * An object representing a purchase for a non-free plan. */ type Purchase = { /** * The order being purchased. */ order: wixPricingPlansBackend.Orders.Order; /** * Payment status in [Wix Pay](https://www.wix.com/velo/reference/wix-pay). Omitted for free plans. * One of: * + `"Successful"`: Payment was successfully received. * + `"Pending"`: Payment is pending payment provider approval. * + `"Failed"`: Payment has failed. * + `"Chargeback"`: Payment is chargeback. * + `"Refunded"`: Payment was fully refunded. * + `"Offline"`: Payment will be executed offline. * + `"PartiallyRefunded"`: Payment was partially refunded. * + `"Cancelled"`: Payment was cancelled and was not processed. * + `"Undefined"`: Payment status is pending payment provider input. */ wixPayStatus?: string; }; type StartOnlinePurchaseOptions = { /** * Start date and time for the ordered plan. * * Default: Current date and time */ startDate?: Date; /** * Coupon code to apply. * * To learn more about coupons, see [applyCoupon()](wix-pricing-plans-backend/checkout/applycoupon). */ couponCode?: string; }; /** * An object representing how long a plan is valid. */ type ValidFor = { /** * If true, the plan does not expire. */ forever: boolean; /** * Object containing the period for which the plan is valid. */ period: Checkout.Period; }; } }