All Projects → killbill → killbill-stripe-plugin

killbill / killbill-stripe-plugin

Licence: Apache-2.0 license
Kill Bill plugin for Stripe

Programming Languages

java
68154 projects - #9 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to killbill-stripe-plugin

kbcli
GO client library for Kill Bill
Stars: ✭ 22 (+37.5%)
Mutual labels:  payments, billing, subscriptions, killbill
killbill-admin-ui
Kill Bill Administrative UI engine
Stars: ✭ 39 (+143.75%)
Mutual labels:  payments, billing, subscriptions, killbill
killbill-client-java
Java client library for Kill Bill
Stars: ✭ 30 (+87.5%)
Mutual labels:  payments, billing, subscriptions, killbill
Killbill
Open-Source Subscription Billing & Payments Platform
Stars: ✭ 2,396 (+14875%)
Mutual labels:  payments, billing, subscriptions, killbill
Dj Stripe
Django + Stripe Made Easy
Stars: ✭ 1,022 (+6287.5%)
Mutual labels:  payments, billing, subscriptions
subscribie
Collect recurring payments online - subscription payments collection automation
Stars: ✭ 36 (+125%)
Mutual labels:  payments, billing
development
An Enterprise-ready Cloud Services Management Software
Stars: ✭ 38 (+137.5%)
Mutual labels:  billing, subscriptions
Stripe Billing Typographic
⚡️Typographic is a webfont service (and demo) built with Stripe Billing.
Stars: ✭ 186 (+1062.5%)
Mutual labels:  payments, billing
Google-IAP
Android Library for easing Google Play Billing to your apps with support for Subscriptions, In-App Purchases and Consumables with a beautiful sample app.
Stars: ✭ 129 (+706.25%)
Mutual labels:  billing, subscriptions
pinax-stripe-light
a payments Django app for Stripe
Stars: ✭ 670 (+4087.5%)
Mutual labels:  payments, subscriptions
drf-stripe-subscription
An out-of-box Django REST framework solution for payment and subscription management using Stripe.
Stars: ✭ 42 (+162.5%)
Mutual labels:  payments, billing
Invoiceneko
An Open Sourced Invoice System developed for anyone who needs to generate out an invoice and manage clients
Stars: ✭ 204 (+1175%)
Mutual labels:  payments, billing
Jetstream Cashier Billing Portal
Jetstream Cashier Billing Portal is a simple scaffolding billing portal to manage subscriptions, invoices and payment methods, built on top of Jetstream & Cashier Register.
Stars: ✭ 45 (+181.25%)
Mutual labels:  billing, subscriptions
Ledgersmb
Repository for the LedgerSMB project -- web app for accounting & ERP
Stars: ✭ 222 (+1287.5%)
Mutual labels:  payments, billing
Gringotts
A complete payment library for Elixir and Phoenix Framework
Stars: ✭ 396 (+2375%)
Mutual labels:  payments, billing
Akaunting
Free and Online Accounting Software
Stars: ✭ 4,599 (+28643.75%)
Mutual labels:  payments, billing
RxBilling
Rx wrapper for Billing Library with connection management
Stars: ✭ 79 (+393.75%)
Mutual labels:  billing, subscriptions
cashier-paystack
Cashier provides an expressive, fluent interface to Paystack's subscription billing services.
Stars: ✭ 44 (+175%)
Mutual labels:  billing, subscriptions
Boxbilling
BoxBilling - Open source billing and client management software
Stars: ✭ 372 (+2225%)
Mutual labels:  payments, billing
Pinax Stripe
a payments Django app for Stripe
Stars: ✭ 650 (+3962.5%)
Mutual labels:  payments, subscriptions

killbill-stripe-plugin

Maven Central

Plugin to use Stripe as a gateway.

A full end-to-end integration demo is available here.

Kill Bill compatibility

Plugin version Kill Bill version Stripe version
1.x.y 0.14.z 2015-02-18
3.x.y 0.16.z 2015-02-18
4.x.y 0.18.z 2015-02-18
5.x.y 0.19.z 2015-02-18
6.x.y 0.20.z 2015-02-18
7.0.y 0.22.z 2019-12-03
7.1.y 0.22.z 2019-12-03
7.2.y 0.22.z 2020-08-27
7.3.y 0.22.z 2020-08-27
8.0.y 0.24.z 2020-08-27

Release notes

  • Starting with 7.3.0, the Setup Intents API is used to validate and store payment instruments, instead of the Payment Intents API.
  • We've upgraded numerous dependencies in 7.1.x (required for Java 11 support).

Requirements

The plugin needs a database. The latest version of the schema can be found here.

Installation

Locally:

kpm install_java_plugin stripe --from-source-file target/stripe-plugin-*-SNAPSHOT.jar --destination /var/tmp/bundles

Configuration

Go to https://dashboard.stripe.com/test/apikeys and copy your Secret key.

Then, go to the Kaui plugin configuration page (/admin_tenants/1?active_tab=PluginConfig), and configure the stripe plugin with your key:

org.killbill.billing.plugin.stripe.apiKey=sk_test_XXX

Alternatively, you can upload the configuration directly:

curl -v \
     -X POST \
     -u admin:password \
     -H 'X-Killbill-ApiKey: bob' \
     -H 'X-Killbill-ApiSecret: lazar' \
     -H 'X-Killbill-CreatedBy: admin' \
     -H 'Content-Type: text/plain' \
     -d 'org.killbill.billing.plugin.stripe.apiKey=sk_test_XXX
org.killbill.billing.plugin.stripe.chargeDescription=YYY
org.killbill.billing.plugin.stripe.chargeStatementDescriptor=ZZZ' \
     http://127.0.0.1:8080/1.0/kb/tenants/uploadPluginConfig/killbill-stripe

Payment Method flow

To charge a payment instrument (card, bank account, etc.), you first need to collect the payment instrument details in Stripe and create an associated payment method in Kill Bill.

Using Stripe Checkout

Use this method if you don't want to generate your own form to tokenize cards.

To save credit cards using Stripe Checkout:

  1. Create a Kill Bill account
  2. Call /plugins/killbill-stripe/checkout to generate a Session:
curl -v \
     -X POST \
     -u admin:password \
     -H "X-Killbill-ApiKey: bob" \
     -H "X-Killbill-ApiSecret: lazar" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "X-Killbill-CreatedBy: demo" \
     -H "X-Killbill-Reason: demo" \
     -H "X-Killbill-Comment: demo" \
     "http://127.0.0.1:8080/plugins/killbill-stripe/checkout?kbAccountId=<KB_ACCOUNT_ID>"

The default is to only allow credit cards. If you want to enable sepa direct debit payments, you need to include the paymentMethodTypes option, i.e. change the URL of your POST request to http://127.0.0.1:8080/plugins/killbill-stripe/checkout?kbAccountId=<KB_ACCOUNT_ID>&paymentMethodTypes=card&paymentMethodTypes=sepa_debit.

  1. Redirect the user to the Stripe checkout page. The sessionId is returned as part of the formFields (id key):
stripe.redirectToCheckout({ sessionId: 'cs_test_XXX' });
  1. After entering the credit card or bank account details, the payment method will be available in Stripe. Call addPaymentMethod to store the payment method in Kill Bill:
curl -v \
     -X POST \
     -u admin:password \
     -H "X-Killbill-ApiKey: bob" \
     -H "X-Killbill-ApiSecret: lazar" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "X-Killbill-CreatedBy: demo" \
     -H "X-Killbill-Reason: demo" \
     -H "X-Killbill-Comment: demo" \
     -d "{ \"pluginName\": \"killbill-stripe\"}" \
     "http://127.0.0.1:8080/1.0/kb/accounts/<KB_ACCOUNT_ID>/paymentMethods?pluginProperty=sessionId=cs_test_XXX"

Using tokens and sources

If you have a token or sources, you can pass it directly to addPaymentMethod in the plugin properties:

Token
curl -v \
     -X POST \
     -u admin:password \
     -H "X-Killbill-ApiKey: bob" \
     -H "X-Killbill-ApiSecret: lazar" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "X-Killbill-CreatedBy: demo" \
     -H "X-Killbill-Reason: demo" \
     -H "X-Killbill-Comment: demo" \
     -d "{ \"pluginName\": \"killbill-stripe\"}" \
     "http://127.0.0.1:8080/1.0/kb/accounts/<KB_ACCOUNT_ID>/paymentMethods?pluginProperty=token=tok_XXX"
Source
curl -v \
     -X POST \
     -u admin:password \
     -H "X-Killbill-ApiKey: bob" \
     -H "X-Killbill-ApiSecret: lazar" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "X-Killbill-CreatedBy: demo" \
     -H "X-Killbill-Reason: demo" \
     -H "X-Killbill-Comment: demo" \
     -d "{ \"pluginName\": \"killbill-stripe\"}" \
     "http://127.0.0.1:8080/1.0/kb/accounts/<KB_ACCOUNT_ID>/paymentMethods?pluginProperty=source=src_XXX"

Take a look at kbcmd for a step-by-step walkthrough.

Note: if the token/source is already attached to a customer in Stripe, make sure to first set the STRIPE_CUSTOMER_ID custom field to the account in Kill Bill (see below) before calling addPaymentMethod (in this case, the token will be stored as-is and assumed to be re-usable if you intent to do subsequent payments). Otherwise, the plugin assumes it is a one-time token and will automatically create an associated customer in Stripe attached to this token/source to be able to re-use it (if needed, you can bypass this logic by specifying the createStripeCustomer=false plugin property in the addPaymentMethod call).

Other methods

If you are using Stripe Elements or storing payment methods in Stripe via any other way (or if you want to migrate from another billing system and already have customers in Stripe), the flow to setup Kill Bill accounts is as follows:

  1. Create a Kill Bill account
  2. Attach the custom field STRIPE_CUSTOMER_ID to the Kill Bill account. The custom field value should be the Stripe customer id
curl -v \
     -X POST \
     -u admin:password \
     -H "X-Killbill-ApiKey: bob" \
     -H "X-Killbill-ApiSecret: lazar" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "X-Killbill-CreatedBy: demo" \
     -H "X-Killbill-Reason: demo" \
     -H "X-Killbill-Comment: demo" \
     -d "[ { \"objectType\": \"ACCOUNT\", \"name\": \"STRIPE_CUSTOMER_ID\", \"value\": \"cus_XXXXX\" }]" \
     "http://127.0.0.1:8080/1.0/kb/accounts/<ACCOUNT_ID>/customFields"
  1. Sync the payment methods from Stripe to Kill Bill:
curl -v \
     -X PUT \
     -u admin:password \
     -H "X-Killbill-ApiKey: bob" \
     -H "X-Killbill-ApiSecret: lazar" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "X-Killbill-CreatedBy: demo" \
     -H "X-Killbill-Reason: demo" \
     -H "X-Killbill-Comment: demo" \
     "http://127.0.0.1:8080/1.0/kb/accounts/<ACCOUNT_ID>/paymentMethods/refresh"

Development

For testing you need to add your Stripe public and private key to src/test/resources/stripe.properties:

org.killbill.billing.plugin.stripe.apiKey=sk_test_XXX
org.killbill.billing.plugin.stripe.publicKey=pk_test_XXX

About

Kill Bill is the leading Open-Source Subscription Billing & Payments Platform. For more information about the project, go to https://killbill.io/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].