You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/usage/components/CartProvider.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ const products = [
51
51
]
52
52
```
53
53
54
-
Additionally, you must verify the cartItems on the server-side before creating the CheckoutSession. For this you can use the [validateCartItems() helper](docs/usage/validate-cart-items).
54
+
Additionally, you must verify the cartItems on the server-side before creating the CheckoutSession. For this you can use the [validateCartItems() helper](/docs/usage/serverless/validate-cart-items).
The hook `useShoppingCart()` provides several utilities and pieces of data for you to use in your application. The examples below won't cover every part of the `useShoppingCart()` API but you can [look at the API](#API) below.
49
+
The hook `useShoppingCart()` provides several utilities and pieces of data for you to use in your application. The examples below won't cover every part of the `useShoppingCart()` API but you can explore the documentation to find out more.
50
50
51
51
### Products Created on Stripe's Dashboard
52
52
53
-
This is for products you created on the Stripe Dashboard. Stripe provides you with a Price ID String. You don't need a server(less)
53
+
To use client only mode, you'll need to add some products on the Stripe Dashboard. Check out [Stripe's documentation](https://stripe.com/docs/products-prices/manage-prices) for more information on how to do this.
54
+
55
+
Stripe provides you with a Price ID String. You don't need a server(less)
54
56
set up to use this library this way unless you want more control over how the payments are handled.
55
57
56
58
```jsx
@@ -62,21 +64,23 @@ const productData = [
62
64
{
63
65
name:'Bananas',
64
66
price_id:'price_GBJ2Ep8246qeeT',
67
+
// price in smallest currency unit (e.g. cent for USD)
65
68
price:400,
66
69
image:'https://www.fillmurray.com/300/300',
67
70
currency:'USD'
68
71
},
69
72
{
70
73
name:'Tangerines',
71
74
price_id:'price_GBJ2WWfMaGNC2Z',
75
+
// price in smallest currency unit (e.g. cent for USD)
72
76
price:100,
73
77
image:'https://www.fillmurray.com/300/300',
74
78
currency:'USD'
75
79
}
76
80
]
77
81
78
82
exportfunctionApp() {
79
-
/* Gets the totalPrice and a method for redirecting to stripe*/
83
+
/* Gets the totalPrice and a method for redirecting to Stripe*/
Copy file name to clipboardExpand all lines: docs/docs/welcome/getting-started-serverless.mdx
+7-5
Original file line number
Diff line number
Diff line change
@@ -38,19 +38,20 @@ ReactDOM.render(
38
38
39
39
## Using the hook
40
40
41
-
The hook `useShoppingCart()` provides several utilities and pieces of data for you to use in your application. The examples below won't cover every part of the `useShoppingCart()` API but you can [look at the API](#API) below.
41
+
The hook `useShoppingCart()` provides several utilities and pieces of data for you to use in your application. The examples below won't cover every part of the `useShoppingCart()` API but you can explore the documentation to find out more.
42
42
43
43
### Serverless implementation
44
44
45
-
If you're data source isn't coming from Stripe's dashboard, you can still make products and process payments.
45
+
If your data source isn't coming from Stripe's dashboard, you can still make products and process payments.
46
46
47
-
You're product data should look like this:
47
+
Your product data should look like this:
48
48
49
49
```js
50
50
constproductData= [
51
51
{
52
52
name:'Bananas',
53
53
id:'some_unique_id_1',
54
+
// price in smallest currency unit (e.g. cent for USD)
54
55
price:400,
55
56
image:'https://www.fillmurray.com/300/300',
56
57
currency:'USD'
@@ -68,6 +69,7 @@ const productData = [
68
69
{
69
70
name:'Tangerines',
70
71
id:'some_unique_id_2',
72
+
// price in smallest currency unit (e.g. cent for USD)
71
73
price:100,
72
74
image:'https://www.fillmurray.com/300/300',
73
75
currency:'USD',
@@ -85,7 +87,7 @@ const productData = [
85
87
]
86
88
```
87
89
88
-
_NOTE_: `price_data` and `product_data` are not required for use-shopping-cart to work, but they are required for creating Sessions with Stripe.
90
+
_Note_: `price_data` and `product_data` are not required for use-shopping-cart to work, but they are required for creating Sessions with Stripe.
89
91
90
92
This library manages `price_data` and `product_data` for you, but if you need to pass extra data to your Sessions, you can add them directly to your
91
93
product objects.
@@ -177,7 +179,7 @@ return {
177
179
}
178
180
```
179
181
180
-
_NOTE_: `price_data` and `product_data` are not required for use-shopping-cart to work, but they are required for creating Sessions with Stripe.
182
+
_Note_: `price_data` and `product_data` are not required for use-shopping-cart to work, but they are required for creating Sessions with Stripe.
181
183
182
184
This library manages `price_data` and `product_data` for you, but if you need to pass extra data to your Sessions, you can add them directly to your
Copy file name to clipboardExpand all lines: docs/docs/welcome/getting-started.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ There are two ways you can implement this library. Client Only mode and Checkout
9
9
10
10
## Client Only Mode
11
11
12
-
This is for anyone who wants to make their products on the Stripe dashboard and doesn't want to manage their
12
+
This is for anyone who wants to [configure their products](https://stripe.com/docs/products-prices/manage-prices) on the Stripe Dashboard and doesn't want to manage their
13
13
own server. This is a secure, easy way to get up and running.
Copy file name to clipboardExpand all lines: docs/docs/welcome/typescript.mdx
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
-
title: Getting Started with TypeScript
2
+
title: Getting started with TypeScript
3
3
id: getting-started-with-typescript
4
4
---
5
5
6
-
This library now works with TypeScript! You can use `use-shopping-cart` just the same as before but now with types. Take for example these two files from our very own `typescript-usage` example workspace.
6
+
This library now works with TypeScript! You can use `use-shopping-cart` just the same as before but now with types. Take for example these two files from our very own [`typescript-usage` example workspace](https://github.com/dayhaysoos/use-shopping-cart/tree/master/examples/typescript-usage).
0 commit comments