Project

pay-square

0.0
The project is in a healthy, maintained state
Adds a Square payment processor to Pay. Charge on a merchant's own connected Square account (per-merchant OAuth), with card-on-file, refunds, application fees, and webhooks.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 11.0, < 13
 Project Readme

Pay

๐Ÿ’ณ Pay::Square โ€” Square for the Pay gem

Gem Version Ruby License: MIT

A Square payment processor for Pay โ€” the payments engine for Ruby on Rails.

๐Ÿฆ Extending Pay โ€” and why Square is its own gem

Pay already speaks Stripe, Braintree, Paddle, and Lemon Squeezy. pay-square adds Square from the outside โ€” its own gem, no fork of Pay โ€” the same self-registering plugin pattern as pay-asaas.

Pay's maintainer, Chris Oliver, both welcomed this and is taking the same direction for Pay's own processors:

I'm planning to extract Braintree and Paddle from the main gem. It doesn't bloat anything having them in the gem since they're lazy loaded, but easier to maintain. [โ€ฆ] long-term we can add it to the pay org if you would like to keep maintaining it.

โ€” Chris Oliver, pay-rails/pay#1251

Not just a processor โ€” a marketplace integration

Braintree and Paddle are being split out for maintainability alone. Square is a different case: here it is used for marketplace payments โ€” Pay's term for charging on a connected merchant's own account and taking an application fee โ€” not merely to charge your own customers.

Square also issues a distinct OAuth access token per merchant (unlike Stripe Connect's single platform key plus a stripe_account header). So pay-square charges on a merchant's own connected Square account (the merchant, not you, is the merchant of record), building a Square::Client per operation from a token you supply via Pay::Square.access_token_provider, and isolates customers per merchant with a square_account column. That on-behalf-of, per-merchant model โ€” not plain processing โ€” is a core reason Square belongs in its own gem.

Scope: card payments, card-on-file, refunds, and payment/refund/card/customer webhooks. Square OAuth, token refresh, payouts/reconciliation, catalog, and the checkout UI stay in your app.

๐Ÿ“‹ Requirements

  • Ruby >= 3.1.0
  • Pay 11.x or 12.x (verified against 11.7.2 and 12.3.0)
  • square.rb ~> 44

๐Ÿ“š Docs

  • Installation โ€” Gemfile, pre-releases, and the migration
  • Configuration โ€” the per-merchant token resolver and credentials
  • Usage โ€” charges, card-on-file, refunds, and per-merchant isolation
  • Webhooks โ€” endpoint, signature verification, and handled events
  • Versioning & releasing โ€” SemVer, tags, pre-releases, and publishing
  • Contributing โ€” dev setup, running the tests, and opening issues

๐Ÿ™ Contributing

Bug reports, feature ideas, and pull requests are welcome. See CONTRIBUTING.md to get started.

๐Ÿ”— Links

RubyGems

pay-square on RubyGems ยท Changelog

The RubyGems and Pay logos are trademarks of their respective projects, used here to link to those projects, not to imply endorsement.

๐Ÿ“ License

MIT.