All Projects → killbill → kbcli

killbill / kbcli

Licence: Apache-2.0 license
GO client library for Kill Bill

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to kbcli

Killbill
Open-Source Subscription Billing & Payments Platform
Stars: ✭ 2,396 (+10790.91%)
Mutual labels:  payments, billing, subscriptions, killbill
killbill-stripe-plugin
Kill Bill plugin for Stripe
Stars: ✭ 16 (-27.27%)
Mutual labels:  payments, billing, subscriptions, killbill
killbill-admin-ui
Kill Bill Administrative UI engine
Stars: ✭ 39 (+77.27%)
Mutual labels:  payments, billing, subscriptions, killbill
killbill-client-java
Java client library for Kill Bill
Stars: ✭ 30 (+36.36%)
Mutual labels:  payments, billing, subscriptions, killbill
Dj Stripe
Django + Stripe Made Easy
Stars: ✭ 1,022 (+4545.45%)
Mutual labels:  payments, billing, subscriptions
pinax-stripe-light
a payments Django app for Stripe
Stars: ✭ 670 (+2945.45%)
Mutual labels:  payments, subscriptions
drf-stripe-subscription
An out-of-box Django REST framework solution for payment and subscription management using Stripe.
Stars: ✭ 42 (+90.91%)
Mutual labels:  payments, billing
Boxbilling
BoxBilling - Open source billing and client management software
Stars: ✭ 372 (+1590.91%)
Mutual labels:  payments, billing
Gringotts
A complete payment library for Elixir and Phoenix Framework
Stars: ✭ 396 (+1700%)
Mutual labels:  payments, billing
Akaunting
Free and Online Accounting Software
Stars: ✭ 4,599 (+20804.55%)
Mutual labels:  payments, billing
Pinax Stripe
a payments Django app for Stripe
Stars: ✭ 650 (+2854.55%)
Mutual labels:  payments, subscriptions
Stripe Billing Typographic
⚡️Typographic is a webfont service (and demo) built with Stripe Billing.
Stars: ✭ 186 (+745.45%)
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 (+827.27%)
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 (+104.55%)
Mutual labels:  billing, subscriptions
development
An Enterprise-ready Cloud Services Management Software
Stars: ✭ 38 (+72.73%)
Mutual labels:  billing, subscriptions
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 (+486.36%)
Mutual labels:  billing, subscriptions
RxBilling
Rx wrapper for Billing Library with connection management
Stars: ✭ 79 (+259.09%)
Mutual labels:  billing, subscriptions
cashier-paystack
Cashier provides an expressive, fluent interface to Paystack's subscription billing services.
Stars: ✭ 44 (+100%)
Mutual labels:  billing, subscriptions
Nestjs Braintree
A module for braintree reoccurring payments and transactions 💳
Stars: ✭ 62 (+181.82%)
Mutual labels:  payments, subscriptions
Ledgersmb
Repository for the LedgerSMB project -- web app for accounting & ERP
Stars: ✭ 222 (+909.09%)
Mutual labels:  payments, billing

Kill Bill go client library and kill bill command line

This repository contains killbill go client library (kbclient) and killbill command line tool (kbcmd)

Versions

KB Version KBCli Version
0.20.x 1.x.y
0.22.x 2.x.y

Kill bill go client library

Kill bill go client library is a go package that can be used to connect to kill bill.

Install

go get -u github.com/killbill/kbcli/v2

Creating new client

    trp := httptransport.New("127.0.0.1:8080", "", nil)
    // Add text/xml producer which is not handled by openapi runtime.
    trp.Producers["text/xml"] = runtime.TextProducer()
    // Set this to true to dump http messages
    trp.Debug = false
    // Authentication
    authWriter := runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error {
        encoded := base64.StdEncoding.EncodeToString([]byte("admin"/*username*/ + ":" + "password" /**password*/))
        if err := r.SetHeaderParam("Authorization", "Basic "+encoded); err != nil {
            return err
        }
        if err := r.SetHeaderParam("X-KillBill-ApiKey", apiKey); err != nil {
            return err
        }
        if err := r.SetHeaderParam("X-KillBill-ApiSecret", apiSecret); err != nil {
            return err
        }
        return nil
    })
    client := kbclient.New(trp, strfmt.Default, authWriter, kbclient.KillbillDefaults{})

Look at the complete example here. For more examples, look at kbcmd tool.

Client code generation

This client code was generated by the go-swagger tool.

We use a modified generator and templates to generate the client, and the sources are here.

As explained in the commit, we are stuck on an older version of go-swagger, i.e our fork is not up to date with parent. In addition to this, there is an issue compiling the tool with recent version of go, and so we are aldo currently stuck using go <= 1.13 -- for building the tool itself, i.e the swagger generator.

To download/install GO 1.13, follow the steps from here, or simply:

# This will install the tool under  ~/sdk by default
go get golang.org/dl/go1.13
go1.13 download

# You can then set GOROOT=~/sdk/go1.13 in your shell or inside Goland 's preference (for the project)

To build the (custom) swagger generator

# Pre-requisite (needed if template changes)
brew install go-bindata

# Install swagger tool
mkdir -p $GOPATH/src/github.com/go-swagger
cd $GOPATH/src/github.com/go-swagger
git clone [email protected]:killbill/go-swagger.git

# Each time the templates change, following 2 steps are needed:

#1. Regenerate the (template) byte code inside the go-swagger code itself ->  generator/bindata.go should be modified
go1.13 generate ./generator

#2. build the binary
go1.13 build cmd/swagger/swagger.go && cp swagger cp ./swagger $GOPATH/bin/swagger

Finally, in order to generate the killbill client (using the custom swagger generator):

# Update swagger.json
curl http://localhost:8080/swagger.json | jq "." >swagger.json

# Regenerate the tool
swagger generate client -f swagger.json -m kbmodel -c kbclient --default-scheme=http

Generating dev extensions

We also have dev extension APIs (like clock etc), that are in swagger-dev.json. To generate, run the following.

# Regenerate the tool
swagger generate client -f swagger-dev.json -m kbmodel -c kbclient --default-scheme=http

# Delete the client file.
rm kbclient/kill_bill_dev_client.go

Kill bill command line tool (kbcmd)

kbcmd is a command line tool that uses the go client library. This tool can do many of the kill bill operations. More details are available here in README.

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].