Git Product home page Git Product logo

braintree_graphql_rails_example's Introduction

Braintree GraphQL Example in Rails

Build Status

An example Braintree integration with the GraphQL API using Ruby on Rails. Forked from braintree/braintree_rails_example.

Setup Instructions

  1. Install bundler:

    gem install bundler
  2. Bundle:

    bundle
  3. 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.

  4. 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 (or rails -R spec) 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 (or rails spec:integration) on the command line.

Running All Tests

You can run both unit and integrations tests by calling rake spec (or rails 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_graphql_rails_example's People

Contributors

baash05 avatar braintreeps avatar crookedneighbor avatar danakatz avatar dependabot[bot] avatar epreuve avatar evanhahn avatar hollabaq86 avatar jackellenberger avatar jferm avatar kexline4710 avatar lilaconlee avatar lkorth avatar mtmarsh3 avatar omgrr avatar pblesi avatar phagoth avatar salanoid avatar translatorzepp avatar zkry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

braintree_graphql_rails_example's Issues

Cannot find necessary environmental variables.

General information

  • Environment: Sandbox
  • Language, language version, and OS: ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-darwin19]

Issue description

prkul@LM-SJN-40012699 graphql_braintree % rails s
=> Booting WEBrick
=> Rails 5.2.2.1 application starting in development on http://localhost:3000
=> Run rails server -h for more startup options
Exiting
/Users/prkul/Bt/graphql_braintree/config/initializers/braintree.rb:4:in `

': Cannot find necessary environmental variables. See https://github.com/braintree/braintree_graphql_rails_example#setup-instructions for instructions (RuntimeError)

From what I can see in config/initializers/braintree.rb

Dotenv.load

if !ENV["BT_PUBLIC_KEY"] || !ENV["BT_PRIVATE_KEY"] || !ENV["BT_VERSION"]
  raise "Cannot find necessary environmental variables. See https://github.com/braintree/braintree_graphql_rails_example#setup-instructions for instructions";
end

I already have sandbox parameter from braintree_ruby replaced.
But don't have BT_VERSION
If this is the case, What is BT_VERSION

SDK support

Is the Ruby SDK not recommended for the integration into theGraphQL API? I don't see the gem in the Gemfile of this sample app and am wondering if it's because it's not meant to be used for this integration.

General info

General information

  • Environment:
  • Language, language version, and OS:

Issue description

  • Language, language version, and OS:

Issue description

a.org/wiki/User_story) format to clearly describe the use case. -->

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.