Main class for interacting with Iaptic's Stripe integration
This class handles all Stripe-related operations including product listing, checkout sessions, and subscription management.
Creates a new IapticStripe instance
Configuration options for the Stripe integration
Error if required configuration is missing
Changes a subscription plan
Plan change parameters
Promise resolving to the updated purchase details
This method handles immediate plan changes without requiring customer portal access
Clears all stored data including access tokens and cached products
Gets the current access token if one exists
The current access token or undefined if none exists
Gets a list of available products and their pricing
Promise resolving to an array of products
Results are cached locally. Use refreshProducts() to force a fresh fetch.
Gets the customer's purchase history
Optional
Optional access token (uses stored token if not provided)
Promise resolving to an array of purchases
This method will automatically schedule refresh operations for active subscriptions
Creates a new order and redirects to Stripe Checkout
Order parameters including product and URLs
Error if the checkout session creation fails
This method will redirect the user to Stripe's checkout page on success
Redirects to Stripe Customer Portal for subscription management
Portal parameters including return URL
Error if portal session creation fails
This method will redirect the user to Stripe's customer portal on success
Forces a refresh of the products list from the server
Main class for interacting with Iaptic's Stripe integration
Remarks
This class handles all Stripe-related operations including product listing, checkout sessions, and subscription management.