jig21nesh / braintree_spring_example

An example Braintree integration for Spring (Java)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Braintree Spring Example

Build Status

An example Braintree integration for Spring (Java).

Setup Instructions

  1. Install gradle and project dependencies:
./gradlew build -x test
  1. Copy the contents of example.config.properties into a new file named config.properties 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 server:

java -jar build/libs/bt-example-0.1.0.jar

This starts the server on port 8080 listening to all interfaces.

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

All tests are 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 config.properties and running ./gradlew test.

Testing Transactions

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

Pro Tips

  • Run java -Dserver.port=4000 -jar build/libs/bt-example-0.1.0.jar to start the server on port 4000. Replace 4000 with any number to start it on a different port.

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.

About

An example Braintree integration for Spring (Java)

License:MIT License


Languages

Language:CSS 65.7%Language:Java 21.5%Language:HTML 12.0%Language:JavaScript 0.5%Language:Dockerfile 0.3%