Stripe Environment Setup
Prerequisites
- Users must register their own sandbox accounts with Stripe in order to use the BroadleafCommerce Stripe payment functionality in a test environment. This can be done here: https://dashboard.stripe.com
- Please familiarize yourself with the Stripe Java API before proceeding: https://stripe.com/docs/quickstart
Once you have registered an account with Stripe, add the Stripe Module dependency to your root pom.xml
.
<dependency>
<groupId>com.broadleafcommerce</groupId>
<artifactId>broadleaf-stripe</artifactId>
<version>1.0.0-GA</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
Make sure to include the dependency in your core pom.xml
as well:
<dependency>
<groupId>com.broadleafcommerce</groupId>
<artifactId>broadleaf-stripe</artifactId>
</dependency>
Next, you will need to add properties to your application.
Broadleaf allows you to specify properties based on the application's environment, or you can also store these in the Database by utilizing the blSystemPropertiesService
Set up your Stripe Account
- Log in to your Stripe account
- Set an account name in the top left of the Stripe dashboard or at https://dashboard.stripe.com/account
- Find your API keys by navigating to https://dashboard.stripe.com/account/apikeys
- Add these API keys to the desired environment's .properties file, as well as the other properties below:
#####################################
Stripe API
#####################################
- gateway.stripe.publicKey={Your Publishable key}
- gateway.stripe.privateKey={Your Secret key}
- gateway.stripe.auth_and_capture={true || false}
auth_and_capture by default is set to false if not included in the properties file. If false, transactions will only authorize.