# Integrating stripe, nothing new to the dashboard

**URL:** <https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655>\
**Category:** Help me!\
**Tags:** howtos, setup, dashboard\
**Created:** [May 10, 2022, 10:18am UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655 "2022-05-10T10:18:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 10, 2022, 10:18am UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/1 "2022-05-10T10:18:28Z")

</div>

Hello,

i come back here because i want to use the integration with Stripe that could be great and have been reading this [Stripe - Developer guide](https://docs.forestadmin.com/documentation/reference-guide/integrations/stripe)

I have added the stripe secret key, and added integration in the `forest-admin.js`.  
I actually had to run `npm install stripe` ( you should add this to the documentation)  
Nothing more has to be done according to the docs and i deployed my new backend.

But nothing has been added in the dashboard of the `user`, nothing as i can see on the tutorial.

What more should i do ?

---

<div class="post-metadata">

**Author:** ![anon15528774](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon15528774](https://community.forestadmin.com/u/anon15528774)\
**Post date:** [May 10, 2022, 11:59am UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/2 "2022-05-10T11:59:31Z")

</div>

Hello @Jules_Truong 👋

Can you share the content of your file `middleware/forestadmin.js` (erase your secrets if they are visible) and the content of your model that includes the Stripe id ?

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 10, 2022, 12:01pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/3 "2022-05-10T12:01:00Z")

</div>

```javascript
const chalk = require('chalk');
const path = require('path');
const Liana = require('forest-express-sequelize');
const { objectMapping, connections } = require('../models');

module.exports = async function forestadmin(app) {
  app.use(await Liana.init({
    configDir: path.join(__dirname, '../forest'),
    envSecret: process.env.FOREST_ENV_SECRET,
    authSecret: process.env.FOREST_AUTH_SECRET,
    schemaDir: process.env.FOREST_SCHEMA_DIR,
    objectMapping,
    connections,
    integrations: {
      stripe: {
        apiKey: process.env.STRIPE_SECRET_KEY,
        mapping: 'user.stripeRef',
        stripe: require('stripe')
      }
    }
  }));

  console.log(chalk.cyan('Your admin panel is available here: https://app.forestadmin.com/projects'));
};

```

And my model

```javascript
// This model was generated by Forest CLI. However, you remain in control of your models.
// Learn how here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models
module.exports = (sequelize, DataTypes) => {
  const { Sequelize } = sequelize;
  // This section contains the fields of your model, mapped to your table's columns.
  // Learn more here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models#declaring-a-new-field-in-a-model
  const User = sequelize.define('user', {
    createdAt: {
      type: DataTypes.DATE,
    },
    updatedAt: {
      type: DataTypes.DATE,
    },
    firstname: {
      type: DataTypes.STRING,
    },
    lastname: {
      type: DataTypes.STRING,
    },
    phonenumber: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    authId: {
      type: DataTypes.STRING,
    },
    email: {
      type: DataTypes.STRING,
    },
    stripeRef: {
      type: DataTypes.STRING,
    },
    roles: {
      type: DataTypes.ARRAY(DataTypes.STRING),
      defaultValue: Sequelize.literal('\'{user}\'::text[]'),
      allowNull: false,
    },
    status: {
      type: DataTypes.STRING,
      defaultValue: "active",
      allowNull: false,
    },
    nbLateDepartureTotal: {
      type: DataTypes.INTEGER,
      defaultValue: 0,
      allowNull: false,
    },
    nbLateDepartureConsecutive: {
      type: DataTypes.INTEGER,
      defaultValue: 0,
      allowNull: false,
    },
  }, {
    tableName: 'user',
    underscored: true,
    schema: process.env.DATABASE_SCHEMA,
  });

  // This section contains the relationships for this model. See: https://docs.forestadmin.com/documentation/v/v6/reference-guide/relationships#adding-relationships.
  User.associate = (models) => {
    User.belongsTo(models.address, {
      foreignKey: {
        name: 'addressIdKey',
        field: 'address_id',
      },
      as: 'address',
    });
    User.hasMany(models.booking, {
      foreignKey: {
        name: 'userIdKey',
        field: 'user_id',
      },
      as: 'bookings',
    });
    User.hasMany(models.membership, {
      foreignKey: {
        name: 'userIdKey',
        field: 'user_id',
      },
      as: 'memberships',
    });
    User.hasMany(models.ticket, {
      foreignKey: {
        name: 'userIdKey',
        field: 'user_id',
      },
      as: 'tickets',
    });
  };

  return User;
};

```

@anon15528774 is that ok ?  
Is there a log i should find that display that configuration for stripe is ok ?

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 10, 2022, 12:51pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/5 "2022-05-10T12:51:19Z")

</div>

@anon15528774 Just that you know, i have no warning in the logs,

It also seems like your types does not include `integrations` entry in the LianaOptions definition.

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [May 10, 2022, 1:46pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/6 "2022-05-10T13:46:40Z")

</div>

Hi Jules

Nicolas handed this thread to me  
I’ll setup a test project and check out what happens

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 10, 2022, 2:53pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/7 "2022-05-10T14:53:59Z")

</div>

Hello @anon39940173 ,

I’m confused, i’m trying to understand how your repo [GitHub - ForestAdmin/forest-express-sequelize: 🌱 Express/Sequelize agent for Forest Admin to integrate directly to your existing Express/Sequelize backend application.](https://github.com/ForestAdmin/forest-express-sequelize) works, but can’t find anything about `integrations` options in the source code.

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [May 10, 2022, 2:56pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/8 "2022-05-10T14:56:30Z")

</div>

Yes I got it.

It is possible that our documentation is not up to date as I don’t see anything wrong in the code samples that you sent.

That is why, I’m creating a test project to check that everything works the way it should in my end before using more of your time for debugging

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [May 10, 2022, 3:39pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/9 "2022-05-10T15:39:45Z")

</div>

I understand your question only now

The code in inside of the forest-express repository, which is a dependency of forest-express-sequelize

> **[forest-express/src/integrations/stripe at main · ForestAdmin/forest-express](https://github.com/ForestAdmin/forest-express/tree/main/src/integrations/stripe)**
>
> main/src/integrations/stripe

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [May 10, 2022, 5:26pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/11 "2022-05-10T17:26:41Z")

</div>

Hello again

I’ve been testing with my sample project.  
I noticed that when the `apiKey` is undefined, the behavior is the exact same than you are describing.

Can you add the following code above your call to `app.use()` ?  
`console.log('apiKey', process.env.STRIPE_SECRET_KEY)` and check that the key is defined on your end?

(do not post a screenshot containing your API key here if it is defined)

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 10, 2022, 6:02pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/12 "2022-05-10T18:02:15Z")

</div>

Yes, there is a apiKey defined. Its my testKey for the staging env and prodKey for the production env.  
Also, yes the mapping should be correct, ( @see my first post )

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 11, 2022, 10:15am UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/13 "2022-05-11T10:15:51Z")

</div>

I dont know if that could help but i got this in the logs :

```javascript
[forest] 🌳🌳🌳 Checking need for apimap update...
2022-05-11 10:11:19 default[20220511t120635] POST /forest/authentication 404 161 - 26.303 ms
2022-05-11 10:11:19 default[20220511t120635] [forest] 🌳🌳🌳 No change in apimap, nothing sent to Forest

```

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [May 11, 2022, 10:23am UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/14 "2022-05-11T10:23:47Z")

</div>

Hello Jules

I’m working on improving parameter validation on forest-express, hoping that you get logs to indicate the issue.

I’ll release a new forest-express-sequelize version shortly

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [May 11, 2022, 12:54pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/15 "2022-05-11T12:54:08Z")

</div>

Hello again

The [PR is done, and waiting for review](https://github.com/ForestAdmin/forest-express/pull/893).  
It should help detecting misconfiguration errors in the future.

In the meantime, could you do a last check for me?  
We checked your project configuration, and we do see the stripe collections there!

Is the issue that

- the stripe collections are not showing at all?
- or the stripe collections are always empty?

You should navigate to User \> Details, like in the following screenshot

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/4/4118d3c75f720a312cc663cddd1d4fffe9c86f11.png)

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 11, 2022, 1:17pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/16 "2022-05-11T13:17:19Z")

</div>

Thanks for your PR.

This is a screenshot of my user \> detail view.

 ![Capture d’écran 2022-05-11 à 15.16.24](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/e/e9c63bea6ea4f0ad772759e444ea0d6a4140f4a8.png)  
f

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 12, 2022, 4:14pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/17 "2022-05-12T16:14:54Z")

</div>

If i understand correctly, i should see a section under “Related Data” , right ?

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [May 13, 2022, 12:49pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/18 "2022-05-13T12:49:36Z")

</div>

Yes

I’m waiting for the new forest-express version with my patch to be reviewed so that we can investigate further…

As of now, I don’t see how else I can help you debugging your issue.

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 13, 2022, 1:01pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/19 "2022-05-13T13:01:35Z")

</div>

Allright, i’ll keep on eye on this thread then. See u

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [May 19, 2022, 1:37pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/20 "2022-05-19T13:37:54Z")

</div>

> [@Jules\_Truong](#):
>
> What more should i do ?

@Jules_Truong Hello  
The PR has been merged

Can you try again with forest-express-sequelize@8.5.7 ?  
Hopefully you get an error message of some kind in the console

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 19, 2022, 2:12pm UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/21 "2022-05-19T14:12:39Z")

</div>

Hello, i will only be able to check this next week.

---

<div class="post-metadata">

**Author:** ![Jules\_Truong](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jules_truong/32/4430_2.png) [@Jules\_Truong](https://community.forestadmin.com/u/Jules_Truong)\
**Post date:** [May 23, 2022, 9:11am UTC](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655/22 "2022-05-23T09:11:41Z")

</div>

Hello, some news here !

I don’t know how because i’ve been running every commands possible but something added `stripe_*` in the schema.json file.  
And this seems to work now.

Thanks anyway for the help and the PR , i believe this will help you debugging it next time.

[Next page](https://community.forestadmin.com/t/integrating-stripe-nothing-new-to-the-dashboard/4655.md?page=2)
