Error 500 (Internal Server Error) Creating Licence - generate-license.php

Followed the instructions on creating a licence and currently using a webhook from Stripe to try to generate a licence when a customer is created, but no joy so far. Keep getting Error 500 (Internal Server Error)…

So far

  • Added $CRYPTLEX_SECRET to .php file
  • Included ***.php?cryptlex_secret= in URL endpoint
  • Added $PERSONAL_ACCESS_TOKEN with correct privileges - license:write, user:read, user:write
  • Added Webhook details to Stripe, specified generate-license.php?cryptlex_secret=**** as URL

RESULT: After creating a customer, Error 500 displayed
******* is currently unable to handle this request.**
HTTP ERROR 500

STRIPE: Webhook details

URL: https:///generate-license.php?cryptlex_secret=*
Description: To create licence in Cryptlex after a new customer is created
Event types: customer.created

Is there something missing? As it seems more like trial and error at the moment.

Hi,

The php script you are using is crashing. You need to debug it. I would recommend running the script locally and using stripe-cli to simulate the events.

Thank you. Has anyone actually successfully tested this with a real Stripe account? Or is it just assumed that it works?

So according to https://docs.cryptlex.com/web-integration/using-web-api -> “You can easily automate the order process of your product”, licensing solution looks good but sorry not as easy as described (read other similar posts too on the forum asking for more details on automating licence creation). Either we have to issue the licences manually or we’ll permanently switch to another licensing solution.
Thanks anyway

Final little suggestion from here: Automatically creating licences is probably a critical requirement for end-users using Cryptlex, it would be good to perhaps spend some time expanding the technical documentation in that area with real examples. For example, Stripe use some dummy test data to show clear examples or scenarios. I’ve seen the Github example, but as indicated above it’s not too helpful in this specific scenario.

Maybe there’s a way to further simplify the automation of licence creation.

The php example assumes you will do the data mapping from Stripe yourself. The default mapping is for FastSpring. Maybe this will help, it is for stripe:

I agree there should be more examples. We are actually planning to support the popular e-commerce solutions natively, but that will take some time.

I agree this is great software but I am finding it impossible to understand how I can get the license activated using payment.succeed in Stripe and then how I would then pass the key to customer and the download url too.
It needs some flow diagrams and specific links to where the detail solutions can be found to implement everything else that is required to get this to work with payments etc.

Always a treat to follow up stuff that include stripe PHP and payment method, as I’m recently studying about this would love to share my thoughts on it. I have found the stripe community great and its API are ideally generating business for a custome online-ecommerce experience. Thanks for sharing:)

The error is too generic and does not tell you exact problem. What you need is to find out what is the real issue. If your site is serving a Internal Server Error, this can be caused by a number of things, such

as:

  • Errors in .htaccess files
  • Server permission
  • Server timeout
  • Script timeout
  • Or some other Web Server Issues

Normally, a permissions issue on the file (or files) would be one cause of the 500 Internal Server Error. The simple solution is to run chmod 644 on the problem file(s) or chmod 755 on the directories.

$ sudo chmod -R 777 /"your files location"

The best way to debug the error depends upon the server and what’s actually running at the time. Consider some debugging tips to help diagnose and fix common causes of this problem.