Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 1.89 KB

README.md

File metadata and controls

46 lines (28 loc) · 1.89 KB

Stripe OAuth Java 8 example

This is a simple example project illustrating how to implement Stripe's OAuth flow to connect standalone accounts to a platform.

Use with Heroku

Deploy the project on your Heroku account:

Deploy

When deploying, you'll be prompted for your secret API key (you can find it in the API keys tab of your account settings) and your platform's client_id (you can find in the Connect tab of your account settings).

Once the app is running on Heroku, head back to your Connect settings and set the redirect URI to your app's URL followed by /oauth/callback. E.g. if the URL of the Heroku app is https://thawing-crag-63114.herokuapp.com, set the redirect URI to be https://thawing-crag-63114.herokuapp.com/oauth/callback.

Use as a standalone project

Requirements

  • Java 1.8 or later
  • Maven

Instructions

Clone the repository:

git clone https://github.com/ob-stripe/example-stripe-java8-oauth.git

Compile the project:

mvn compile

Get your secret API key (you can find it in the API keys tab of your account settings) and your platform's client_id (you can find in the Connect tab of your account settings) and run the project:

STRIPE_TEST_SECRET_KEY=sk_test_... \
STRIPE_DEVELOPMENT_CLIENT_ID=ca_... \
mvn exec:java

Head back to your Connect settings and set the redirect URI to http://localhost:4567/oauth/callback.

In your browser, go to http://localhost:4567.