My client use ghost and a “pay what you want” pricing is what they want.
here is the payment flow:
page 1: choose your plan and the price you want
page 2: stripe checkout portal
I’m going to try something with a custom backend containing only one route that will take care of creating the stripe session. This route will take a price argument as well as information about wether it’s a recurring or one time, return the session id, and hopefully I’ll get something.
However, I know I’ll bump into a lot of little rocks on this path. If someone already implemented something like this, or if someone from the ghost team has any feedback about this idea of implementation, I’d be happy to hear
Looking forward to hearing more, enjoy your week end everyone,
So, there were no rocks on the path, this is beautiful and I’m in love with how smooth it works.
Only slightly tricky things were on the stripe side.
What I learnt about stripe subscriptions:
you need a planId to create a subscription
once a plan is created, you cannot easily change its price (you can do discounts though but didn’t work for my usecase)
the way people do when they want to do this is creating one plan per subscription.
How I did the thing :
Front end :
send a request to my custom server, something like “/get-stripe-checkout-link”, body : {email: “hi@mail.co”, amount: 22 }, wait for the response with checkout link. Follow the link. over.
Back end
receive the request, make all the checks.
create a plan based on the price requested
create a subscription with this plan
With this method we get
custom price payment
automatic sync with ghost (we owe this to the beautiful architecture of Ghost )
confirmation email is sent like usual
Almost seems too beautiful, maybe I’ll discover something ? I can’t think of anything so… it’s wrapped
(but I’d still take some feedback from the ghost team to be 100% sure because we rely a lot on the way ghost is built and it may be broken in future versions if they decide to change something)
Oh this would be incredible for me with the Obsidian Roundup; currently I’m redirecting people towawrd Github for this kind of thing and it’s a bit troublesome. I would love for this functionality to make its way into core!
There it is , I published the sample code on github so that you can have a more precise vision of how it works.
I made some cleaning but didn’t test the front end to be honest so it might not work, but the backend is working and is where most of the deal happens.
If you guys don’t really code it may be very difficult to use it though.
it makes me think that it might be an opportinuty to create a paying plugin for ghost that would handle it with no coding if there is demand for that, and get that SASS money I’ve always dream of hahaha.