# Install the Stripe app for Salesforce Order Management Set up and configure the Stripe app. ## Before installing the Salesforce Order Management App 1. Identify the organization and B2C Commerce store in your Salesforce instance where you want to install and map the app. 1. Review the entitlements and [prerequisites](https://docs.stripe.com/use-stripe-apps/salesforce-order-management.md) before starting the installation process. 1. Note the integration limitations: 1. Supports only a single B2C storefront 1. Supports one time manual capture only 1. Doesn’t support complex scenarios like over-capture and multi-capture ## Installation To learn more about integrating with Salesforce Order Management, contact us using the form at [Stripe support](https://support.stripe.com). Make sure **Install for Admins Only** is selected, then click **Install**. ![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-install.a95bc450897ae2c8fec49837590ce099.png) Approve access to and from third-party websites. Check the grant access checkbox and click **Continue**. ![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-3p-access.fea0d91a0e164d00b01c288cbe51475e.png) If the installation takes time, you’ll receive an email telling you the package is installed. To verify, go to **Setup > Apps > Packaging > Installed Packages** and make sure the package is installed. ## Configuration Instructions in the following sections detail how to configure your integration. ### Configure a Stripe Synchronous Payment Gateway Adapter 1. Follow the instructions in step 3 of [Set Up a Synchronous Payment Gateway Adapter in Salesforce](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_commercepayments_sync_adapter_setup.htm) to create a payment gateway provider. Here’s the set of values we recommend for the payload: ```json { "ApexAdapterId": "Output of this Query: SELECT Id FROM ApexClass WHERE Name IN ('StripeAdapter')", "DeveloperName": "StripeProvider", "MasterLabel": " StripeProvider", "IdempotencySupported": "No", "Comments": "Stripe Synchronous Payment Gateway Adapter" } ``` 1. Follow the instructions in step 4 of [Set Up a Synchronous Payment Gateway Adapter in Salesforce](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_commercepayments_sync_adapter_setup.htm) to create a payment gateway record. Recommended values: | Field Label | Value | | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Name | SALESFORCE_PAYMENTS | | Merchant Credential ID | Output of this query: `SELECT Id FROM NamedCredential WHERE DeveloperName = 'StripeAPI'` | | Payment Gateway Provider | Output of the query (modify the query accordingly if your Stripe Synchronous Payment Gateway Provider is different than ‘StripeProvider’): `SELECT Id FROM PaymentGatewayProvider WHERE DeveloperName ='StripeProvider'` | | Status | Active | ### Configure a Stripe Asynchronous Payment Gateway Adapter 1. Follow the instructions in [Set Up an Asynchronous Payment Gateway Adapter in Salesforce](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_commercepayments_async_adapter_setup.htm) to configure the Stripe Asynchronous Payment Gateway Adapter (skip step 2 and 3 if you’ve already executed the same for the Stripe Synchronous Payment Gateway Adapter). To create an asynchronous Payment Gateway Provider (follow step 4 from the previously linked instruction). Here is the recommended set of values for the payload: ```json { "ApexAdapterId": "Output of this Query: SELECT Id FROM ApexClass WHERE Name IN (‘StripeAsyncAdapter’)", "DeveloperName": "StripeAsyncAdapter", "MasterLabel": " StripeAsyncAdapterProvider ", "IdempotencySupported": "No", "Comments": "Stripe Asynchronous Payment Gateway Adapter" } ``` 1. Follow the instruction from step 5 (Create a payment gateway record) in [Set Up an Asynchronous Payment Gateway Adapter in Salesforce](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_commercepayments_async_adapter_setup.htm) to register the Stripe Asynchronous Payment Gateway record in Salesforce. Here are the recommended values for the fields to be inserted (if you’re creating a gateway record for the first time) or updated (if you’ve already created a gateway record while setting up the synchronous payment gateway adapter) | Field Label | Value | | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Name | SALESFORCE_PAYMENTS | | Merchant Credential ID | Output of this query: `SELECT Id FROM NamedCredential WHERE DeveloperName = 'StripeAPI'` | | Payment Gateway Provider | Output of the query (modify the query accordingly if your Stripe Synchronous Payment Gateway Provider is different than ‘StripeProvider’): `SELECT Id FROM PaymentGatewayProvider WHERE DeveloperName ='StripeAsyncAdapter'.` | | Status | Active | 1. Follow the instructions in step 6 to configure the webhook URL for Stripe. The typical format of the webhook URL is a publicly accessible, HTTPS URL. For example: https://mydomainname.my.salesforce-sites.com/subdomain/services/data/v[Replace_ME_version]/commerce/payments/notify%20?provider= ```sql SELECT Id FROM PaymentGatewayProvider WHERE DeveloperName = ‘StripeAsyncAdapter’ ``` [Replace_ME_version] with the API version of your org 49.0 and later 1. Follow these steps to register your webhooks URL in Stripe: 1. Log in to the [Stripe Dashboard](https://dashboard.stripe.com/dashboard). 1. Go to the [Webhooks](https://dashboard.stripe.com/webhooks) tab in Workbench. 1. Click **Create new endpoint**. 1. Add the following event types: `charge.refunded`, `charge.succeeded`, `charge.captured`, then click **Continue**. 1. Enter your webhooks URL, then click **Create destination**. 1. Copy your webhook signing secret and save it for later use.![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-stripe-copy-wh-secret.6520c64215f84d4053a8bf9c927d8796.png) ## Complete the configurations using Stripe OM Setup Instructions in the following sections detail how to complete the configuration of your integration. ### Authorize the Stripe OMS App with your Stripe Account In your Salesforce Order Management org, go through the Stripe Setup Assistant to connect your org to your Stripe account. 1. Click the App Launcher, then click **View All**. ![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-launch-app-launcher.abb6c08a1cde704115918ebaddfe3ff4.png) 1. Click **Stripe OM Setup**. ![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-launch-om-setup.d84d6c532e02356ab40073b2bec20f14.png) 1. Click **Get Started**. 1. Toggle live mode. We recommend leaving live mode disabled to test your Stripe integration without affecting your live data, and activating live mode when you’re ready to start processing real transactions with the Stripe Payment Gateway. Come back to this step and reauthorize your connection to switch between test mode and live mode. If you’re in live mode and you want to switch back to test mode, you don’t need to re-authorize. 1. Click **Authorize**. ![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-authorize.d4883cff2b90cce49e6054a05daa9079.png) This allows Salesforce to access your Stripe data so you can capture and refund payments. The Stripe website opens to complete the authorization process, which might require you to enter login information or activate your Stripe account. When done, you’re redirected to this page to finish the setup process. After authorization is complete and successful, the following message displays: ![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-authorize-complete.8ff6523255d2652a3dacaa56304c0090.png) Store the webhook signing secret for Stripe asynchronous payment processing. ![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-store-wh-secret.9918a70a19d3886755228a68102c1979.png) 1. Add the webhook signing secret value in **Signing secret**. 1. Click **Update**. 1. A message appears on top to confirm successful insertion. Click **Finish**. ### Modify existing order management flows The authentication with Stripe is using OAuth, where Stripe is the OAuth provider. Salesforce doesn’t support Stripe as an OAuth provider, therefore the OAuth token is obtained using a custom integration, leveraging an invocable action **getAccesToken**. This is packaged as part of the Stripe OM app Managed Package. Identify the flow that initiates the payment or refund to Stripe and include the **getAccessToken** invocable method in an action just before the **Ensure Funds** action in the flow (as shown in the following example). The flows that you need to modify varies from the one shown in the following example. 1. Navigate to **Setup > Process Automation > Flows**. 1. Select the active **Flow** to use to capture funds. 1. Create a new **Action** that calls the `getAccessToken` invocable method. ![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-generate-token.4e707e9311288fd5e7f6e93a47dc638d.png) 1. Make sure that the **Get Access Token** action occurs before the **Capture Funds** action. After it completes, save a new version of this **Flow** to make sure that your processes use the new version. ![](https://b.stripecdn.com/docs-statics-srv/assets/sfom-flowbuilder.22b239ea431eca499ef4cddd690ade94.png) 1. You can now use Stripe Payment as a payment method in your Order Management org. You can now place orders from Salesforce B2C Commerce Cloud and complete transactions, such as capture and refund transactions for payment methods that are associated with Salesforce commerce payments. ## Next steps - [Operations and Maintenance](https://docs.stripe.com/use-stripe-apps/salesforce-order-management/operations-and-maintenance.md) - [Testing](https://docs.stripe.com/use-stripe-apps/salesforce-order-management/testing.md)