The StripeConnect component

The StripeConnect component will basically complete the remaining auth process steps with Stripe, and render relevant messages based on whether the Stripe connection was successful:

When the StripeConnect component loads, in componentDidMount, we will first parse the query parameters attached to the URL from the Stripe redirect. For parsing, we use the same query-string npm module that we used previously for the product search. Then, if the URL query parameter contains an auth code, we make an API call necessary to complete the Stripe OAuth from our server.

mern-marketplace/client/user/StripeConnect.js:

 componentDidMount ...

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.