manishkatyan / strapi-stripe

Stripe Plugin for Strapi CMS
67 stars 33 forks source link

Issue when using aws s3 upload provider #60

Closed calvo-jp closed 1 year ago

calvo-jp commented 1 year ago

Hi. Is there a way I can configure the plugin to detect/respect my upload config? It currently appends the http://localhost:1337 to the image url which stripe detects as an invalid url.

This is what it sends

image

And this is stripe's response

image

this is what I have in my middleware.ts

{
 // more codes
 {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": [
            "'self'",
            "data:",
            "blob:",
            "dl.airtable.com",
            "<bucket>.ap-southeast-1.amazonaws.com",
          ],
          "media-src": [
            "'self'",
            "data:",
            "blob:",
            "dl.airtable.com",
            "<bucket>.s3.ap-southeast-1.amazonaws.com",
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
}

and on my plugins.ts

{
 // more codes
 upload: {
    config: {
      provider: "aws-s3",
      providerOptions: {
        accessKeyId: env("AWS_ACCESS_KEY_ID"),
        secretAccessKey: env("AWS_ACCESS_SECRET"),
        region: env("AWS_REGION"),
        params: {
          Bucket: env("AWS_BUCKET"),
        },
      },
      actionOptions: {
        upload: {},
        uploadStream: {},
        delete: {},
      },
    },
  },
}

Thanks in advance and really great work in here.

nishekh-e-r commented 1 year ago

Hi @calvo-jp we are checking on this issue, once it's done we will inform you.

calvo-jp commented 1 year ago

thank you @nishekh-e-r

nishekh-e-r commented 1 year ago

Hi @calvo-jp The image URL error has been fixed, please download the latest version package here

calvo-jp commented 1 year ago

Omg. Thanks bro. I really appreciate it. Hope you guys all the best