Custom interface
Idea
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.
Requirements
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.
Implementation tips
The first time you set up a subscription, we recommend the following sequence of events:
- Create a new subscription and add
skm_temp_var
as metadata. The variable can contain anything (as long as it is not empty). - Call Create Key and record the
Key
. - Call GetKey with the
KeyString
set toKey
(from step 2) andProductId
set to the product that is associated with the subscription. Record theGlobalId
. - Update the subscription by setting
skm_key_globalid
to theGlobalId
(from step 3) and removeskm_temp_var
by setting it to empty string.
This should be it!