When your customer purchases your app you can generate a product key with the number of activations they purchased. See: How to generate product keys after an order for pre-built examples. We recommend FastSpring because they have good support and it's relatively easy to use. But you can use any payment provider you want.