)}
{!dialog && }
setDialog(false)}
onLogin={(user) => console.log(`Hello `, user?.user_metadata)}
onSignup={(user) => console.log(`Hello `, user?.user_metadata)}
onLogout={() => console.log("bye")}
/>
);
};
export default IndexPage;
```
```bash
git config user.email "1676496+javaniecampbell@users.noreply.github.com"
```
### References
https://github.com/sw-yx/gatsby-plugin-netlify-identity
================================================
FILE: documentation/Step 2 - Integrating Stripe Guide.md
================================================
## Stripe Integration Guide
1. Need to create a list of products that's not client side (i.e. database, a JSON file, etc)
2. Cannot trust data sent from the client, because it can be corrupted or tampered with.
3. Buy Button will trigger a Netlify Function, that will be called to get the price, etc.
4. The Function will then create a stripe checkout session
5. Return the session back to the client
6. Stripe JS redirects using the session to the Stripe Checkout Service
### Step 1: Install the packages and create `functions/`
#### Create directory
Make the `functions/` directory at the root of your client application
```bash
mkdir functions
```
Then initialize the `functions/` directory as follows:
```bash
npm init -y
```
OR
```bash
yarn init -y
```
Then install your packages in the `functions/` directory so that they manage it's own packages and reducing build errors at deployment:
```bash
npm install stripe node-fetch --prefix=functions
```
OR
```bash
yarn add stripe node-fetch --cwd functions
```
================================================
FILE: layot.txt
================================================
Directory: C:\Users\jc601810\workspace\DDoW-Projects\ecommerce-starter
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 7/21/2022 7:46 PM .docker
d---- 7/21/2022 7:47 PM .k8s
d---- 1/2/2021 11:14 AM documentation
d---- 1/15/2022 11:43 AM ecommerce-frontend
d---- 2/8/2021 9:33 PM editor
-a--- 7/21/2022 7:47 PM 28 .gitignore
-a--- 7/2/2023 11:20 PM 0 layot.txt