njosefbeck / gatsby-source-stripe

Gatsby source plugin for building websites using Stripe as a data source
74 stars 17 forks source link

Products with recurring payment not shown on Gatsby shop #47

Closed mcneiljv closed 4 years ago

mcneiljv commented 4 years ago

Prerequisites

Description

I'm trying to use this plugin to set up a Gatsby storefront for my company. However, we want our products to be subscription-based. The one time payment products show up fine, but the ones with recurring payments fail to show up on the storefront even after I stop my localhost and start it up again.

Steps to Reproduce

  1. Add product to Stripe with recurring payment
  2. Close local server and restart
  3. The recurring payment product does not show up

Expected behavior: The recurring payment product should show up on the store along with the one time payment products

Actual behavior: The recurring payment product does not show up.

Reproduces how often: 100% of the time

Versions

os: MacOS High Sierra 10.13.6 node: v10.7.0 npm: 6.14.2 gatsby: Gatsby CLI version: 2.8.22 gatsby-source-stripe: 2.2.2

Additional Information

None.

njosefbeck commented 4 years ago

Hi Jamie!

First, yay for using Gatsby for your company's storefront! That's awesome! Also, sorry to hear that you're having this issue.

I just did a test and was able to get back both products of type good and service from Stripe using gatsby-source-stripe. For this test I was using the latest version of my plugin (3.0.6).

My gatsby config for this plugin looked like:

{
  resolve: `gatsby-source-stripe`,
  options: {
    objects: ['Product'],
    secretKey: ***,
    }
}

My GraphQL query and results looked like:

Screen Shot 2020-03-11 at 2 00 01 PM

Some initial thoughts that you could try:

One thing I did notice is that if you're trying to query for SKUs, since service products don't have SKUs, it's not going to return those products with that query.

Let me know if any of the above helps! If not, we can do more digging.

mcneiljv commented 4 years ago

Ah! See, I'm only getting the allStripeSku and stripeSku options in graphql currently. I will update and post here with my findings! Thanks.

mcneiljv commented 4 years ago

I updated my plugin and that did it! Thanks a ton for your help. Closing this issue.

njosefbeck commented 4 years ago

Yay wonderful! I'm so glad it worked. I'll make a note to update the README to include a "Gotchas" section for things like this.

Also, I'd love to feature your site in the plugin's README once it's live, so be sure to be in touch! Thanks!