Skip to content

Commit

Permalink
docs: snowpack example
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Beatty committed Mar 25, 2021
1 parent e5cfd8a commit 6553e53
Show file tree
Hide file tree
Showing 6 changed files with 562 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/snowpack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# snowpack

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.

## How to use

Clone, install, and start:

```sh
# clone from github
git clone https://github.com/square/web-sdk.git
# go to example
cd examples/snowpack
# install dependencies
npm install
# start development server
npm start
```

Snowpack will open `index.html` which includes `pay.js` where Square Web SDK is set up to take a card payment.
14 changes: 14 additions & 0 deletions examples/snowpack/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lange="en">
<head>
<meta charset="utf-8" />
<title>Square Web SDK Example</title>
</head>

<body>
<div id="card"></div>
<button type="button" id="pay">Pay $1.00</button>

<script type="module" src="./pay.js"></script>
</body>
</html>
Loading

0 comments on commit 6553e53

Please sign in to comment.