Setup of the Alokai module
The third part of the setup is installing Stripe integration for commercetools in your Alokai middleware.
yarn
yarn add @vsf-enterprise/stripe-commercetools
Setup
- Add Stripe configuration to your
middleware.config.ts
middleware.config.js
// storefront-middleware/middleware.config.ts
import { config as stripeConfig } from "./integrations/stripe";
export const config = {
integrations: {
stripe: stripeConfig,
// ..
},
};
- Add Stripe configuration file
// storefront-middleware/integrations/stripe/config.ts
export const config = {
location: "@vsf-enterprise/stripe-commercetools/server",
configuration: {
ctApi: {
apiHost: "https://api.europe-west1.gcp.commercetools.com",
authHost: "https://auth.europe-west1.gcp.commercetools.com",
projectKey: "my-project",
clientId: "***",
clientSecret: "***",
scopes: [
"manage_orders:my-project",
"manage_payments:my-project",
"view_orders:my-project",
],
},
stripe: {
profile: "stripeProfile1",
},
},
};
configuration
:ctApi
- An object containing credentials of your commercetools API client. Please refer to our documentation for commercetools integration for more information. Two notable differences are that:- the
scopes
array must containmanage_orders
,manage_payments
, andview_orders
and your API client must have access to these scopes, apiHost
should only contain the base URL, without the path to the GraphQL endpoint. For example,https://<SHOP_DOMAIN>.com/
instead ofhttps://<SHOP_DOMAIN>.com/vsf-ct-dev/graphql
.
- the
stripe
:profile
- As prepared by us, Stripe commercetools extension supports multitenancy. This field's value allows to differentiate Stripe merchant accounts.