📄️ PricingContext
This abstract class is the key to manage the YAML configuration inside a spring app. It provides a set of configurable methods that need to be implemented inside a new component that extends this class to use other classes of the package. Inside your spring project, create the following component:
🗃️ Classes to Manage Pricing
5 items
📄️ YamlUtils
This class contains two static methods that can be used to parse the YAML specification of a pricing in the Pricing2Yaml syntax to a PricingManager object and vice versa. To extract the information of the YAML file:
📄️ RenewTokenFilter
The RenewTokenFilter is a org.springframework.web.filter.OncePerRequestFilter Spring filter that serves as the Feature Checker component of Pricing4SaaS. It filters incoming requests to determine which ones are consistent with the current pricing configuration, saving the server from unnecessary business logic execution.
📄️ PricingEvaluatorUtil
It can be used to evaluate the context of an user compared to his plan and generate a JWT with the results, using a single java method. This class consumes the information of the configured PricingContext to perform its operations.
📄️ PricingService
This class offers a set of methods that can be used to manage the pricing configuration without manually modifying the YAML file. It can be used to retrieve, add, remove or modify plans and features.
📄️ PricingPlanAware
The library also provides an method level annotation called @PricingPlanAware that receives a string called featureId as paramater. This feature must exist inside the pricing configuration.