TypeScript payment provider libraries from Bates Solutions, in one repo.
| Package | Provider | JSR | API docs |
|---|---|---|---|
@bates-solutions/squareup |
Square | docs | |
@bates-solutions/stripe |
Stripe | docs | |
@bates-solutions/clover |
Clover | docs | |
@bates-solutions/payments-core |
Shared primitives (0.x) | docs |
All four packages are developed and released from this repo. The old Bates-Solutions/squareup,
stripe and clover repos are archived; their history and tags (renamed <package>-v<version>)
are here.
Report problems in this repo's issues, naming the package.
Each package is published on JSR. On Node, they need version 22 or later.
# npm / pnpm / yarn (via JSR's npm compatibility)
npx jsr add @bates-solutions/squareup
# Deno
deno add jsr:@bates-solutions/squareup@bates-solutions/squareup and @bates-solutions/stripe also need their provider's SDK (square
and stripe) as a peer dependency. Each package's README covers its setup and usage.
The API reference for every package is at https://bates-solutions.github.io/payments/, one path
per package (for example /stripe/). Each
package also has hand-written guides in packages/<name>/docs/.
npm run docsregenerates each package's markdown API reference inpackages/<name>/docs/api/, which is committed and readable on GitHub.npm run docs:sitebuilds the HTML site intosite/(scripts/build-site.mjs): typedoc HTML for each package plus an index page. It does not touch the committed markdown.
.github/workflows/docs.yml builds the site on pull requests that touch a package's source or docs
config, and deploys it to GitHub Pages on each such push to main.
npm ci
npm run check # lint, typecheck, build and test every package, then the scripts' testsGitHub Actions (.github/workflows/ci.yml) runs on every pull request, whatever its base branch,
and on every push to main. It checks only the packages a change affects: a change under
packages/<name>/ checks that package, a change to root config, .github/ or scripts/ checks
every package, and a change to root docs (README.md, LICENSE) checks none. For each affected
package it runs lint, typecheck, build, tests with coverage and a JSR publish dry run, on
GitHub-hosted runners. The ci-ok check sums up the run.
Releases are automated with release-please
(release-please-config.json, .release-please-manifest.json) and .github/workflows/release.yml.
Each package has its own version, changelog and tags (<package>-v<version>, for example
clover-v1.1.1).
- Commits use Conventional Commits. A
fix:underpackages/<name>/makes a patch release of that package, afeat:a minor one, and a!orBREAKING CHANGE:footer a major one.chore:,docs:,ci:,test:andrefactor:make none. - On each push to
main, release-please updates one open release PR. It bumps each changed package'spackage.json,jsr.jsonandCHANGELOG.md. - Merging the release PR tags each package and creates its GitHub release. The workflow then publishes those versions to JSR over GitHub OIDC, with provenance. It skips any version JSR already has.
PRs merge with a merge commit (squash and rebase are off, so stacked PRs work). The merge commit's subject is GitHub's Merge pull request #N from …, which release-please ignores, but its body is the PR title, which release-please parses like any commit message. Each commit on the branch becomes a changelog line, and so does every further type(scope): paragraph in a commit's message, so:
- Don't give the PR title a Conventional Commit type: write
Squareup: support ad hoc order taxes, notfeat(squareup): support ad hoc order taxes. A typed title adds a second line for the same change. (GitHub won't leave the merge commit body blank while keeping theMerge pull requestsubject, so the title convention is the fix.) Bot PRs titledchore(deps): …are harmless, sincechoregets no changelog line. - Give every commit on the branch the type and scope its changelog line should have. A review fix to a feature that hasn't shipped yet is
test:,refactor:orchore:, or is folded into the feature commit with afixup(notsquash, which keeps the fix's message as a second paragraph that release-please still lists). Folding rewrites the branch, so rebase any PR stacked on it. - Don't put a
BEGIN_COMMIT_OVERRIDEblock in the PR body. release-please applies it to every commit in the PR, the merge commit included, so a PR with two branch commits lists each override line three times.
Never bump versions, create tags or run jsr publish by hand.
Releases before the move were made from the old repos, which are archived. Their tags were imported
here as <package>-v<version>.
Name the affected package and version in your report.
Please report a vulnerability privately, as described in SECURITY.md. Don't open a public issue for it.
Contributions are welcome. See
CONTRIBUTING.md and the
code of conduct. The
squareup, stripe and clover packages also have their own CONTRIBUTING.md in packages/<name>/.
MIT.
Made by Bates Solutions.