Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Braintree fake so that you can avoid hitting Braintree servers in tests.
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
Changelog.md
Gemfile
README.md
Rakefile
fake_braintree.gemspec
tags

README.md

fake_braintree, a Braintree fake

Currently in alpha. Needs complete test coverage, then more functionality can be added.

Quick start

Call FakeBraintree.activate! to make it go. FakeBraintree.clear! will clear all data, which you probably want to do before each test.

Example, in spec_helper.rb:

FakeBraintree.activate!

RSpec.configure do |c|
  c.before do
    FakeBraintree.clear!
  end
end

Verifying credit cards

To verify every credit card you try to use, call FakeBraintree.verify\_all\_cards!. This will stay "on" until you set FakeBraintree.verify_all_cards = false. Calling FakeBraintree.clear! will not change it. It does very basic verification: it only matches the credit card number against these: http://www.braintreepayments.com/docs/ruby/reference/sandbox and rejects them if they aren't one of the listed numbers.

Something went wrong with that request. Please try again.