Recurring billing module consists of two parts:
- an interface that allows your customers to manage subscriptions.
- a Stripe webhook endpoint that ensures that subscriptions in Stripe stay in sync with the licenses in Cryptolens.
If you want to manage subscriptions through your own interface, you can still take advantage of our webhook endpoint.
The webhook endpoint only requires that each subscription in Stripe has a metadata field
skm_key_globalid set to the
GlobalId of a license key.
This makes it possible for Cryptolens to tell which license key should be extended or blocked based on subscription related events.
The first time you set up a subscription, we recommend the following sequence of events:
- Create a new subscription and add
skm_temp_varas metadata. The variable can contain anything (as long as it is not empty).
- Call Create Key and record the
- Call GetKey with the
Key(from step 2) and
ProductIdset to the product that is associated with the subscription. Record the
- Update the subscription by setting
GlobalId(from step 3) and remove
skm_temp_varby setting it to empty string.
This should be it!