GithubHelp home page GithubHelp logo

jameswmoody / braintree_rails_example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from braintree/braintree_rails_example

0.0 1.0 0.0 841 KB

An example Braintree integration for Ruby on Rails

License: MIT License

Ruby 38.41% JavaScript 2.16% CoffeeScript 0.18% HTML 58.50% CSS 0.75%

braintree_rails_example's Introduction

Braintree Rails Example

Build Status

An example Braintree integration for Ruby on Rails.

Setup Instructions

  1. Install bundler:
gem install bundler
  1. Bundle:
bundle
  1. Copy the contents of example.env into a new file named .env and fill in your Braintree API credentials. Credentials can be found by navigating to Account > My User > View Authorizations in the Braintree Control Panel. Full instructions can be found on our support site.

  2. Start rails:

rails server

Deploying to Heroku

You can deploy this app directly to Heroku to see the app live. Skip the setup instructions above and click the button below. This will walk you through getting this app up and running on Heroku in minutes.

Deploy

Running Tests

Running Unit Tests

Unit tests do not make API calls to Braintree and do not require Braintree credentials. You can run this project's unit tests by calling rake on the command line.

Running Integration Tests

Integration tests make API calls to Braintree and require that you set up your Braintree credentials. You can run this project's integration tests by adding your sandbox API credentials to .env and calling rake spec:integration on the command line.

Running All Tests

You can run both unit and integrations tests by calling rake spec on the command line.

Testing Transactions

Sandbox transactions must be made with sample credit card numbers, and the response of a Braintree::Transaction.sale() call is dependent on the amount of the transaction.

Pro Tips

  • Run rails s -b 0.0.0.0 when launching Rails server to listen on all interfaces.

Help

Disclaimer

This code is provided as is and is only intended to be used for illustration purposes. This code is not production-ready and is not meant to be used in a production environment. This repository is to be used as a tool to help merchants learn how to integrate with Braintree. Any use of this repository or any of its code in a production environment is highly discouraged.

braintree_rails_example's People

Contributors

braintreeps avatar crookedneighbor avatar danakatz avatar jackellenberger avatar kexline4710 avatar mtmarsh3 avatar omgrr avatar pblesi 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.