Skip to content

Commit afbbca5

Browse files
author
Max Beatty
committed
docs: snowpack example
1 parent e5cfd8a commit afbbca5

File tree

6 files changed

+566
-0
lines changed

6 files changed

+566
-0
lines changed

examples/snowpack/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# snowpack
2+
3+
Use [Snowpack](https://www.snowpack.dev/), "a lightning-fast frontend build tool, designed for the modern web", 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/snowpack
14+
# install dependencies
15+
npm install
16+
# start development server
17+
npm start
18+
```
19+
20+
Snowpack will open `index.html` which includes `pay.js` where Square Web SDK is set up to take a card payment.

examples/snowpack/index.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lange="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Square Web SDK Example</title>
6+
</head>
7+
8+
<body>
9+
<div id="card"></div>
10+
<button type="button" id="pay">Pay $1.00</button>
11+
12+
<script type="module" src="./pay.js"></script>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)