Git Product home page Git Product logo

recurring-xero-sajin's Introduction

Project Goalss

  1. Tracks subscriptions associated with a customer
  2. Handles upgrades and downgrades of a subscription
  3. Automatically posts invoices to the Xero API
  4. Emails invoices to customers
  5. Automatically collects credit card payments and posts them to Xero

Details

Envisioned Functions

  • new()
  • getAllItems()
  • addItem(item)
  • updateItem(item)
  • setRepeating(repeat_obj)
  • setStart(date)
  • more...

Envisioned Modules

Subscription UI

This is the UI that talks to the Subscription module. Think of it like Accounts UI in relation to Accounts.

Subscription

This is the module that you'll be working on. It interfaces with the MongoDB.

Subscription Billing

This module is a backend module that reads the MongoDB, creates the invoices in Xero and closes and opens new subscriptions in the MongoDB.

MongoDB Collection

A mongodb collection will track the subscriptions. A subscription will start with an "open" status. When the subscription is past the end date, the object will be duplicated with a new start and end date. While the object is being copied the status will change to "closing". A new invoice will be created in Xero and a the new subscription will get added to the mongodb. The recurring billing happens as old subscriptions get replaced with new ones.

A Sample Mongo Entry for a Subscription

{
	_id: standard mongo id object,
	customer_id: mongo id to the customer the subsription is tied to,
	start_date: date the subscription service starts,
	end_date: date the subscription stops,
	repeat_every: 
		false = one time subscription,
		int = number of units,
	repeat_unit:
		false = does not recurre,
		"day",
		"week",
		"month",
		"year",
	repeat_until:
		false = continues until cancelled,
		date = the day this subscription will stop repeating,
	status:
		"open" = a subscription that is currently active,
		"opening" = a subscription that is in the process of being created,
		"closing" = a subscrption that is being closed, while a new one is being opened,
		"closed" = a subscription that has been completed,
		"template" = a subscription profile yet to be activated,
		"trial" = a subscription that is under a trial and is not billed, will convert to real subscription on end_data, 
		"trial_cancelled" = a trial that was never continued,
		"trial_converting" = a trial that is in the process of being duplicated into a real subcription, 
		"trial_converted" = a trial that was converted into a billed subscription,
		"stopped" = a subscription that was stopped,
	is_pro_rated:
		true = the amounts in the items list cover only a portion of the full subscription,
		false = the amounts are the full price,
	billed_item: (an array)
	{
		description: the text description of the item,
		cost: always the full price,
		pro_rated_cost: the price when the subscription is pro rated,
		accounting_code: the code used for tracking revenues,
		repeat:
			true = is an item that repeats,
			false = is a one time charge,
		tax: (an array)
		{
			tax_id: mongo id that refers to the tax colletion
		}
	}
}

recurring-xero-sajin's People

Contributors

sajinrules avatar spencerlambert avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.