Skip to content

Error on parsing request body - querystring needed! #1

@wagnertimo

Description

@wagnertimo

Hi Aleksandar,

thank you for this boilerplate!
But there is a problem with the payment template. The generated code does not work by default due to the request.body problem (which is undefined). This issue you already stated in your youtube video (https://www.youtube.com/watch?v=OGdcfF5YN94&frags=pl%2Cwn).

I added the const qs = require(querystring); as you noted in the youtube video and defined the body variable as let body = qs.parse(request.body); and then ... source: body.stripeToken, ....

I also have to manually set the other charge attributes in the stripe api request, since the body only consists of stripeToken, stripeTokenType and stripeEmail (but no amount or currency attribute).

Could you please updated this? And give any hint on how to deal with getting the amount and currency from the "stripe frontend" (so no manual settings in backend is needed)?

Thank you!

Best regards,
Timo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions