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

scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New
RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 11851 134
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
OvermindDL1
Been making an MLElixir thing (not released yet…) for fun in spare time in the past day. I’m just trying to see how much I can get an ML...
132 13487 106
New
mcrumm
If you would like to migrate away from node/npm/webpack while still using sass, the dart_sass package provides a installer and runner for...
New
alisinabh
Hey everyone i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New
versilov
Could not wait for the missing Elixir ML libraries to appear, so, I wrote one myself, taking https://github.com/sdwolfz/exlearn as a foun...
New

Other popular topics Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

Sub Categories:

We're in Beta

About us Mission Statement