Skip to content

Commit 7018488

Browse files
authored
initial commit (#551)
1 parent f67081a commit 7018488

File tree

5 files changed

+1226
-0
lines changed

5 files changed

+1226
-0
lines changed

examples/vite/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# vite
2+
3+
Use [Vite](https://vite.dev/), a fast frontend build tool, to build a simple payment form with Square Web SDK.
4+
5+
## How to use
6+
7+
Clone, install, and start:
8+
9+
```sh
10+
# clone from github
11+
git clone https://github.com/square/web-sdk.git
12+
# go to example
13+
cd examples/vite
14+
# install dependencies
15+
npm install
16+
# start development server
17+
npm start
18+
```
19+
20+
Vite will serve `index.html` which includes `pay.js` where Square Web SDK is set up to take a card payment.

examples/vite/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>Square Web SDK Example</title>
7+
</head>
8+
9+
<body>
10+
<div id="card"></div>
11+
<button type="button" id="pay">Pay $1.00</button>
12+
13+
<script type="module" src="./pay.js"></script>
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)