Integrating with external payment providers

Introduction

If you would like to process payments with a payment gateway that Cryptolens does not support out of the box, you can use several Web API methods to your help. In most cases, you only need to use license key related methods of our Web API, in particular:

  • Create Key - to issue a new license key
  • Extend License - to prolong an existing license (eg. when a subscription is renewed)
  • Block Key - block/delete a license (eg. if an invoice was not paid)
  • Add Feature - add more features to a license (eg. upgrade to new pricing tier)
  • Machine Lock Limit - change how many devices can use the license (eg. to allow activating on additional devices)

Typically, payment gateways will allow you to call an external URL upon a successful transaction. For example, if you use SendOwl or DPD, there is a way to provide a license url which is called when a payment is successful and the license key is then displayed to the customer. If you build the system yourself, you can either use our client APIs to the methods above or call the URL yourself.

Implementation

Pre-paid payments

Pre-paid payments are the easiest to implement. You can both sell your software on a perpetual basis (i.e. one-time payment) or as a subscription (e.g. customers need to obtain a new license every year).

One-time payments

If you sell licenses that should be valid in perpetuity, you only need to call the Create Key method when a transaction succeeds.

Subscriptions

If you sell a subscription, you can setting it up in to ways:

  1. Issue a new license with Create Key each time the customer prolongs their subscription
  2. Call Create Key the first time and later Extend License.

Recurring payments

Idea

If you either integrate with a platform that supports recurring payments (i.e. charges occur automatically every month) or build it yourself, we can use a similar approach as for subscriptions described earlier. When a subscription is set up, you can call Create Key and then Extend License each time the charge is successful. It is a good practice to add several days, i.e. if the billing period is 30 days, it better to extend the license for eg. 35 days to account for payment issues. When a subscription should be cancelled, you can call Block Key method.

Cryptolens backend with Stripe

Recurring billing module already offers a backend that communicates with Stripe to ensure that licenses are prolonged if a payment is received and blocked if a subscription is cancelled. If you do not want to use Cryptolens GUI, you can still take an advantage of the backend. More information can be found here.