├── app
├── mailers
│ └── .keep
├── models
│ ├── .keep
│ ├── concerns
│ │ └── .keep
│ └── braintree_gateway.rb
├── assets
│ ├── images
│ │ ├── .keep
│ │ ├── favicon.png
│ │ ├── fail.svg
│ │ └── success.svg
│ ├── fonts
│ │ ├── bt-mono-Bold.eot
│ │ ├── bt-mono-Bold.woff
│ │ ├── bt-mono-Bold.woff2
│ │ ├── bt-mono-Medium.eot
│ │ ├── bt-mono-Medium.woff
│ │ ├── bt-mono-Medium.woff2
│ │ ├── bt-mono-Regular.eot
│ │ ├── bt-mono-Regular.woff
│ │ ├── bt-mono-Regular.woff2
│ │ ├── OpenSans-Bold-webfont.eot
│ │ ├── OpenSans-Bold-webfont.ttf
│ │ ├── OpenSans-Bold-webfont.woff
│ │ ├── OpenSans-Light-webfont.eot
│ │ ├── OpenSans-Light-webfont.ttf
│ │ ├── OpenSans-Light-webfont.woff
│ │ ├── OpenSans-Regular-webfont.eot
│ │ ├── OpenSans-Regular-webfont.ttf
│ │ ├── OpenSans-Regular-webfont.woff
│ │ ├── OpenSans-Semibold-webfont.eot
│ │ ├── OpenSans-Semibold-webfont.ttf
│ │ └── OpenSans-Semibold-webfont.woff
│ ├── stylesheets
│ │ ├── checkout.scss
│ │ ├── application.css
│ │ ├── overrides.css.erb
│ │ ├── app.css.map
│ │ └── app.css.erb
│ └── javascripts
│ │ ├── checkout.coffee
│ │ ├── demo.js
│ │ └── application.js
├── controllers
│ ├── concerns
│ │ └── .keep
│ ├── application_controller.rb
│ └── checkouts_controller.rb
├── helpers
│ ├── checkout_helper.rb
│ └── application_helper.rb
└── views
│ ├── layouts
│ ├── _notifications.html.erb
│ └── application.html.erb
│ └── checkouts
│ ├── _paypal_account_details.html.erb
│ ├── _credit_card_details.html.erb
│ ├── new.html.erb
│ └── show.html.erb
├── lib
├── assets
│ └── .keep
└── tasks
│ ├── .keep
│ └── rspec.rake
├── public
├── favicon.ico
├── robots.txt
├── 500.html
├── 422.html
└── 404.html
├── .ruby-version
├── vendor
└── assets
│ ├── javascripts
│ └── .keep
│ └── stylesheets
│ └── .keep
├── .ruby-gemset
├── Procfile
├── bin
├── rake
├── bundle
├── rails
├── yarn
├── spring
├── update
└── setup
├── spec
├── helpers
│ ├── checkout_helper_spec.rb
│ └── application_helper_spec.rb
├── views
│ └── checkouts
│ │ ├── show.html.erb_spec.rb
│ │ └── new.html.erb_spec.rb
├── models
│ └── braintree_gateway_spec.rb
├── rails_helper.rb
├── integration
│ └── controllers
│ │ └── checkouts_controller_spec.rb
├── support
│ └── mock_data.rb
├── spec_helper.rb
└── controllers
│ └── checkouts_controller_spec.rb
├── example.env
├── config
├── spring.rb
├── environment.rb
├── initializers
│ ├── mime_types.rb
│ ├── session_store.rb
│ ├── filter_parameter_logging.rb
│ ├── application_controller_renderer.rb
│ ├── braintree.rb
│ ├── cookies_serializer.rb
│ ├── backtrace_silencers.rb
│ ├── wrap_parameters.rb
│ ├── assets.rb
│ ├── inflections.rb
│ └── content_security_policy.rb
├── boot.rb
├── routes.rb
├── database.yml
├── locales
│ └── en.yml
├── secrets.yml
├── storage.yml
├── environments
│ ├── test.rb
│ ├── development.rb
│ └── production.rb
└── application.rb
├── config.ru
├── docker-compose.yml
├── Dockerfile
├── db
├── seeds.rb
└── schema.rb
├── Rakefile
├── .github
└── ISSUE_TEMPLATE.md
├── .gitignore
├── app.json
├── .travis.yml
├── LICENSE
├── Gemfile
├── README.md
└── Gemfile.lock
/app/mailers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/models/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.4.3
2 |
--------------------------------------------------------------------------------
/app/assets/images/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/models/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.ruby-gemset:
--------------------------------------------------------------------------------
1 | braintree_graphql_rails_example
2 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: bundle exec rails server -p $PORT
2 |
--------------------------------------------------------------------------------
/app/helpers/checkout_helper.rb:
--------------------------------------------------------------------------------
1 | module CheckoutHelper
2 | end
3 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/spec/helpers/checkout_helper_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | RSpec.describe CheckoutHelper, type: :helper do
4 | end
5 |
--------------------------------------------------------------------------------
/example.env:
--------------------------------------------------------------------------------
1 | BT_PUBLIC_KEY='your braintree public key'
2 | BT_PRIVATE_KEY='your braintree private key'
3 | BT_VERSION='2018-11-11'
4 |
--------------------------------------------------------------------------------
/app/assets/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/images/favicon.png
--------------------------------------------------------------------------------
/app/assets/fonts/bt-mono-Bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/bt-mono-Bold.eot
--------------------------------------------------------------------------------
/app/assets/fonts/bt-mono-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/bt-mono-Bold.woff
--------------------------------------------------------------------------------
/app/assets/fonts/bt-mono-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/bt-mono-Bold.woff2
--------------------------------------------------------------------------------
/app/assets/fonts/bt-mono-Medium.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/bt-mono-Medium.eot
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/app/assets/fonts/bt-mono-Medium.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/bt-mono-Medium.woff
--------------------------------------------------------------------------------
/app/assets/fonts/bt-mono-Medium.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/bt-mono-Medium.woff2
--------------------------------------------------------------------------------
/app/assets/fonts/bt-mono-Regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/bt-mono-Regular.eot
--------------------------------------------------------------------------------
/app/assets/fonts/bt-mono-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/bt-mono-Regular.woff
--------------------------------------------------------------------------------
/app/assets/fonts/bt-mono-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/bt-mono-Regular.woff2
--------------------------------------------------------------------------------
/config/spring.rb:
--------------------------------------------------------------------------------
1 | %w[
2 | .ruby-version
3 | .rbenv-vars
4 | tmp/restart.txt
5 | tmp/caching-dev.txt
6 | ].each { |path| Spring.watch(path) }
7 |
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Bold-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Bold-webfont.eot
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Bold-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Bold-webfont.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Bold-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Bold-webfont.woff
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Light-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Light-webfont.eot
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Light-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Light-webfont.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Light-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Light-webfont.woff
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Regular-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Regular-webfont.eot
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Regular-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Regular-webfont.ttf
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path('../config/application', __dir__)
3 | require_relative '../config/boot'
4 | require 'rails/commands'
5 |
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Regular-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Regular-webfont.woff
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Semibold-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Semibold-webfont.eot
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Semibold-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Semibold-webfont.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/OpenSans-Semibold-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/braintree/braintree_graphql_rails_example/HEAD/app/assets/fonts/OpenSans-Semibold-webfont.woff
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative 'application'
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run Rails.application
5 |
--------------------------------------------------------------------------------
/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | def alert_string(alert)
3 | alert.is_a?(Array) ? safe_join(alert, "
".html_safe) : alert
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.session_store :cookie_store, key: '_braintree_graphql_rails_example_session'
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/checkout.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the checkout controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2 |
3 | require 'bundler/setup' # Set up gems listed in the Gemfile.
4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
5 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | # User-agent: *
5 | # Disallow: /
6 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
3 | root 'checkouts#new'
4 |
5 | resources :checkouts, only: [:new, :create, :show]
6 | end
7 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 | services:
3 | web:
4 | build: .
5 | command: bin/rails server --port 4567 --binding 0.0.0.0
6 | ports:
7 | - "4567:4567"
8 | volumes:
9 | - .:/braintree_graphql_rails_example
10 |
--------------------------------------------------------------------------------
/app/assets/javascripts/checkout.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Prevent CSRF attacks by raising an exception.
3 | # For APIs, you may want to use :null_session instead.
4 | protect_from_forgery with: :exception
5 | end
6 |
--------------------------------------------------------------------------------
/config/initializers/application_controller_renderer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # ActiveSupport::Reloader.to_prepare do
4 | # ApplicationController.renderer.defaults.merge!(
5 | # http_host: 'example.org',
6 | # https: false
7 | # )
8 | # end
9 |
--------------------------------------------------------------------------------
/config/initializers/braintree.rb:
--------------------------------------------------------------------------------
1 | Dotenv.load
2 |
3 | if !ENV["BT_PUBLIC_KEY"] || !ENV["BT_PRIVATE_KEY"] || !ENV["BT_VERSION"]
4 | raise "Cannot find necessary environmental variables. See https://github.com/braintree/braintree_graphql_rails_example#setup-instructions for instructions";
5 | end
6 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ruby:2.3.1-onbuild
2 |
3 | RUN apt-get update && apt-get install -y build-essential nodejs
4 |
5 | ENV APP_HOME /braintree_graphql_rails_example
6 | RUN mkdir $APP_HOME
7 | WORKDIR $APP_HOME
8 |
9 | ADD Gemfile* $APP_HOME/
10 | RUN bundle install
11 |
12 | ADD . $APP_HOME
13 |
--------------------------------------------------------------------------------
/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Specify a serializer for the signed and encrypted cookie jars.
4 | # Valid options are :json, :marshal, and :hybrid.
5 | Rails.application.config.action_dispatch.cookies_serializer = :json
6 |
--------------------------------------------------------------------------------
/app/views/layouts/_notifications.html.erb:
--------------------------------------------------------------------------------
1 |
| <%= paypal_account["payer"]["email"] %> | 9 ||
| payer ID | 12 |<%= paypal_account["payer"]["payerId"] %> | 13 |
| first name | 16 |<%= paypal_account["payer"]["firstName"] %> | 17 |
| last name | 20 |<%= paypal_account["payer"]["lastName"] %> | 21 |
| payer status | 25 |<%= paypal_account["payerStatus"] %> | 26 |