Giter Club home page Giter Club logo

meteor-saas-braintree's Introduction

MeteorJS + Braintree = SaaS

A subscription-based app (SaaS) example that shows one way of integration Braintree into your meteor application. Try it here!

Disclaimer

This is basically a refractored version of The Meteor Chef's saas-stripe app. It uses Braintree instead of Stripe.

Initial setup

  1. Install Meteor
  2. Clone this repo git clone https://github.com/michaltakac/meteor-saas-braintree.git
  3. Create a sandbox account
  4. Login to the braintree sandbox
  5. Retrieve your api keys (navigate to: My User > Api Keys)
  6. Insert the keys into settings.json
  7. Inside Braintree sandbox, navigate to Plans from left menu under Reccuring Billing
  8. Create 2 plans with id's "pro" and "standard" respectively (lowercase for Plan ID, Plan Name's should be "Pro and "Standard")
  9. Fill other inputs with information from settings.json (Price: 9.99 for Pro, 5.99 for Standard, do not include Trial Period, Billing Cycle Every 1 Month(s), First Bill Date - Immediately, End Date - Never)*, now hit Create button

*You can create whatever plans you want, but "Plan ID" from Braintree must be equal to "name" from settings.json and "Price" from Braintree must be equal to "price" from settings.json. You can play with it.

Start

$ meteor --settings settings.json

Invoices

Invoices only works if you deploy your app on the web, because they are generated using Braintree's webhooks. There is a easy way to make it work:

  1. Deploy your app to Meteor servers, for example: meteor deploy my-saas-app.meteor.com --settings settings.json
  2. Inside Braintree sandbox, navigate to Settings > Webhooks (inside top menu)
  3. Click on New webhook, insert my-saas-app.meteor.com/webhooks/braintree URL into "Destination", check "Subscription canceled" and "Subscription charged successfully" and click Create Webhook
  4. It should be added now and after you create new subscription inside your app at my-saas-app.meteor.com, it will generate new invoice

Issues?

For issues related to this repo, please submit an issue on github. Any braintree related problems should be directed to Braintree Support or #braintree on StackOverflow.

meteor-saas-braintree's People

Contributors

michaltakac avatar

Watchers

 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.