Skip to content

Stripe payment not working - missing UserId on webhook call #4

@rgamage

Description

@rgamage

When a stripe payment is processed, Stripe calls back on /api/payment to FullFillOrder() method. This should fetch the shopping cart items and add an Order to the Order table, then clear the shopping cart items.

However, as the stripe client is not an authenticated / logged in user, the PaymentController has no identity for it, therefore the CurrentUser is null, or rather the _currentUser.UserId is null, and therefore no shopping cart items are retrieved.

I believe we need to pass in a UserId when we create the checkout session (PaymentService.CreateCheckoutSession()), using some stripe field like ClientReferenceId. Then, on the callback processing side, we need to parse this UserId and pass it to the GetDbCartProductsQueryRequest.

Has this workflow ever been tested, has it ever worked? Am I missing something fundamental?

Thanks,
Randy

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