Integrate Stripe for payments

Silly newbie question: is it possible to integrate Stripe to a Hugo site? The Stripe docs seem to just show examples for Sinatra, Rails, Flask and php. Thanks!

Have you asked at the Stripe forum?

I’ve sent an email to Stripe support.

Stripe is one of the js embedded carts as far as I know. You can put it anywhere. Probably you’ll need to know how to make there HTML forms and link to their js.

Got this reply from Stripe support:

Now, while you can certainly use Hugo to develop the front-end of your site, as far as I can tell it only outputs static sites and doesn’t provide any sort of back-end. Is that correct? If so, you will have to provide your own back-end solution to create a charge after a token has been created through your Hugo site. The whole process is best documented at https://stripe.com/docs/tutorials/charges.

Sounds like it needs an API connection to the payment gateway (or to Stripe to take care of it). In which case you’ll need to do this server side. Not sure what ‘back-end solution’ means here… To me backend means the typical admin areas, but in this case I think they just mean server side.

My guess is there are modules for some popular server side systems that control this part, whereas in this case you’ll need to create the server side API connection. Probably very doable if you are familar with any server side language.

If you’re looking for an ecommerce solution that works with Hugo, you could try Snipcart, we use it at Ardhat.com

Snipcart looks great, but both types of cart (and any similar) should work perfectly fine wiith Hugo, they just need their own adaptions. Stripe looks like it’s the payment process attached to a sites own e-commerce pages, so it’s just doing the background work. Hence the need for the server-side API. Whatever best fits the needs of the site.

Thanks for the suggestion. I’ll give it a look.

I was looking to implement Stripe payments in my Jekyll website and I found this article, should work for Hugo as well.

The point is to delegate the required back-end work to an external service (Webtask.io).

I didn’t give it a try yet, but adding another layer of dependency can be annoying. An alternative is using Paypal, but it has less financial advantages than Stripe.