nehero

nehero

Bling - Stripe subscription management for Phoenix

Bling gives you all of the tools needed to add recurring subscriptions with Stripe to your Phoenix applications.

It includes:

  • Ecto schemas for customers and subscriptions
    • Use any existing ecto schema like User or Team as a customer
  • Saving default payment methods to customers
  • Creating subscriptions
  • Multiple subscriptions per customer
  • Subscription quantities
  • Failed payment resolution page
  • + lots more! See the full list in the hexdocs readme

When I was working with Laravel every day we made extensive use of the Laravel Cashier package. I had been missing it while working on elixir products, so I decided to bring it over :slight_smile:

hexdocs:
https://hexdocs.pm/bling

github:

There’s a few things I want to add to it before pushing v1.0 such as metered billing and one-off charges, but it has most subscription functionality ready to go.

Forewarning the readme contains a link to a paid product that provides a complete UI on top of Bling, but Bling itself is open source and free to use as a headless subscription manager

Most Liked

nehero

nehero

Thanks! I believe I needed it because of controller/html files

I’m sure there is a way to render these without depending on liveview, but it was the easiest route to take for the initial release

f0rest8

f0rest8

This is awesome. Initial question, is there a particular reason it’s dependent on LiveView 0.18?

stocks29

stocks29

Very cool project!

I’m attempting to add it to my ash project but running into an issue. The preloads don’t work with ash because the type of missing preload fields is Ash.NotLoaded instead of the corresponding ecto struct. Maybe there is a way to externalize the preloading operation so someone can optionally plug in their own preload function, defaulting to repo.preload as is the case now.

A nice-to-have would be to allow for separation of the application’s user and local stripe customer records so each of these records can live in different contexts/domains and not require fetching the billing info (stripe_id, etc…) when it’s not needed. I tried to achieve this but ran into an issue because the updates to the user record require the fields to be on the same schema as the customer’s email address.

Looking forward to continued development on this project!

Edit: I was able to work around the first issue by implementing a proxy Repo module which is implemented by calling ash and providing this proxy repo to bling instead of the underlying ecto repo module.

Where Next?

Popular in Libraries Top

mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New
dbern
I’m excited to announce that TaxJar has developed and open-sourced DateTimeParser. We developed it because we found a need to parse user ...
New
devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: https://github.com/devonestes/assertions ...
New
Crowdhailer
The latest release of Ace (0.10.0) includes serving content over HTTP/2. I have started writing a webserver to teach my self more about...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
tfwright
After working on it for a couple of months and using it in production for most of that time, today I’ve released LiveAdmin, a LiveView ba...
New
aditya7iyengar
Rummage.Ecto and Rummage.Phoenix provide ways to perform Searching, Sorting and Pagination over Ecto queries and Phoenix collections. Fo...
New
Crowdhailer
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention. Assuming you have...
New
ericlathrop
I built a silly site for Halloween that uses Phoenix Channels on the backend, and React on the frontend. I had many problems integrating ...
New
Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_or...
New

Other popular topics Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New

Sub Categories:

We're in Beta

About us Mission Statement