#baoleduc

1 messages · Page 1 of 1 (latest)

fair runeBOT
exotic sage
#

So your Stripe App is attempting to get resources from your external server?

hollow comet
#

yes

exotic sage
#

What are you trying to load from the external server?

hollow comet
#

yes, it's from an external server (my server)

exotic sage
#

Right, but what is the resource it's trying to get?

hollow comet
#

it's an API that I want to load data from and render on the UI using UI Extensions

lime hearth
#

Hi 👋

By chance could you share your stripe-app.json file?

hollow comet
lime hearth
#

I was going to ask about that. CSP errors usually mean you need to configure your API in the file. For instance, an old integration of mine using a Heroku back-end had this.

content_security_policy": {
      "connect-src": [
        "https://stripe-apps-backend.herokuapp.com/account"
      ],
      "image-src": null,
      "purpose": "Get account info"
    }
hollow comet
#

Here is a snippet of my stripe-app.json

      "connect-src": [
        "https://cowardly-bear-87.telebit.io/notes",
        "https://cowardly-bear-87.telebit.io/notes/*",
        "https://cowardly-bear-87.telebit.io/note"
      ],

When I tried to upload to Stripe, it said

invalid stripe-app.json:
found violation for connect-src "https://cowardly-bear-87.telebit.io/notes/*": path cannot contain wildcard
#

How can I add a parameter after a base path?

lime hearth
#

I think you would need to encode it as a query parameter ?param=foo rather than a part of the URL path

#

We only allow wildcards for subdomains as we mention in our docs

If using a wildcard (), it must be in the left-most DNS label (example: https://.example.com/api/users/).

#

But also, if you read the details for the connect-src URL, you will see you don't need the wildcard

#

So https://cowardly-bear-87.telebit.io/notes/ would cover every path that comes after notes/