manishkatyan / strapi-stripe

Stripe Plugin for Strapi CMS
67 stars 33 forks source link

[Critical] Plugin Dashboard wont open if use AED currency. #48

Closed Th3Un1qu3M4n closed 2 years ago

Th3Un1qu3M4n commented 2 years ago

Description

When creating a product with UAE currency AED set in the configuration, the strapi plugin dashbard is unable to map over the products.

To Repoduce

STRAPI VERSION: v4.3.6 NODE VERSION: v16.14.0

In the stripe plugin configuration select AED currency Create a product and view plugin dashboard

Expected Behaviour

Dashboard with white screen and in console the following error..

[request].d0f30510.chunk.js:1381 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'symbol')
    at getProductPrice ([request].d0f30510.chunk.js:1381:32)
    at [request].d0f30510.chunk.js:1474:6
    at Array.map (<anonymous>)
    at ProductTable ([request].d0f30510.chunk.js:1464:238)
    at Ch (main.9fcd4a78.js:97497:137)
    at li (main.9fcd4a78.js:97520:154)
    at ck (main.9fcd4a78.js:97609:343)
    at bk (main.9fcd4a78.js:97590:347)
    at ak (main.9fcd4a78.js:97590:278)
    at Tj (main.9fcd4a78.js:97590:138)

image

Other Behaviour

Products are being created in Stripe as well as can be queried from the endpoint.

localhost:1337/strapi-stripe/getProduct/0/5/name/asc

Reponse

{
    "res": [
        {
            "id": 2,
            "title": "asdadadas",
            "slug": null,
            "description": "asdafasda",
            "price": 10,
            "currency": "aed",
            "isSubscription": false,
            "interval": "",
            "trialPeriodDays": null,
            "stripeProductId": "prod_MJGSqefiKgyEj2",
            "stripePriceId": "price_1LadvOFYNCDuZTtJRGVtVC7e",
            "stripePlanId": "",
            "createdAt": "2022-08-25T11:08:38.145Z",
            "updatedAt": "2022-08-25T11:08:38.145Z",
            "productImage": {
                "id": 4,
                "name": "strapi-logo.jpeg",
                "alternativeText": null,
                "caption": null,
                "width": 657,
                "height": 350,
                "formats": {
                    "thumbnail": {
                        "name": "thumbnail_strapi-logo.jpeg",
                        "hash": "thumbnail_strapi_logo_11f90f4573",
                        "ext": ".jpeg",
                        "mime": "image/jpeg",
                        "path": null,
                        "width": 245,
                        "height": 131,
                        "size": 4.46,
                        "url": "/uploads/thumbnail_strapi_logo_11f90f4573.jpeg"
                    },
                    "small": {
                        "name": "small_strapi-logo.jpeg",
                        "hash": "small_strapi_logo_11f90f4573",
                        "ext": ".jpeg",
                        "mime": "image/jpeg",
                        "path": null,
                        "width": 500,
                        "height": 266,
                        "size": 10.14,
                        "url": "/uploads/small_strapi_logo_11f90f4573.jpeg"
                    }
                },
                "hash": "strapi_logo_11f90f4573",
                "ext": ".jpeg",
                "mime": "image/jpeg",
                "size": 13.48,
                "url": "/uploads/strapi_logo_11f90f4573.jpeg",
                "previewUrl": null,
                "provider": "local",
                "provider_metadata": null,
                "folderPath": "/",
                "createdAt": "2022-08-25T11:08:36.777Z",
                "updatedAt": "2022-08-25T11:08:36.777Z"
            },
            "stripePayment": [],
            "createdBy": null,
            "updatedBy": null
        },
       // ....second object
    ],
    "count": 2
}
nishekh-e-r commented 2 years ago

@Th3Un1qu3M4n we have fixed the issue please install the latest updated plugin here