Establishing a Connection
This section describes how to connect to Stripe from your AnyPoint Studio project. You can use wizards or the XML editor in AnyPoint Studio to define connection properties in a global element. Global elements can be reused across other building blocks in your project.
Create a Connection in the Visual Editor
Complete the following steps to visually add the connector to your project and create a connection:
- Create a new Mule Project in Anypoint Studio.
- From the palette, drag the connector into your Mule flow.
- On the Message Flow canvas, double-click the connector icon to open the connector properties in the Properties pane.
- In the General section, click Add and define the Stripe connection properties. Note that the user name and Password properties always appear here. The user name must be set as it is used as the key for the connection if connection pooling is enabled.
Create a Connection in the XML Editor
Set connection properties in the <cdata-stripe:config> element in the root of the project's XML.
Note: The user name attribute must always be included here and serves as the key for the connection if connection pooling is enabled.
<cdata-stripe:config name="CData_Stripe_Configuration" username="MyName" connectionProperty1="MyProperty" ... doc:name="CData Stripe: Configuration"/>
Connecting to Stripe
You can optionally set the following to refine the data returned from Stripe.
- AccountId: Set this to the Connected Account Id which you would like to get data for. To get the account Id, navigate to the stripe dashboard and click on connected accounts from the left hand menu. You can get the account id from the connected accounts list.
Authenticating to Stripe
Stripe supports both the OAuth authentication standard, and authenticating with an API Key.
Using Live API Key Authentication
Set the AuthScheme to APIKey. From the Stripe dashboard, navigate to Developers --> API keys --> Secret key --> Reveal live API Key and set LiveAPIKey to this value.
Using OAuth Authentication
InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken. .
AuthScheme - Set this to OAuth.
CData embeds an OAuth application into the connector so you can connect without setting any connection properties for your user credentials. When you connect, the connector opens the OAuth endpoint in your default browser. Log in and grant permissions to the application. The connector then completes the OAuth process. For more information on the Embedded Credentials or information on creating a custom OAuth application, refer to our Using OAuth Authentication guide.
Configure Connector Operations
The connector is an operation-based connector; its operations correspond to SQL statements and expose other functionality such as Schema Discovery. See Using the Connector (Mule 3.8+) for more information on executing SQL to Stripe in Mule applications.