Broadleaf Microservices
  • v1.0.0-latest-prod

Stripe Environment Setup

Prerequisites

Adding the Stripe Services Dependency

Once you have registered a merchant account with Stripe, add the Broadleaf Stripe Maven dependency to your PaymentTransactionServices project.

<dependency>
    <groupId>com.broadleafcommerce.microservices</groupId>
    <artifactId>broadleaf-stripe</artifactId>
</dependency>
Note
The dependency’s version will be pulled from the Broadleaf release train pom.xml.

Next, you will need to gather your Stripe API key and add them to your application via system properties.

Configuring Your Integration

Configuring your Stripe API Keys

  1. Log in to your Stripe account

  2. Set an account name in the top left of the Stripe dashboard or at https://dashboard.stripe.com/account

  3. Find your API key by navigating to https://dashboard.stripe.com/account/apikeys

  4. Provide your API key via the following properties:

broadleaf:
  stripe:
    rest:
      private-api-key: {Your API key}

Other Stripe Configuration

broadleaf:
  stripe:
    rest:
      should-include-level-3-data: {true || false} (1)
  1. Whether credit card level 3 data should be included in each transaction. This is most applicable for businesses that accept a significant portion of corporate credit cards. The inclusion of this data for corporate card transactions can lead to more favorable rates from the processing credit card companies.

Cart Operation Service Configuration

Add the following properties to declare the STRIPE gateway as an available payment method.

broadleaf:
  cartoperation:
    service:
      checkout:
        checkout-payment-method-options:
          - payment-method-type: CREDIT_CARD
            payment-method-gateway-type: STRIPE

STRIPE should be added to the following property to declare when transactions for this gateway should be executed, relative to other gateways, during checkout processing.

broadleaf:
  cartoperation:
    service:
      checkout:
        payment-gateway-priorities:
          - ...
          - STRIPE
          - ...

By default, Authorize transactions are executed by CartOps during checkout. If you wish to execute AuthorizeAndCapture transactions instead, define the following property:

broadleaf:
  cartoperation:
    service:
      checkout:
        checkout-transaction-types:
          STRIPE: AUTHORIZE_AND_CAPTURE
Note

This property is application-discriminated, allowing different values to be provided on a per-tenant or per-application basis using the following property paths:

  • broadleaf.cartoperation.service.checkout.tenant.mytenant.checkout-transaction-types.STRIPE=AUTHORIZE_AND_CAPTURE

  • broadleaf.cartoperation.service.checkout.application.myapplication.checkout-transaction-types.STRIPE=AUTHORIZE_AND_CAPTURE

"mytenant" & "myapplication" being the Broadleaf Tenant and Application ids.

Configuration for OrderOperationServices

STRIPE should be added to the following property to declare when ReverseAuthorize or Refund transactions for this gateway should be executed, relative to other gateways, when cancelling a fulfillment.

broadleaf:
  orderoperation:
    service:
      payment:
        cancel-payment-gateway-priorities:
          - ...
          - STRIPE
          - ...

STRIPE should be added to the following property to declare when Capture transactions for this gateway should be executed, relative to other gateways, when capturing payment for a fulfillment.

broadleaf:
  orderoperation:
    service:
      payment:
        capture-payment-gateway-priorities:
          - ...
          - STRIPE
          - ...

STRIPE should be added to the following property to declare when Refund transactions for this gateway should be executed, relative to other gateways, when refunding payment for a fulfillment return.

broadleaf:
  orderoperation:
    service:
      payment:
        refund-payment-gateway-priorities:
          - ...
          - STRIPE
          - ...